]> git.sur5r.net Git - openldap/commitdiff
Import experimental SQL from devel and associated configure
authorKurt Zeilenga <kurt@openldap.org>
Thu, 6 Jul 2000 18:44:48 +0000 (18:44 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Thu, 6 Jul 2000 18:44:48 +0000 (18:44 +0000)
support.

31 files changed:
build/top.mk
configure
configure.in
include/portable.h.in
servers/slapd/back-sql/Makefile.in [new file with mode: 0644]
servers/slapd/back-sql/back-sql.h [new file with mode: 0644]
servers/slapd/back-sql/backsql.dsp [new file with mode: 0644]
servers/slapd/back-sql/bind.c [new file with mode: 0644]
servers/slapd/back-sql/config.c [new file with mode: 0644]
servers/slapd/back-sql/docs/bugs [new file with mode: 0644]
servers/slapd/back-sql/docs/concept [new file with mode: 0644]
servers/slapd/back-sql/docs/install [new file with mode: 0644]
servers/slapd/back-sql/docs/platforms [new file with mode: 0644]
servers/slapd/back-sql/docs/todo [new file with mode: 0644]
servers/slapd/back-sql/entry-id.c [new file with mode: 0644]
servers/slapd/back-sql/entry-id.h [new file with mode: 0644]
servers/slapd/back-sql/external.h [new file with mode: 0644]
servers/slapd/back-sql/init.c [new file with mode: 0644]
servers/slapd/back-sql/modify.c [new file with mode: 0644]
servers/slapd/back-sql/other.c [new file with mode: 0644]
servers/slapd/back-sql/rdbms_depend/mssql/slapd.conf [new file with mode: 0644]
servers/slapd/back-sql/rdbms_depend/mysql/slapd.conf [new file with mode: 0644]
servers/slapd/back-sql/rdbms_depend/oracle/slapd.conf [new file with mode: 0644]
servers/slapd/back-sql/schema-map.c [new file with mode: 0644]
servers/slapd/back-sql/schema-map.h [new file with mode: 0644]
servers/slapd/back-sql/search.c [new file with mode: 0644]
servers/slapd/back-sql/sql-types.h [new file with mode: 0644]
servers/slapd/back-sql/sql-wrap.c [new file with mode: 0644]
servers/slapd/back-sql/sql-wrap.h [new file with mode: 0644]
servers/slapd/back-sql/util.c [new file with mode: 0644]
servers/slapd/back-sql/util.h [new file with mode: 0644]

index 1dc03e30c8975a91146ac07505e418cb0e32cd94..32d3c6d9596911ab7e255385a9e5ce9968606d4b 100644 (file)
@@ -135,7 +135,12 @@ MODULES_LIBS = @MODULES_LIBS@
 TERMCAP_LIBS = @TERMCAP_LIBS@
 LINK_BINS_DYNAMIC = @LINK_BINS_DYNAMIC@
 
-SLAPD_LIBS = @SLAPD_LIBS@
+SLAPD_SQL_LDFLAGS = @SLAPD_SQL_LDFLAGS@
+SLAPD_SQL_INCLUDES = @SLAPD_SQL_INCLUDES@
+SLAPD_SQL_LIBS = @SLAPD_SQL_LIBS@
+
+SLAPD_LIBS = @SLAPD_LIBS@ \
+       @SLAPD_SQL_LDFLAGS@ @SLAPD_SQL_LIBS@
 SLURPD_LIBS = @SLURPD_LIBS@
 
 # Our Defaults
index 864c003d80c8d54e952eed854d921376d2e069e5..0aebb038e42433bbe2434cde2170c65fcd6479ed 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # $OpenLDAP$
-# from OpenLDAP: pkg/ldap/configure.in,v 1.223.2.6 2000/07/04 17:58:43 kurt Exp  
+# from OpenLDAP 
 
 # Copyright 1998-2000 The OpenLDAP Foundation.  All Rights Reserved.
 # 
@@ -110,6 +110,10 @@ ac_help="$ac_help
     --enable-shell     enable shell backend (no)"
 ac_help="$ac_help
       --with-shell-module      module type (static)"
+ac_help="$ac_help
+    --enable-sql       enable sql backend (no)"
+ac_help="$ac_help
+      --with-sql-module        module type (static)"
 ac_help="$ac_help
 SLURPD (Replication Daemon) Options:"
 ac_help="$ac_help
@@ -670,7 +674,7 @@ echo "Configuring OpenLDAP $OL_VERSION ..."
 
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:674: checking host system type" >&5
+echo "configure:678: checking host system type" >&5
 if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then
 
 # Make sure we can run config.sub.
@@ -711,7 +715,7 @@ host_os=$ac_cv_host_os
 
 
 echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:715: checking target system type" >&5
+echo "configure:719: checking target system type" >&5
 if test "x$ac_cv_target" = "x" || (test "x$target" != "xNONE" && test "x$target" != "x$ac_cv_target_alias"); then
 
 # Make sure we can run config.sub.
@@ -751,7 +755,7 @@ target_os=$ac_cv_target_os
 
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:755: checking build system type" >&5
+echo "configure:759: checking build system type" >&5
 if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then
 
 # Make sure we can run config.sub.
@@ -828,7 +832,7 @@ test "$host_alias" != "$target_alias" &&
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:832: checking for a BSD compatible install" >&5
+echo "configure:836: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"\${ac_cv_path_install+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -885,7 +889,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:889: checking whether build environment is sane" >&5
+echo "configure:893: checking whether build environment is sane" >&5
 # Just in case
 sleep 1
 echo timestamp > conftestfile
@@ -946,7 +950,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:950: checking for $ac_word" >&5
+echo "configure:954: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -976,7 +980,7 @@ test -n "$AWK" && break
 done
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:980: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:984: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1016,7 +1020,7 @@ fi
 
 missing_dir=`cd $ac_aux_dir && pwd`
 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:1020: checking for working aclocal" >&5
+echo "configure:1024: checking for working aclocal" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -1029,7 +1033,7 @@ else
 fi
 
 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:1033: checking for working autoconf" >&5
+echo "configure:1037: checking for working autoconf" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -1042,7 +1046,7 @@ else
 fi
 
 echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:1046: checking for working automake" >&5
+echo "configure:1050: checking for working automake" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -1055,7 +1059,7 @@ else
 fi
 
 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:1059: checking for working autoheader" >&5
+echo "configure:1063: checking for working autoheader" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -1068,7 +1072,7 @@ else
 fi
 
 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:1072: checking for working makeinfo" >&5
+echo "configure:1076: checking for working makeinfo" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -1088,7 +1092,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1092: checking for $ac_word" >&5
+echo "configure:1096: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_AMTAR+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1139,7 +1143,7 @@ EOF
 
 
 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
-echo "configure:1143: checking configure arguments" >&5
+echo "configure:1147: checking configure arguments" >&5
 
 
 top_builddir=`pwd`
@@ -2010,6 +2014,47 @@ else
 fi
 # end --with-shell_module
 
+# OpenLDAP --enable-sql
+       # Check whether --enable-sql or --disable-sql was given.
+if test "${enable_sql+set}" = set; then
+  enableval="$enable_sql"
+  
+       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-sql" 1>&2; exit 1; }
+       fi
+       ol_enable_sql="$ol_arg"
+
+else
+       ol_enable_sql="no"
+fi
+# end --enable-sql
+# OpenLDAP --with-sql_module
+       # Check whether --with-sql_module or --without-sql_module was given.
+if test "${with_sql_module+set}" = set; then
+  withval="$with_sql_module"
+  
+       ol_arg=invalid
+       for ol_val in static dynamic ; 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-sql_module" 1>&2; exit 1; }
+       fi
+       ol_with_sql_module="$ol_arg"
+
+else
+       ol_with_sql_module="static"
+fi
+# end --with-sql_module
+
 
 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
 if test "${with_xxslurpdoptions+set}" = set; then
@@ -2109,6 +2154,9 @@ if test $ol_enable_slapd = no ; then
        if test $ol_enable_shell = yes ; then
                echo "configure: warning: slapd disabled, ignoring --enable-shell argument" 1>&2
        fi
+       if test $ol_enable_sql = yes ; then
+               echo "configure: warning: slapd disabled, ignoring --enable-sql argument" 1>&2
+       fi
        if test $ol_enable_modules = yes ; then
                echo "configure: warning: slapd disabled, ignoring --enable-modules argument" 1>&2
        fi
@@ -2148,6 +2196,9 @@ if test $ol_enable_slapd = no ; then
        if test $ol_with_shell_module != static ; then
                echo "configure: warning: slapd disabled, ignoring --with-shell-module argument" 1>&2
        fi
+       if test $ol_with_sql_module != static ; then
+               echo "configure: warning: slapd disabled, ignoring --with-sql-module argument" 1>&2
+       fi
        if test $ol_enable_slurpd = yes ; then
                { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
        fi
@@ -2158,6 +2209,7 @@ if test $ol_enable_slapd = no ; then
        ol_enable_ldbm=no
        ol_enable_passwd=no
        ol_enable_shell=no
+       ol_enable_sql=no
 
        ol_enable_modules=no
        ol_enable_multimaster=no
@@ -2175,6 +2227,7 @@ if test $ol_enable_slapd = no ; then
        ol_with_ldbm_module=static
        ol_with_passwd_module=static
        ol_with_shell_module=static
+       ol_with_sql_module=static
 
        ol_enable_slurpd=no
 
@@ -2196,7 +2249,8 @@ elif test $ol_enable_ldbm = no ; then
                $ol_enable_dnssrv = no -a \
                $ol_enable_ldap = no -a \
                $ol_enable_passwd = no -a \
-               $ol_enable_shell = no ; then
+               $ol_enable_shell = no -a \
+               $ol_enable_sql = no ; then
                { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
        fi
 
@@ -2265,17 +2319,23 @@ BUILD_LDAP=no
 BUILD_LDBM=no
 BUILD_PASSWD=no
 BUILD_SHELL=no
+BUILD_SQL=no
 
 BUILD_DNSSRV_DYNAMIC=static
 BUILD_LDAP_DYNAMIC=static
 BUILD_LDBM_DYNAMIC=static
 BUILD_PASSWD_DYNAMIC=static
 BUILD_SHELL_DYNAMIC=static
+BUILD_SQL_DYNAMIC=static
 
 SLAPD_MODULES_LDFLAGS=
 SLAPD_MODULES_CPPFLAGS=
 SLAPD_MODULES_LIST=
 
+SLAPD_SQL_LDFLAGS=
+SLAPD_SQL_LIBS=
+SLAPD_SQL_INCLUDES=
+
 KRB4_LIBS=
 KRB5_LIBS=
 READLINE_LIBS=
@@ -2311,7 +2371,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2315: checking for $ac_word" >&5
+echo "configure:2375: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2363,7 +2423,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2367: checking for $ac_word" >&5
+echo "configure:2427: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2423,7 +2483,7 @@ fi
 # 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:2427: checking for $ac_word" >&5
+echo "configure:2487: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2453,7 +2513,7 @@ fi
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2457: checking for $ac_word" >&5
+echo "configure:2517: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2483,7 +2543,7 @@ if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2487: checking for $ac_word" >&5
+echo "configure:2547: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2534,7 +2594,7 @@ fi
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2538: checking for $ac_word" >&5
+echo "configure:2598: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2566,7 +2626,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:2570: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5
+echo "configure:2630: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -2577,12 +2637,12 @@ cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext << EOF
 
-#line 2581 "configure"
+#line 2641 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:2586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -2608,12 +2668,12 @@ if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:2612: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:2672: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:2617: checking whether we are using GNU C" >&5
+echo "configure:2677: checking whether we are using GNU C" >&5
 if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2622,7 +2682,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2626: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2686: \"$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
@@ -2641,7 +2701,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:2645: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:2705: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"\${ac_cv_prog_cc_g+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2684,7 +2744,7 @@ ac_prog=ld
 if test "$ac_cv_prog_gcc" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:2688: checking for ld used by GCC" >&5
+echo "configure:2748: checking for ld used by GCC" >&5
   ac_prog=`($CC -print-prog-name=ld) 2>&5`
   case "$ac_prog" in
     # Accept absolute paths.
@@ -2708,10 +2768,10 @@ echo "configure:2688: checking for ld used by GCC" >&5
   esac
 elif test "$with_gnu_ld" = yes; then
   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:2712: checking for GNU ld" >&5
+echo "configure:2772: checking for GNU ld" >&5
 else
   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:2715: checking for non-GNU ld" >&5
+echo "configure:2775: checking for non-GNU ld" >&5
 fi
 if eval "test \"\${ac_cv_path_LD+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2746,7 +2806,7 @@ else
 fi
 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:2750: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:2810: checking if the linker ($LD) is GNU ld" >&5
 if eval "test \"\${ac_cv_prog_gnu_ld+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2762,7 +2822,7 @@ echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
 
 
 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:2766: checking for BSD-compatible nm" >&5
+echo "configure:2826: checking for BSD-compatible nm" >&5
 if eval "test \"\${ac_cv_path_NM+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2798,7 +2858,7 @@ NM="$ac_cv_path_NM"
 echo "$ac_t""$NM" 1>&6
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:2802: checking whether ln -s works" >&5
+echo "configure:2862: checking whether ln -s works" >&5
 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2853,8 +2913,8 @@ test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
 case "$lt_target" in
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 2857 "configure"' > conftest.$ac_ext
-  if { (eval echo configure:2858: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  echo '#line 2917 "configure"' > conftest.$ac_ext
+  if { (eval echo configure:2918: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     case "`/usr/bin/file conftest.o`" in
     *32-bit*)
       LD="${LD-ld} -32"
@@ -2875,19 +2935,19 @@ case "$lt_target" in
   SAVE_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS -belf"
   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
-echo "configure:2879: checking whether the C compiler needs -belf" >&5
+echo "configure:2939: checking whether the C compiler needs -belf" >&5
 if eval "test \"\${lt_cv_cc_needs_belf+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2884 "configure"
+#line 2944 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2891: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   lt_cv_cc_needs_belf=yes
 else
@@ -2910,7 +2970,7 @@ echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
   # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2914: checking for $ac_word" >&5
+echo "configure:2974: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2942,7 +3002,7 @@ if test -n "$ac_tool_prefix"; then
   # Extract the first word of "dlltool", so it can be a program name with args.
 set dummy dlltool; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2946: checking for $ac_word" >&5
+echo "configure:3006: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2977,7 +3037,7 @@ fi
   # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
 set dummy ${ac_tool_prefix}as; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2981: checking for $ac_word" >&5
+echo "configure:3041: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3009,7 +3069,7 @@ if test -n "$ac_tool_prefix"; then
   # Extract the first word of "as", so it can be a program name with args.
 set dummy as; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3013: checking for $ac_word" >&5
+echo "configure:3073: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3044,7 +3104,7 @@ fi
   # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
 set dummy ${ac_tool_prefix}objdump; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3048: checking for $ac_word" >&5
+echo "configure:3108: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3076,7 +3136,7 @@ if test -n "$ac_tool_prefix"; then
   # Extract the first word of "objdump", so it can be a program name with args.
 set dummy objdump; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3080: checking for $ac_word" >&5
+echo "configure:3140: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3144,7 +3204,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3148: checking for $ac_word" >&5
+echo "configure:3208: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3175,7 +3235,7 @@ done
 
 # test for ln hardlink support
 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
-echo "configure:3179: checking whether ln works" >&5
+echo "configure:3239: checking whether ln works" >&5
 if eval "test \"\${ol_cv_prog_LN_H+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3198,7 +3258,7 @@ else
 fi
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:3202: checking whether ln -s works" >&5
+echo "configure:3262: checking whether ln -s works" >&5
 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3226,7 +3286,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:3230: checking for $ac_word" >&5
+echo "configure:3290: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_path_SENDMAIL+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3262,7 +3322,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:3266: checking for $ac_word" >&5
+echo "configure:3326: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_path_EDITOR+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3298,7 +3358,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:3302: checking for $ac_word" >&5
+echo "configure:3362: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_path_FINGER+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3333,7 +3393,7 @@ fi
 
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:3337: checking how to run the C preprocessor" >&5
+echo "configure:3397: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -3348,13 +3408,13 @@ else
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 3352 "configure"
+#line 3412 "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:3358: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3418: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -3365,13 +3425,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 3369 "configure"
+#line 3429 "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:3375: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3435: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -3382,13 +3442,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 3386 "configure"
+#line 3446 "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:3392: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3452: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -3426,9 +3486,9 @@ elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
 fi
 
 echo $ac_n "checking for AIX""... $ac_c" 1>&6
-echo "configure:3430: checking for AIX" >&5
+echo "configure:3490: checking for AIX" >&5
 cat > conftest.$ac_ext <<EOF
-#line 3432 "configure"
+#line 3492 "configure"
 #include "confdefs.h"
 #ifdef _AIX
   yes
@@ -3450,7 +3510,7 @@ rm -f conftest*
 
 
 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:3454: checking for POSIXized ISC" >&5
+echo "configure:3514: 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
@@ -3472,17 +3532,17 @@ fi
 
 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
-echo "configure:3476: checking for minix/config.h" >&5
+echo "configure:3536: checking for minix/config.h" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3481 "configure"
+#line 3541 "configure"
 #include "confdefs.h"
 #include <minix/config.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3486: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3546: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3521,12 +3581,12 @@ fi
 
 
 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:3525: checking for Cygwin environment" >&5
+echo "configure:3585: checking for Cygwin environment" >&5
 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3530 "configure"
+#line 3590 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -3537,7 +3597,7 @@ int main() {
 return __CYGWIN__;
 ; return 0; }
 EOF
-if { (eval echo configure:3541: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3601: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_cygwin=yes
 else
@@ -3553,19 +3613,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6
 CYGWIN=
 test "$ac_cv_cygwin" = yes && CYGWIN=yes
 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:3557: checking for mingw32 environment" >&5
+echo "configure:3617: checking for mingw32 environment" >&5
 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3562 "configure"
+#line 3622 "configure"
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:3569: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3629: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_mingw32=yes
 else
@@ -3581,19 +3641,19 @@ echo "$ac_t""$ac_cv_mingw32" 1>&6
 MINGW32=
 test "$ac_cv_mingw32" = yes && MINGW32=yes
 echo $ac_n "checking for EMX OS/2 environment""... $ac_c" 1>&6
-echo "configure:3585: checking for EMX OS/2 environment" >&5
+echo "configure:3645: checking for EMX OS/2 environment" >&5
 if eval "test \"\${ac_cv_emxos2+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3590 "configure"
+#line 3650 "configure"
 #include "confdefs.h"
 
 int main() {
 return __EMX__;
 ; return 0; }
 EOF
-if { (eval echo configure:3597: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3657: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_emxos2=yes
 else
@@ -3612,7 +3672,7 @@ test "$ac_cv_emxos2" = yes && EMXOS2=yes
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:3616: checking for executable suffix" >&5
+echo "configure:3676: checking for executable suffix" >&5
 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3622,7 +3682,7 @@ else
   rm -f conftest*
   echo 'int main () { return 0; }' > conftest.$ac_ext
   ac_cv_exeext=
-  if { (eval echo configure:3626: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+  if { (eval echo configure:3686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
     for file in conftest.*; do
       case $file in
       *.c | *.C | *.o | *.obj | *.xcoff) ;;
@@ -3643,13 +3703,13 @@ echo "$ac_t""${ac_cv_exeext}" 1>&6
 ac_exeext=$EXEEXT
 
 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
-echo "configure:3647: checking for object suffix" >&5
+echo "configure:3707: checking for object suffix" >&5
 if eval "test \"\${ac_cv_objext+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   rm -f conftest*
 echo 'int i = 1;' > conftest.$ac_ext
-if { (eval echo configure:3653: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3713: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   for ac_file in conftest.*; do
     case $ac_file in
     *.c) ;;
@@ -3673,7 +3733,7 @@ EOF
 
 
 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
-echo "configure:3677: checking for be_app in -lbe" >&5
+echo "configure:3737: checking for be_app in -lbe" >&5
 ac_lib_var=`echo be'_'be_app | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3681,7 +3741,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lbe -lroot -lnet $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3685 "configure"
+#line 3745 "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
@@ -3692,7 +3752,7 @@ int main() {
 be_app()
 ; return 0; }
 EOF
-if { (eval echo configure:3696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3718,7 +3778,7 @@ fi
 
 
 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
-echo "configure:3722: checking for ${CC-cc} option to accept ANSI C" >&5
+echo "configure:3782: checking for ${CC-cc} option to accept ANSI C" >&5
 if eval "test \"\${am_cv_prog_cc_stdc+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3735,7 +3795,7 @@ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIO
 do
   CC="$ac_save_CC $ac_arg"
   cat > conftest.$ac_ext <<EOF
-#line 3739 "configure"
+#line 3799 "configure"
 #include "confdefs.h"
 #include <stdarg.h>
 #include <stdio.h>
@@ -3772,7 +3832,7 @@ return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
 
 ; return 0; }
 EOF
-if { (eval echo configure:3776: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3836: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_prog_cc_stdc="$ac_arg"; break
 else
@@ -3806,7 +3866,7 @@ if test -z "${MKDEP}"; then
        OL_MKDEP="${CC-cc}"
        if test -z "${MKDEP_FLAGS}"; then
                echo $ac_n "checking for ${OL_MKDEP} depend flag""... $ac_c" 1>&6
-echo "configure:3810: checking for ${OL_MKDEP} depend flag" >&5
+echo "configure:3870: checking for ${OL_MKDEP} depend flag" >&5
 if eval "test \"\${ol_cv_mkdep+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3816,7 +3876,7 @@ else
                                cat > conftest.c <<EOF
  noCode;
 EOF
-                               if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:3820: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
+                               if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:3880: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
                                        | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
                                then
                                        if test ! -f conftest."${ac_object}" ; then
@@ -3849,7 +3909,7 @@ if test "${ol_cv_mkdep}" = no ; then
 fi
 
 echo $ac_n "checking for afopen in -ls""... $ac_c" 1>&6
-echo "configure:3853: checking for afopen in -ls" >&5
+echo "configure:3913: checking for afopen in -ls" >&5
 ac_lib_var=`echo s'_'afopen | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3857,7 +3917,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ls  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3861 "configure"
+#line 3921 "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
@@ -3868,7 +3928,7 @@ int main() {
 afopen()
 ; return 0; }
 EOF
-if { (eval echo configure:3872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3899,12 +3959,12 @@ fi
 for ac_func in getaddrinfo 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3903: checking for $ac_func" >&5
+echo "configure:3963: checking for $ac_func" >&5
 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3908 "configure"
+#line 3968 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3928,7 +3988,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:3932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3992: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3965,17 +4025,17 @@ if test $ol_enable_unix != no ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3969: checking for $ac_hdr" >&5
+echo "configure:4029: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3974 "configure"
+#line 4034 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3979: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4039: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4015,17 +4075,17 @@ if test $ol_enable_modules != no ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4019: checking for $ac_hdr" >&5
+echo "configure:4079: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4024 "configure"
+#line 4084 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4029: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4089: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4057,7 +4117,7 @@ done
        fi
 
        echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
-echo "configure:4061: checking for lt_dlinit in -lltdl" >&5
+echo "configure:4121: checking for lt_dlinit in -lltdl" >&5
 ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4065,7 +4125,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lltdl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4069 "configure"
+#line 4129 "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
@@ -4076,7 +4136,7 @@ int main() {
 lt_dlinit()
 ; return 0; }
 EOF
-if { (eval echo configure:4080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4140: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4113,17 +4173,18 @@ else
        ol_with_ldbm_module=static
        ol_with_passwd_module=static
        ol_with_shell_module=static
+       ol_with_sql_module=static
 fi
 
 # test for EBCDIC
 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
-echo "configure:4121: checking for EBCDIC" >&5
+echo "configure:4182: checking for EBCDIC" >&5
 if eval "test \"\${ol_cv_cpp_ebcdic+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        cat > conftest.$ac_ext <<EOF
-#line 4127 "configure"
+#line 4188 "configure"
 #include "confdefs.h"
 
 #if !('M' == 0xd4)
@@ -4132,7 +4193,7 @@ else
 
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4136: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4197: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4156,12 +4217,12 @@ EOF
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:4160: checking for ANSI C header files" >&5
+echo "configure:4221: checking for ANSI C header files" >&5
 if eval "test \"\${ol_cv_header_stdc+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4165 "configure"
+#line 4226 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -4169,7 +4230,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4173: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4234: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4186,7 +4247,7 @@ rm -f conftest*
 if test $ol_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 4190 "configure"
+#line 4251 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -4204,7 +4265,7 @@ fi
 if test $ol_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 4208 "configure"
+#line 4269 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -4225,7 +4286,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 4229 "configure"
+#line 4290 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #ifndef HAVE_EBCDIC
@@ -4243,7 +4304,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:4247: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -4277,12 +4338,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:4281: checking for $ac_hdr that defines DIR" >&5
+echo "configure:4342: checking for $ac_hdr that defines DIR" >&5
 if eval "test \"\${ac_cv_header_dirent_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4286 "configure"
+#line 4347 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_hdr>
@@ -4290,7 +4351,7 @@ int main() {
 DIR *dirp = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:4294: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4355: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_dirent_$ac_safe=yes"
 else
@@ -4315,7 +4376,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:4319: checking for opendir in -ldir" >&5
+echo "configure:4380: checking for opendir in -ldir" >&5
 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4323,7 +4384,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldir  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4327 "configure"
+#line 4388 "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
@@ -4334,7 +4395,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:4338: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4399: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4356,7 +4417,7 @@ fi
 
 else
 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:4360: checking for opendir in -lx" >&5
+echo "configure:4421: checking for opendir in -lx" >&5
 ac_lib_var=`echo x'_'opendir | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4364,7 +4425,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lx  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4368 "configure"
+#line 4429 "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
@@ -4375,7 +4436,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:4379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4440: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4398,12 +4459,12 @@ fi
 fi
 
 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:4402: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:4463: checking for sys/wait.h that is POSIX.1 compatible" >&5
 if eval "test \"\${ac_cv_header_sys_wait_h+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4407 "configure"
+#line 4468 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -4419,7 +4480,7 @@ wait (&s);
 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
 ; return 0; }
 EOF
-if { (eval echo configure:4423: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4484: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_sys_wait_h=yes
 else
@@ -4440,12 +4501,12 @@ EOF
 fi
 
 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
-echo "configure:4444: checking POSIX termios" >&5
+echo "configure:4505: checking POSIX termios" >&5
 if eval "test \"\${am_cv_sys_posix_termios+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4449 "configure"
+#line 4510 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <unistd.h>
@@ -4455,7 +4516,7 @@ int main() {
    tcgetattr(0, 0);
 ; return 0; }
 EOF
-if { (eval echo configure:4459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4520: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   am_cv_sys_posix_termios=yes
 else
@@ -4471,7 +4532,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:4475: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
+echo "configure:4536: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
 if eval "test \"\${am_cv_sys_tiocgwinsz_needs_sys_ioctl_h+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4480,7 +4541,7 @@ else
   gwinsz_in_termios_h=no
   if test $am_cv_sys_posix_termios = yes; then
     cat > conftest.$ac_ext <<EOF
-#line 4484 "configure"
+#line 4545 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #     include <termios.h>
@@ -4500,7 +4561,7 @@ rm -f conftest*
 
   if test $gwinsz_in_termios_h = no; then
     cat > conftest.$ac_ext <<EOF
-#line 4504 "configure"
+#line 4565 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #     include <sys/ioctl.h>
@@ -4583,17 +4644,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:4587: checking for $ac_hdr" >&5
+echo "configure:4648: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4592 "configure"
+#line 4653 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4597: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4658: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4623,7 +4684,7 @@ done
 
 
 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
-echo "configure:4627: checking for sigset in -lV3" >&5
+echo "configure:4688: checking for sigset in -lV3" >&5
 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4631,7 +4692,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lV3  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4635 "configure"
+#line 4696 "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
@@ -4642,7 +4703,7 @@ int main() {
 sigset()
 ; return 0; }
 EOF
-if { (eval echo configure:4646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4707: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4672,12 +4733,12 @@ fi
 
 if test $ac_cv_header_winsock_h = yes; then
        echo $ac_n "checking for winsock""... $ac_c" 1>&6
-echo "configure:4676: checking for winsock" >&5
+echo "configure:4737: checking for winsock" >&5
 if eval "test \"\${ol_cv_winsock+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4681 "configure"
+#line 4742 "configure"
 #include "confdefs.h"
 #include <winsock.h>
 int main() {
@@ -4689,7 +4750,7 @@ int main() {
        
 ; return 0; }
 EOF
-if { (eval echo configure:4693: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4754: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_winsock=yes
 else
@@ -4717,12 +4778,12 @@ fi
 
 
 echo $ac_n "checking for socket""... $ac_c" 1>&6
-echo "configure:4721: checking for socket" >&5
+echo "configure:4782: checking for socket" >&5
 if eval "test \"\${ac_cv_func_socket+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4726 "configure"
+#line 4787 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char socket(); below.  */
@@ -4746,7 +4807,7 @@ f = socket;
 
 ; return 0; }
 EOF
-if { (eval echo configure:4750: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4811: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_socket=yes"
 else
@@ -4765,7 +4826,7 @@ else
   echo "$ac_t""no" 1>&6
        
        echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
-echo "configure:4769: checking for main in -lsocket" >&5
+echo "configure:4830: checking for main in -lsocket" >&5
 ac_lib_var=`echo socket'_'main | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4773,14 +4834,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4777 "configure"
+#line 4838 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:4784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4845: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4808,7 +4869,7 @@ else
 fi
 
        echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
-echo "configure:4812: checking for main in -lnet" >&5
+echo "configure:4873: checking for main in -lnet" >&5
 ac_lib_var=`echo net'_'main | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4816,14 +4877,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnet  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4820 "configure"
+#line 4881 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:4827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4888: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4851,7 +4912,7 @@ else
 fi
 
        echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
-echo "configure:4855: checking for main in -lnsl_s" >&5
+echo "configure:4916: checking for main in -lnsl_s" >&5
 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4859,14 +4920,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl_s  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4863 "configure"
+#line 4924 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:4870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4931: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4894,7 +4955,7 @@ else
 fi
 
        echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
-echo "configure:4898: checking for main in -lnsl" >&5
+echo "configure:4959: checking for main in -lnsl" >&5
 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4902,14 +4963,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4906 "configure"
+#line 4967 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:4913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4937,7 +4998,7 @@ else
 fi
 
        echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
-echo "configure:4941: checking for socket in -linet" >&5
+echo "configure:5002: checking for socket in -linet" >&5
 ac_lib_var=`echo inet'_'socket | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4945,7 +5006,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-linet  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4949 "configure"
+#line 5010 "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
@@ -4956,7 +5017,7 @@ int main() {
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:4960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4984,7 +5045,7 @@ else
 fi
 
        echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
-echo "configure:4988: checking for main in -lgen" >&5
+echo "configure:5049: checking for main in -lgen" >&5
 ac_lib_var=`echo gen'_'main | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4992,14 +5053,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgen  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4996 "configure"
+#line 5057 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:5003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5031,12 +5092,12 @@ fi
 
 
 echo $ac_n "checking for select""... $ac_c" 1>&6
-echo "configure:5035: checking for select" >&5
+echo "configure:5096: checking for select" >&5
 if eval "test \"\${ac_cv_func_select+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5040 "configure"
+#line 5101 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char select(); below.  */
@@ -5060,7 +5121,7 @@ f = select;
 
 ; return 0; }
 EOF
-if { (eval echo configure:5064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5125: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_select=yes"
 else
@@ -5083,7 +5144,7 @@ fi
 
 if test "${ac_cv_header_winsock_h}" != yes; then
                 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
-echo "configure:5087: checking types of arguments for select()" >&5
+echo "configure:5148: checking types of arguments for select()" >&5
  if eval "test \"\${ac_cv_func_select_arg234+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5097,7 +5158,7 @@ else
      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
        cat > conftest.$ac_ext <<EOF
-#line 5101 "configure"
+#line 5162 "configure"
 #include "confdefs.h"
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
@@ -5116,7 +5177,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5120: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5181: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
           ac_not_found=no ; break 3
 else
@@ -5161,17 +5222,17 @@ for ac_hdr in regex.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5165: checking for $ac_hdr" >&5
+echo "configure:5226: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5170 "configure"
+#line 5231 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5175: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5236: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5201,12 +5262,12 @@ if test "$ac_cv_header_regex_h" != yes ; then
        { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
 fi
 echo $ac_n "checking for regfree""... $ac_c" 1>&6
-echo "configure:5205: checking for regfree" >&5
+echo "configure:5266: checking for regfree" >&5
 if eval "test \"\${ac_cv_func_regfree+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5210 "configure"
+#line 5271 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char regfree(); below.  */
@@ -5230,7 +5291,7 @@ f = regfree;
 
 ; return 0; }
 EOF
-if { (eval echo configure:5234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5295: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_regfree=yes"
 else
@@ -5253,7 +5314,7 @@ fi
 
 
 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
-echo "configure:5257: checking for compatible POSIX regex" >&5
+echo "configure:5318: checking for compatible POSIX regex" >&5
 if eval "test \"\${ol_cv_c_posix_regex+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5262,7 +5323,7 @@ else
   ol_cv_c_posix_regex=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 5266 "configure"
+#line 5327 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -5288,7 +5349,7 @@ main()
        return rc;
 }
 EOF
-if { (eval echo configure:5292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5353: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_c_posix_regex=yes
 else
@@ -5310,12 +5371,12 @@ fi
 
 ol_link_dnssrv=no
 echo $ac_n "checking for res_query""... $ac_c" 1>&6
-echo "configure:5314: checking for res_query" >&5
+echo "configure:5375: checking for res_query" >&5
 if eval "test \"\${ac_cv_func_res_query+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5319 "configure"
+#line 5380 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char res_query(); below.  */
@@ -5339,7 +5400,7 @@ f = res_query;
 
 ; return 0; }
 EOF
-if { (eval echo configure:5343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5404: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_res_query=yes"
 else
@@ -5360,7 +5421,7 @@ fi
 
 if test $ac_cv_func_res_query = no ; then 
        echo $ac_n "checking for res_query in -lbind""... $ac_c" 1>&6
-echo "configure:5364: checking for res_query in -lbind" >&5
+echo "configure:5425: checking for res_query in -lbind" >&5
 ac_lib_var=`echo bind'_'res_query | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5368,7 +5429,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lbind  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5372 "configure"
+#line 5433 "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
@@ -5379,7 +5440,7 @@ int main() {
 res_query()
 ; return 0; }
 EOF
-if { (eval echo configure:5383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5411,7 +5472,7 @@ fi
 
 if test $ac_cv_func_res_query = no ; then 
        echo $ac_n "checking for __res_query in -lbind""... $ac_c" 1>&6
-echo "configure:5415: checking for __res_query in -lbind" >&5
+echo "configure:5476: checking for __res_query in -lbind" >&5
 ac_lib_var=`echo bind'_'__res_query | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5419,7 +5480,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lbind  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5423 "configure"
+#line 5484 "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
@@ -5430,7 +5491,7 @@ int main() {
 __res_query()
 ; return 0; }
 EOF
-if { (eval echo configure:5434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5495: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5462,7 +5523,7 @@ fi
 
 if test $ac_cv_func_res_query = no ; then 
        echo $ac_n "checking for res_query in -lresolv""... $ac_c" 1>&6
-echo "configure:5466: checking for res_query in -lresolv" >&5
+echo "configure:5527: checking for res_query in -lresolv" >&5
 ac_lib_var=`echo resolv'_'res_query | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5470,7 +5531,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lresolv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5474 "configure"
+#line 5535 "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
@@ -5481,7 +5542,7 @@ int main() {
 res_query()
 ; return 0; }
 EOF
-if { (eval echo configure:5485: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5538,17 +5599,17 @@ if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 \
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5542: checking for $ac_hdr" >&5
+echo "configure:5603: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5547 "configure"
+#line 5608 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5552: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5613: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5580,17 +5641,17 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5584: checking for $ac_hdr" >&5
+echo "configure:5645: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5589 "configure"
+#line 5650 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5594: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5655: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5624,7 +5685,7 @@ done
 
                if test $krb5_impl = mit; then
                        echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
-echo "configure:5628: checking for main in -lkrb5" >&5
+echo "configure:5689: checking for main in -lkrb5" >&5
 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5632,14 +5693,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lkrb5 -lcrypto -lcom_err $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5636 "configure"
+#line 5697 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:5643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5664,7 +5725,7 @@ fi
 
                elif test $krb5_impl = heimdal; then
                        echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
-echo "configure:5668: checking for main in -lkrb5" >&5
+echo "configure:5729: checking for main in -lkrb5" >&5
 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5672,14 +5733,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5676 "configure"
+#line 5737 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:5683: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5741,17 +5802,17 @@ if test $ol_link_krb5 = yes -a \
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5745: checking for $ac_hdr" >&5
+echo "configure:5806: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5750 "configure"
+#line 5811 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5755: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5816: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5781,7 +5842,7 @@ done
        if test $ac_cv_header_kerberosIV_krb_h = yes ; then
                if test $krb5_impl = mit; then
                        echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
-echo "configure:5785: checking for main in -lkrb4" >&5
+echo "configure:5846: checking for main in -lkrb4" >&5
 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5789,14 +5850,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lkrb4 -ldes425 -lkrb5 -lcrypto -lcom_err $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5793 "configure"
+#line 5854 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:5800: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5821,7 +5882,7 @@ fi
 
                elif test $krb5_impl = heimdal; then
                        echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
-echo "configure:5825: checking for main in -lkrb4" >&5
+echo "configure:5886: checking for main in -lkrb4" >&5
 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5829,14 +5890,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lkrb4 -lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5833 "configure"
+#line 5894 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:5840: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5878,7 +5939,7 @@ EOF
 
 
                        echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
-echo "configure:5882: checking for des_debug in Kerberos libraries" >&5
+echo "configure:5943: checking for des_debug in Kerberos libraries" >&5
 if eval "test \"\${ol_cv_var_des_debug+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5886,7 +5947,7 @@ else
                                                                save_LIBS="$LIBS"
                                LIBS="$KRB4_LIBS $KRB5_LIBS $LIBS"
                                cat > conftest.$ac_ext <<EOF
-#line 5890 "configure"
+#line 5951 "configure"
 #include "confdefs.h"
 
 #include <kerberosIV/krb.h>
@@ -5899,7 +5960,7 @@ des_debug = 1;
 
 ; return 0; }
 EOF
-if { (eval echo configure:5903: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5964: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_var_des_debug=yes
 else
@@ -5938,17 +5999,17 @@ if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 \
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5942: checking for $ac_hdr" >&5
+echo "configure:6003: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5947 "configure"
+#line 6008 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5952: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6013: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5977,7 +6038,7 @@ done
 
        if test $ac_cv_header_krb_h = yes ; then
                echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
-echo "configure:5981: checking for main in -lkrb" >&5
+echo "configure:6042: checking for main in -lkrb" >&5
 ac_lib_var=`echo krb'_'main | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5985,14 +6046,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lkrb -ldes $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5989 "configure"
+#line 6050 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:5996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6056,17 +6117,17 @@ if test $ol_with_tls != no ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6060: checking for $ac_hdr" >&5
+echo "configure:6121: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6065 "configure"
+#line 6126 "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:6131: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6095,7 +6156,7 @@ done
        
        if test $ac_cv_header_openssl_ssl_h = yes -o $ac_cv_header_ssl_h = yes ; then
                echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
-echo "configure:6099: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
+echo "configure:6160: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6103,7 +6164,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lssl -lcrypto $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6107 "configure"
+#line 6168 "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
@@ -6114,7 +6175,7 @@ int main() {
 SSLeay_add_ssl_algorithms()
 ; return 0; }
 EOF
-if { (eval echo configure:6118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6139,7 +6200,7 @@ fi
                        
                if test $have_ssleay = no ; then
                        echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
-echo "configure:6143: checking for SSL_library_init in -lssl" >&5
+echo "configure:6204: checking for SSL_library_init in -lssl" >&5
 ac_lib_var=`echo ssl'_'SSL_library_init | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6147,7 +6208,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lssl -lcrypto $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6151 "configure"
+#line 6212 "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
@@ -6158,7 +6219,7 @@ int main() {
 SSL_library_init()
 ; return 0; }
 EOF
-if { (eval echo configure:6162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6184,7 +6245,7 @@ fi
 
                if test $have_ssleay = no ; then
                        echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
-echo "configure:6188: checking for ssl3_accept in -lssl" >&5
+echo "configure:6249: checking for ssl3_accept in -lssl" >&5
 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6192,7 +6253,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6196 "configure"
+#line 6257 "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
@@ -6203,7 +6264,7 @@ int main() {
 ssl3_accept()
 ; return 0; }
 EOF
-if { (eval echo configure:6207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6268: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6263,12 +6324,12 @@ for ac_func in \
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6267: checking for $ac_func" >&5
+echo "configure:6328: checking for $ac_func" >&5
 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6272 "configure"
+#line 6333 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6292,7 +6353,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:6296: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -6321,19 +6382,19 @@ if test "$ac_cv_func_ctime_r" = no ; then
        ol_cv_func_ctime_r_nargs=0
 else
        echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
-echo "configure:6325: checking number of arguments of ctime_r" >&5
+echo "configure:6386: checking number of arguments of ctime_r" >&5
 if eval "test \"\${ol_cv_func_ctime_r_nargs+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6330 "configure"
+#line 6391 "configure"
 #include "confdefs.h"
 #include <time.h>
 int main() {
 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
 ; return 0; }
 EOF
-if { (eval echo configure:6337: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6398: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_func_ctime_r_nargs3=yes
 else
@@ -6345,14 +6406,14 @@ fi
 rm -f conftest*
 
        cat > conftest.$ac_ext <<EOF
-#line 6349 "configure"
+#line 6410 "configure"
 #include "confdefs.h"
 #include <time.h>
 int main() {
 time_t ti; char *buffer; ctime_r(&ti,buffer);
 ; return 0; }
 EOF
-if { (eval echo configure:6356: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6417: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_func_ctime_r_nargs2=yes
 else
@@ -6392,12 +6453,12 @@ fi
 
 if test "$ac_cv_func_gethostbyname_r" = yes ; then
        echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
-echo "configure:6396: checking number of arguments of gethostbyname_r" >&5
+echo "configure:6457: checking number of arguments of gethostbyname_r" >&5
 if eval "test \"\${ol_cv_func_gethostbyname_r_nargs+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6401 "configure"
+#line 6462 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -6411,7 +6472,7 @@ struct hostent hent; char buffer[BUFSIZE];
                        buffer, bufsize, &h_errno);
 ; return 0; }
 EOF
-if { (eval echo configure:6415: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6476: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_func_gethostbyname_r_nargs5=yes
 else
@@ -6423,7 +6484,7 @@ fi
 rm -f conftest*
 
        cat > conftest.$ac_ext <<EOF
-#line 6427 "configure"
+#line 6488 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -6438,7 +6499,7 @@ struct hostent hent;struct hostent *rhent;
                        &rhent, &h_errno);
 ; return 0; }
 EOF
-if { (eval echo configure:6442: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6503: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_func_gethostbyname_r_nargs6=yes
 else
@@ -6479,12 +6540,12 @@ fi
  
 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
        echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
-echo "configure:6483: checking number of arguments of gethostbyaddr_r" >&5
+echo "configure:6544: checking number of arguments of gethostbyaddr_r" >&5
 if eval "test \"\${ol_cv_func_gethostbyaddr_r_nargs+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6488 "configure"
+#line 6549 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -6500,7 +6561,7 @@ struct hostent hent; char buffer[BUFSIZE];
                        alen, AF_INET, &hent, buffer, bufsize, &h_errno);
 ; return 0; }
 EOF
-if { (eval echo configure:6504: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6565: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_func_gethostbyaddr_r_nargs7=yes
 else
@@ -6512,7 +6573,7 @@ fi
 rm -f conftest*
 
        cat > conftest.$ac_ext <<EOF
-#line 6516 "configure"
+#line 6577 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -6530,7 +6591,7 @@ struct hostent hent;
                        &rhent, &h_errno);
 ; return 0; }
 EOF
-if { (eval echo configure:6534: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6595: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_func_gethostbyaddr_r_nargs8=yes
 else
@@ -6593,18 +6654,18 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
 
        
        echo $ac_n "checking for NT Threads""... $ac_c" 1>&6
-echo "configure:6597: checking for NT Threads" >&5
+echo "configure:6658: checking for NT Threads" >&5
 if eval "test \"\${ol_cv_nt_threads+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
                echo $ac_n "checking for _beginthread""... $ac_c" 1>&6
-echo "configure:6603: checking for _beginthread" >&5
+echo "configure:6664: checking for _beginthread" >&5
 if eval "test \"\${ac_cv_func__beginthread+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6608 "configure"
+#line 6669 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _beginthread(); below.  */
@@ -6628,7 +6689,7 @@ f = _beginthread;
 
 ; return 0; }
 EOF
-if { (eval echo configure:6632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6693: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func__beginthread=yes"
 else
@@ -6688,17 +6749,17 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6692: checking for $ac_hdr" >&5
+echo "configure:6753: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6697 "configure"
+#line 6758 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6702: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6763: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6727,13 +6788,13 @@ done
 
        if test $ac_cv_header_pthread_h = yes ; then
                echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
-echo "configure:6731: checking POSIX thread version" >&5
+echo "configure:6792: checking POSIX thread version" >&5
 if eval "test \"\${ol_cv_pthread_version+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        cat > conftest.$ac_ext <<EOF
-#line 6737 "configure"
+#line 6798 "configure"
 #include "confdefs.h"
 
 #              include <pthread.h>
@@ -6755,7 +6816,7 @@ rm -f conftest*
 
 
        cat > conftest.$ac_ext <<EOF
-#line 6759 "configure"
+#line 6820 "configure"
 #include "confdefs.h"
 
 #              include <pthread.h>
@@ -6808,12 +6869,12 @@ EOF
 
                
        echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
-echo "configure:6812: checking for LinuxThreads pthread.h" >&5
+echo "configure:6873: checking for LinuxThreads pthread.h" >&5
 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6817 "configure"
+#line 6878 "configure"
 #include "confdefs.h"
 #include <pthread.h>
 EOF
@@ -6840,12 +6901,12 @@ EOF
 
                
        echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
-echo "configure:6844: checking for GNU Pth pthread.h" >&5
+echo "configure:6905: checking for GNU Pth pthread.h" >&5
 if eval "test \"\${ol_cv_header_gnu_pth_pthread_h+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6849 "configure"
+#line 6910 "configure"
 #include "confdefs.h"
 #include <pthread.h>
 #ifdef _POSIX_THREAD_IS_GNU_PTH
@@ -6874,17 +6935,17 @@ echo "$ac_t""$ol_cv_header_gnu_pth_pthread_h" 1>&6
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6878: checking for $ac_hdr" >&5
+echo "configure:6939: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6883 "configure"
+#line 6944 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6888: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6949: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6914,14 +6975,14 @@ done
 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
                                echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
-echo "configure:6918: checking for pthread_create in default libraries" >&5
+echo "configure:6979: checking for pthread_create in default libraries" >&5
 if eval "test \"\${ol_cv_pthread_create+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 6925 "configure"
+#line 6986 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -6977,7 +7038,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:6981: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7042: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_create=yes
 else
@@ -6989,7 +7050,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 6993 "configure"
+#line 7054 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7050,7 +7111,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:7054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_create=yes
 else
@@ -7075,7 +7136,7 @@ echo "$ac_t""$ol_cv_pthread_create" 1>&6
 if test "$ol_link_threads" = no ; then
        # try -kthread
        echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
-echo "configure:7079: checking for pthread link with -kthread" >&5
+echo "configure:7140: checking for pthread link with -kthread" >&5
 if eval "test \"\${ol_cv_pthread_kthread+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7086,7 +7147,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 7090 "configure"
+#line 7151 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7142,7 +7203,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:7146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_kthread=yes
 else
@@ -7154,7 +7215,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 7158 "configure"
+#line 7219 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7215,7 +7276,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:7219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7280: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_kthread=yes
 else
@@ -7245,7 +7306,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -pthread
        echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
-echo "configure:7249: checking for pthread link with -pthread" >&5
+echo "configure:7310: checking for pthread link with -pthread" >&5
 if eval "test \"\${ol_cv_pthread_pthread+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7256,7 +7317,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 7260 "configure"
+#line 7321 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7312,7 +7373,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:7316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_pthread=yes
 else
@@ -7324,7 +7385,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 7328 "configure"
+#line 7389 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7385,7 +7446,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:7389: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7450: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_pthread=yes
 else
@@ -7415,7 +7476,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -pthreads
        echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
-echo "configure:7419: checking for pthread link with -pthreads" >&5
+echo "configure:7480: checking for pthread link with -pthreads" >&5
 if eval "test \"\${ol_cv_pthread_pthreads+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7426,7 +7487,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 7430 "configure"
+#line 7491 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7482,7 +7543,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:7486: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_pthreads=yes
 else
@@ -7494,7 +7555,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 7498 "configure"
+#line 7559 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7555,7 +7616,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:7559: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7620: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_pthreads=yes
 else
@@ -7585,7 +7646,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -mthreads
        echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
-echo "configure:7589: checking for pthread link with -mthreads" >&5
+echo "configure:7650: checking for pthread link with -mthreads" >&5
 if eval "test \"\${ol_cv_pthread_mthreads+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7596,7 +7657,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 7600 "configure"
+#line 7661 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7652,7 +7713,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:7656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_mthreads=yes
 else
@@ -7664,7 +7725,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 7668 "configure"
+#line 7729 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7725,7 +7786,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:7729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_mthreads=yes
 else
@@ -7755,7 +7816,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -thread
        echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
-echo "configure:7759: checking for pthread link with -thread" >&5
+echo "configure:7820: checking for pthread link with -thread" >&5
 if eval "test \"\${ol_cv_pthread_thread+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7766,7 +7827,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 7770 "configure"
+#line 7831 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7822,7 +7883,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:7826: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_thread=yes
 else
@@ -7834,7 +7895,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 7838 "configure"
+#line 7899 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7895,7 +7956,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:7899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_thread=yes
 else
@@ -7926,7 +7987,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -lpthread -lmach -lexc -lc_r
        echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
-echo "configure:7930: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
+echo "configure:7991: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc_lc_r+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7937,7 +7998,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 7941 "configure"
+#line 8002 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7993,7 +8054,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:7997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
 else
@@ -8005,7 +8066,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 8009 "configure"
+#line 8070 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8066,7 +8127,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:8070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
 else
@@ -8096,7 +8157,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -lpthread -lmach -lexc
        echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
-echo "configure:8100: checking for pthread link with -lpthread -lmach -lexc" >&5
+echo "configure:8161: checking for pthread link with -lpthread -lmach -lexc" >&5
 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8107,7 +8168,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 8111 "configure"
+#line 8172 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8163,7 +8224,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:8167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_lpthread_lmach_lexc=yes
 else
@@ -8175,7 +8236,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 8179 "configure"
+#line 8240 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8236,7 +8297,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:8240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8301: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_lpthread_lmach_lexc=yes
 else
@@ -8267,7 +8328,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -lpthread -Wl,-woff,85
        echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
-echo "configure:8271: checking for pthread link with -lpthread -Wl,-woff,85" >&5
+echo "configure:8332: checking for pthread link with -lpthread -Wl,-woff,85" >&5
 if eval "test \"\${ol_cv_pthread_lib_lpthread_woff+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8278,7 +8339,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 8282 "configure"
+#line 8343 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8334,7 +8395,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:8338: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8399: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_lib_lpthread_woff=yes
 else
@@ -8346,7 +8407,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 8350 "configure"
+#line 8411 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8407,7 +8468,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:8411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8472: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_lib_lpthread_woff=yes
 else
@@ -8438,7 +8499,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -lpthread
        echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
-echo "configure:8442: checking for pthread link with -lpthread" >&5
+echo "configure:8503: checking for pthread link with -lpthread" >&5
 if eval "test \"\${ol_cv_pthread_lpthread+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8449,7 +8510,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 8453 "configure"
+#line 8514 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8505,7 +8566,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:8509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8570: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_lpthread=yes
 else
@@ -8517,7 +8578,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 8521 "configure"
+#line 8582 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8578,7 +8639,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:8582: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_lpthread=yes
 else
@@ -8608,7 +8669,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -lc_r
        echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
-echo "configure:8612: checking for pthread link with -lc_r" >&5
+echo "configure:8673: checking for pthread link with -lc_r" >&5
 if eval "test \"\${ol_cv_pthread_lc_r+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8619,7 +8680,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 8623 "configure"
+#line 8684 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8675,7 +8736,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:8679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8740: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_lc_r=yes
 else
@@ -8687,7 +8748,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 8691 "configure"
+#line 8752 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8748,7 +8809,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:8752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8813: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_lc_r=yes
 else
@@ -8779,7 +8840,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -threads
        echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
-echo "configure:8783: checking for pthread link with -threads" >&5
+echo "configure:8844: checking for pthread link with -threads" >&5
 if eval "test \"\${ol_cv_pthread_threads+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8790,7 +8851,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 8794 "configure"
+#line 8855 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8846,7 +8907,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:8850: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_threads=yes
 else
@@ -8858,7 +8919,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 8862 "configure"
+#line 8923 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8919,7 +8980,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:8923: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8984: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_threads=yes
 else
@@ -8950,7 +9011,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -lpthreads -lmach -lexc -lc_r
        echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
-echo "configure:8954: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
+echo "configure:9015: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8961,7 +9022,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 8965 "configure"
+#line 9026 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -9017,7 +9078,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:9021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
 else
@@ -9029,7 +9090,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 9033 "configure"
+#line 9094 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -9090,7 +9151,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:9094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
 else
@@ -9120,7 +9181,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -lpthreads -lmach -lexc
        echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
-echo "configure:9124: checking for pthread link with -lpthreads -lmach -lexc" >&5
+echo "configure:9185: checking for pthread link with -lpthreads -lmach -lexc" >&5
 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -9131,7 +9192,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 9135 "configure"
+#line 9196 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -9187,7 +9248,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:9191: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9252: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_lpthreads_lmach_lexc=yes
 else
@@ -9199,7 +9260,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 9203 "configure"
+#line 9264 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -9260,7 +9321,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:9264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_lpthreads_lmach_lexc=yes
 else
@@ -9290,7 +9351,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -lpthreads -lexc
        echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
-echo "configure:9294: checking for pthread link with -lpthreads -lexc" >&5
+echo "configure:9355: checking for pthread link with -lpthreads -lexc" >&5
 if eval "test \"\${ol_cv_pthread_lpthreads_lexc+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -9301,7 +9362,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 9305 "configure"
+#line 9366 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -9357,7 +9418,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:9361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_lpthreads_lexc=yes
 else
@@ -9369,7 +9430,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 9373 "configure"
+#line 9434 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -9430,7 +9491,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:9434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9495: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_lpthreads_lexc=yes
 else
@@ -9461,7 +9522,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -lpthreads
        echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
-echo "configure:9465: checking for pthread link with -lpthreads" >&5
+echo "configure:9526: checking for pthread link with -lpthreads" >&5
 if eval "test \"\${ol_cv_pthread_lib_lpthreads+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -9472,7 +9533,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 9476 "configure"
+#line 9537 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -9528,7 +9589,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:9532: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_lib_lpthreads=yes
 else
@@ -9540,7 +9601,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 9544 "configure"
+#line 9605 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -9601,7 +9662,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:9605: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9666: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_lib_lpthreads=yes
 else
@@ -9643,12 +9704,12 @@ EOF
                                                                                                for ac_func in sched_yield pthread_yield
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9647: checking for $ac_func" >&5
+echo "configure:9708: checking for $ac_func" >&5
 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9652 "configure"
+#line 9713 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -9672,7 +9733,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:9676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9737: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -9700,7 +9761,7 @@ done
                        if test $ac_cv_func_sched_yield = no -a \
                                $ac_cv_func_pthread_yield = no ; then
                                                                echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
-echo "configure:9704: checking for sched_yield in -lrt" >&5
+echo "configure:9765: checking for sched_yield in -lrt" >&5
 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -9708,7 +9769,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lrt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9712 "configure"
+#line 9773 "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
@@ -9719,7 +9780,7 @@ int main() {
 sched_yield()
 ; return 0; }
 EOF
-if { (eval echo configure:9723: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9751,12 +9812,12 @@ fi
                                                                                                for ac_func in thr_yield
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9755: checking for $ac_func" >&5
+echo "configure:9816: checking for $ac_func" >&5
 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9760 "configure"
+#line 9821 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -9780,7 +9841,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:9784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9845: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -9814,12 +9875,12 @@ done
                                                for ac_func in pthread_kill pthread_rwlock_destroy
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9818: checking for $ac_func" >&5
+echo "configure:9879: checking for $ac_func" >&5
 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9823 "configure"
+#line 9884 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -9843,7 +9904,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:9847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -9869,13 +9930,13 @@ done
 
 
                                                                        echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
-echo "configure:9873: checking for pthread_detach with <pthread.h>" >&5
+echo "configure:9934: checking for pthread_detach with <pthread.h>" >&5
 if eval "test \"\${ol_cv_func_pthread_detach+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
                                                                cat > conftest.$ac_ext <<EOF
-#line 9879 "configure"
+#line 9940 "configure"
 #include "confdefs.h"
 
 #include <pthread.h>
@@ -9887,7 +9948,7 @@ int main() {
 pthread_detach(NULL);
 ; return 0; }
 EOF
-if { (eval echo configure:9891: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9952: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_func_pthread_detach=yes
 else
@@ -9919,12 +9980,12 @@ EOF
                        
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9923: checking for $ac_func" >&5
+echo "configure:9984: checking for $ac_func" >&5
 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9928 "configure"
+#line 9989 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -9948,7 +10009,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:9952: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -9977,12 +10038,12 @@ done
        for ac_func in pthread_kill_other_threads_np
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9981: checking for $ac_func" >&5
+echo "configure:10042: checking for $ac_func" >&5
 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9986 "configure"
+#line 10047 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -10006,7 +10067,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:10010: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -10031,7 +10092,7 @@ fi
 done
 
        echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
-echo "configure:10035: checking for LinuxThreads implementation" >&5
+echo "configure:10096: checking for LinuxThreads implementation" >&5
 if eval "test \"\${ol_cv_sys_linux_threads+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -10044,7 +10105,7 @@ echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
        
        
        echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
-echo "configure:10048: checking for LinuxThreads consistency" >&5
+echo "configure:10109: checking for LinuxThreads consistency" >&5
 if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -10069,7 +10130,7 @@ echo "$ac_t""$ol_cv_linux_threads" 1>&6
                        fi
 
                        echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
-echo "configure:10073: checking if pthread_create() works" >&5
+echo "configure:10134: checking if pthread_create() works" >&5
 if eval "test \"\${ol_cv_pthread_create_works+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -10078,7 +10139,7 @@ else
                                ol_cv_pthread_create_works=yes
 else
   cat > conftest.$ac_ext <<EOF
-#line 10082 "configure"
+#line 10143 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -10139,7 +10200,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:10143: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:10204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_create_works=yes
 else
@@ -10161,7 +10222,7 @@ echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
 
                                                if test $ol_with_yielding_select = auto ; then
                                echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
-echo "configure:10165: checking if select yields when using pthreads" >&5
+echo "configure:10226: checking if select yields when using pthreads" >&5
 if eval "test \"\${ol_cv_pthread_select_yields+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -10170,7 +10231,7 @@ else
   ol_cv_pthread_select_yields=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 10174 "configure"
+#line 10235 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -10246,7 +10307,7 @@ int main(argc, argv)
        exit(2);
 }
 EOF
-if { (eval echo configure:10250: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:10311: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_select_yields=no
 else
@@ -10290,17 +10351,17 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:10294: checking for $ac_hdr" >&5
+echo "configure:10355: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10299 "configure"
+#line 10360 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10304: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10365: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -10330,12 +10391,12 @@ done
                ol_with_threads=found
 
                                echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
-echo "configure:10334: checking for cthread_fork" >&5
+echo "configure:10395: checking for cthread_fork" >&5
 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10339 "configure"
+#line 10400 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char cthread_fork(); below.  */
@@ -10359,7 +10420,7 @@ f = cthread_fork;
 
 ; return 0; }
 EOF
-if { (eval echo configure:10363: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10424: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_cthread_fork=yes"
 else
@@ -10381,7 +10442,7 @@ fi
 
                if test $ol_link_threads = no ; then
                                                                        echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
-echo "configure:10385: checking for cthread_fork with -all_load" >&5
+echo "configure:10446: checking for cthread_fork with -all_load" >&5
 if eval "test \"\${ol_cv_cthread_all_load+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -10389,7 +10450,7 @@ else
                                                                save_LIBS="$LIBS"
                                LIBS="-all_load $LIBS"
                                cat > conftest.$ac_ext <<EOF
-#line 10393 "configure"
+#line 10454 "configure"
 #include "confdefs.h"
 #include <mach/cthreads.h>
 int main() {
@@ -10398,7 +10459,7 @@ int main() {
                                        
 ; return 0; }
 EOF
-if { (eval echo configure:10402: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_cthread_all_load=yes
 else
@@ -10443,17 +10504,17 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:10447: checking for $ac_hdr" >&5
+echo "configure:10508: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10452 "configure"
+#line 10513 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10457: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10518: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -10482,7 +10543,7 @@ done
 
        if test $ac_cv_header_pth_h = yes ; then
                echo $ac_n "checking for pth_version in -lpth""... $ac_c" 1>&6
-echo "configure:10486: checking for pth_version in -lpth" >&5
+echo "configure:10547: checking for pth_version in -lpth" >&5
 ac_lib_var=`echo pth'_'pth_version | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -10490,7 +10551,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpth  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 10494 "configure"
+#line 10555 "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
@@ -10501,7 +10562,7 @@ int main() {
 pth_version()
 ; return 0; }
 EOF
-if { (eval echo configure:10505: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10566: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -10545,17 +10606,17 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:10549: checking for $ac_hdr" >&5
+echo "configure:10610: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10554 "configure"
+#line 10615 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10559: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10620: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -10583,7 +10644,7 @@ done
 
        if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
                echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
-echo "configure:10587: checking for thr_create in -lthread" >&5
+echo "configure:10648: checking for thr_create in -lthread" >&5
 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -10591,7 +10652,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lthread  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 10595 "configure"
+#line 10656 "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
@@ -10602,7 +10663,7 @@ int main() {
 thr_create()
 ; return 0; }
 EOF
-if { (eval echo configure:10606: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -10642,12 +10703,12 @@ EOF
                        
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:10646: checking for $ac_func" >&5
+echo "configure:10707: checking for $ac_func" >&5
 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10651 "configure"
+#line 10712 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -10671,7 +10732,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:10675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -10702,17 +10763,17 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:10706: checking for $ac_hdr" >&5
+echo "configure:10767: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10711 "configure"
+#line 10772 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10716: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10777: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -10740,7 +10801,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:10744: checking for lwp_create in -llwp" >&5
+echo "configure:10805: checking for lwp_create in -llwp" >&5
 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -10748,7 +10809,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-llwp  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 10752 "configure"
+#line 10813 "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
@@ -10759,7 +10820,7 @@ int main() {
 lwp_create()
 ; return 0; }
 EOF
-if { (eval echo configure:10763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10824: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -10812,17 +10873,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:10816: checking for $ac_hdr" >&5
+echo "configure:10877: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10821 "configure"
+#line 10882 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10826: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10887: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -10851,12 +10912,12 @@ done
        for ac_func in sched_yield pthread_yield
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:10855: checking for $ac_func" >&5
+echo "configure:10916: checking for $ac_func" >&5
 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10860 "configure"
+#line 10921 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -10880,7 +10941,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:10884: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -10906,12 +10967,12 @@ done
 
        
        echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
-echo "configure:10910: checking for LinuxThreads pthread.h" >&5
+echo "configure:10971: checking for LinuxThreads pthread.h" >&5
 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10915 "configure"
+#line 10976 "configure"
 #include "confdefs.h"
 #include <pthread.h>
 EOF
@@ -10941,17 +11002,17 @@ EOF
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:10945: checking for $ac_hdr" >&5
+echo "configure:11006: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10950 "configure"
+#line 11011 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10955: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11016: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -10981,17 +11042,17 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:10985: checking for $ac_hdr" >&5
+echo "configure:11046: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10990 "configure"
+#line 11051 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10995: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11056: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -11021,17 +11082,17 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:11025: checking for $ac_hdr" >&5
+echo "configure:11086: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 11030 "configure"
+#line 11091 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11035: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11096: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -11090,20 +11151,20 @@ EOF
 
 
                        echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
-echo "configure:11094: checking for thread specific errno" >&5
+echo "configure:11155: checking for thread specific errno" >&5
 if eval "test \"\${ol_cv_errno_thread_specific+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
                cat > conftest.$ac_ext <<EOF
-#line 11100 "configure"
+#line 11161 "configure"
 #include "confdefs.h"
 #include <errno.h>
 int main() {
 errno = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:11107: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_errno_thread_specific=yes
 else
 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
 
                        echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
-echo "configure:11123: checking for thread specific h_errno" >&5
+echo "configure:11184: checking for thread specific h_errno" >&5
 if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
                cat > conftest.$ac_ext <<EOF
-#line 11129 "configure"
+#line 11190 "configure"
 #include "confdefs.h"
 #include <netdb.h>
 int main() {
 h_errno = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:11136: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_h_errno_thread_specific=yes
 else
@@ -11191,17 +11252,17 @@ for ac_hdr in db_185.h db.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:11195: checking for $ac_hdr" >&5
+echo "configure:11256: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 11200 "configure"
+#line 11261 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11205: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11266: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -11229,13 +11290,13 @@ done
 
 if test $ac_cv_header_db_185_h = yes -o $ac_cv_header_db_h = yes; then
        echo $ac_n "checking if Berkeley DB header compatibility""... $ac_c" 1>&6
-echo "configure:11233: checking if Berkeley DB header compatibility" >&5
+echo "configure:11294: checking if Berkeley DB header compatibility" >&5
 if eval "test \"\${ol_cv_header_db1+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
                cat > conftest.$ac_ext <<EOF
-#line 11239 "configure"
+#line 11300 "configure"
 #include "confdefs.h"
 
 #if HAVE_DB_185_H
@@ -11272,7 +11333,7 @@ echo "$ac_t""$ol_cv_header_db1" 1>&6
                ol_cv_lib_db=no
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
-echo "configure:11276: checking for Berkeley DB link (default)" >&5
+echo "configure:11337: checking for Berkeley DB link (default)" >&5
 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -11282,7 +11343,7 @@ else
        LIBS="$ol_DB_LIB $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 11286 "configure"
+#line 11347 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -11311,7 +11372,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_none=yes
 else
@@ -11335,7 +11396,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
-echo "configure:11339: checking for Berkeley DB link (-ldb)" >&5
+echo "configure:11400: checking for Berkeley DB link (-ldb)" >&5
 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -11345,7 +11406,7 @@ else
        LIBS="$ol_DB_LIB $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 11349 "configure"
+#line 11410 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -11374,7 +11435,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db=yes
 else
@@ -11398,7 +11459,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
-echo "configure:11402: checking for Berkeley DB link (-ldb3)" >&5
+echo "configure:11463: checking for Berkeley DB link (-ldb3)" >&5
 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -11408,7 +11469,7 @@ else
        LIBS="$ol_DB_LIB $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 11412 "configure"
+#line 11473 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -11437,7 +11498,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11441: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db3=yes
 else
@@ -11461,7 +11522,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
-echo "configure:11465: checking for Berkeley DB link (-ldb2)" >&5
+echo "configure:11526: checking for Berkeley DB link (-ldb2)" >&5
 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -11471,7 +11532,7 @@ else
        LIBS="$ol_DB_LIB $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 11475 "configure"
+#line 11536 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -11500,7 +11561,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11504: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11565: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db2=yes
 else
@@ -11524,7 +11585,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
-echo "configure:11528: checking for Berkeley DB link (-ldb1)" >&5
+echo "configure:11589: checking for Berkeley DB link (-ldb1)" >&5
 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -11534,7 +11595,7 @@ else
        LIBS="$ol_DB_LIB $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 11538 "configure"
+#line 11599 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -11563,7 +11624,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11567: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db1=yes
 else
@@ -11598,17 +11659,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:11602: checking for $ac_hdr" >&5
+echo "configure:11663: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 11607 "configure"
+#line 11668 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11612: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11673: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -11638,7 +11699,7 @@ if test $ac_cv_header_db_h = yes; then
        ol_cv_lib_db=no
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
-echo "configure:11642: checking for Berkeley DB link (default)" >&5
+echo "configure:11703: checking for Berkeley DB link (default)" >&5
 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -11648,7 +11709,7 @@ else
        LIBS="$ol_DB_LIB $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 11652 "configure"
+#line 11713 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -11677,7 +11738,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_none=yes
 else
@@ -11701,7 +11762,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
-echo "configure:11705: checking for Berkeley DB link (-ldb)" >&5
+echo "configure:11766: checking for Berkeley DB link (-ldb)" >&5
 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -11711,7 +11772,7 @@ else
        LIBS="$ol_DB_LIB $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 11715 "configure"
+#line 11776 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -11740,7 +11801,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11805: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db=yes
 else
@@ -11764,7 +11825,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
-echo "configure:11768: checking for Berkeley DB link (-ldb3)" >&5
+echo "configure:11829: checking for Berkeley DB link (-ldb3)" >&5
 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -11774,7 +11835,7 @@ else
        LIBS="$ol_DB_LIB $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 11778 "configure"
+#line 11839 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -11803,7 +11864,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11807: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11868: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db3=yes
 else
@@ -11827,7 +11888,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
-echo "configure:11831: checking for Berkeley DB link (-ldb2)" >&5
+echo "configure:11892: checking for Berkeley DB link (-ldb2)" >&5
 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -11837,7 +11898,7 @@ else
        LIBS="$ol_DB_LIB $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 11841 "configure"
+#line 11902 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -11866,7 +11927,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11931: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db2=yes
 else
@@ -11890,7 +11951,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
-echo "configure:11894: checking for Berkeley DB link (-ldb1)" >&5
+echo "configure:11955: checking for Berkeley DB link (-ldb1)" >&5
 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -11900,7 +11961,7 @@ else
        LIBS="$ol_DB_LIB $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 11904 "configure"
+#line 11965 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -11929,7 +11990,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11994: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db1=yes
 else
@@ -11955,7 +12016,7 @@ fi
        if test "$ol_cv_lib_db" != no ; then
                ol_cv_berkeley_db=yes
                echo $ac_n "checking for Berkeley DB thread support""... $ac_c" 1>&6
-echo "configure:11959: checking for Berkeley DB thread support" >&5
+echo "configure:12020: checking for Berkeley DB thread support" >&5
 if eval "test \"\${ol_cv_berkeley_db_thread+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -11969,7 +12030,7 @@ else
   ol_cv_berkeley_db_thread=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 11973 "configure"
+#line 12034 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -12009,7 +12070,7 @@ main()
        return rc;
 }
 EOF
-if { (eval echo configure:12013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:12074: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_berkeley_db_thread=yes
 else
 
 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
        echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
-echo "configure:12077: checking for MDBM library" >&5
+echo "configure:12138: checking for MDBM library" >&5
 if eval "test \"\${ol_cv_lib_mdbm+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
        ol_LIBS="$LIBS"
        echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
-echo "configure:12083: checking for mdbm_set_chain" >&5
+echo "configure:12144: checking for mdbm_set_chain" >&5
 if eval "test \"\${ac_cv_func_mdbm_set_chain+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 12088 "configure"
+#line 12149 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char mdbm_set_chain(); below.  */
@@ -12108,7 +12169,7 @@ f = mdbm_set_chain;
 
 ; return 0; }
 EOF
-if { (eval echo configure:12112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_mdbm_set_chain=yes"
 else
@@ -12127,7 +12188,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
-echo "configure:12131: checking for mdbm_set_chain in -lmdbm" >&5
+echo "configure:12192: checking for mdbm_set_chain in -lmdbm" >&5
 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -12135,7 +12196,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lmdbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 12139 "configure"
+#line 12200 "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
@@ -12146,7 +12207,7 @@ int main() {
 mdbm_set_chain()
 ; return 0; }
 EOF
-if { (eval echo configure:12150: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12211: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -12181,17 +12242,17 @@ echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:12185: checking for $ac_hdr" >&5
+echo "configure:12246: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 12190 "configure"
+#line 12251 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:12195: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12256: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -12218,7 +12279,7 @@ fi
 done
 
  echo $ac_n "checking for db""... $ac_c" 1>&6
-echo "configure:12222: checking for db" >&5
+echo "configure:12283: checking for db" >&5
 if eval "test \"\${ol_cv_mdbm+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
 
 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
        echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
-echo "configure:12255: checking for GDBM library" >&5
+echo "configure:12316: checking for GDBM library" >&5
 if eval "test \"\${ol_cv_lib_gdbm+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
        ol_LIBS="$LIBS"
        echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
-echo "configure:12261: checking for gdbm_open" >&5
+echo "configure:12322: checking for gdbm_open" >&5
 if eval "test \"\${ac_cv_func_gdbm_open+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 12266 "configure"
+#line 12327 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gdbm_open(); below.  */
@@ -12286,7 +12347,7 @@ f = gdbm_open;
 
 ; return 0; }
 EOF
-if { (eval echo configure:12290: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12351: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_gdbm_open=yes"
 else
@@ -12305,7 +12366,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
-echo "configure:12309: checking for gdbm_open in -lgdbm" >&5
+echo "configure:12370: checking for gdbm_open in -lgdbm" >&5
 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -12313,7 +12374,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgdbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 12317 "configure"
+#line 12378 "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
@@ -12324,7 +12385,7 @@ int main() {
 gdbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:12328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12389: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -12359,17 +12420,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:12363: checking for $ac_hdr" >&5
+echo "configure:12424: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 12368 "configure"
+#line 12429 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:12373: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12434: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -12396,7 +12457,7 @@ fi
 done
 
  echo $ac_n "checking for db""... $ac_c" 1>&6
-echo "configure:12400: checking for db" >&5
+echo "configure:12461: checking for db" >&5
 if eval "test \"\${ol_cv_gdbm+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
 
 if test $ol_with_ldbm_api = ndbm ; then
        echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
-echo "configure:12434: checking for NDBM library" >&5
+echo "configure:12495: checking for NDBM library" >&5
 if eval "test \"\${ol_cv_lib_ndbm+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
        ol_LIBS="$LIBS"
        echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
-echo "configure:12440: checking for dbm_open" >&5
+echo "configure:12501: checking for dbm_open" >&5
 if eval "test \"\${ac_cv_func_dbm_open+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 12445 "configure"
+#line 12506 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dbm_open(); below.  */
@@ -12465,7 +12526,7 @@ f = dbm_open;
 
 ; return 0; }
 EOF
-if { (eval echo configure:12469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_dbm_open=yes"
 else
@@ -12484,7 +12545,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
-echo "configure:12488: checking for dbm_open in -lndbm" >&5
+echo "configure:12549: checking for dbm_open in -lndbm" >&5
 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -12492,7 +12553,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lndbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 12496 "configure"
+#line 12557 "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
@@ -12503,7 +12564,7 @@ int main() {
 dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:12507: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12568: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -12523,7 +12584,7 @@ else
   echo "$ac_t""no" 1>&6
 
                        echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
-echo "configure:12527: checking for dbm_open in -ldbm" >&5
+echo "configure:12588: checking for dbm_open in -ldbm" >&5
 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -12531,7 +12592,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 12535 "configure"
+#line 12596 "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
@@ -12542,7 +12603,7 @@ int main() {
 dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:12546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -12579,17 +12640,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:12583: checking for $ac_hdr" >&5
+echo "configure:12644: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 12588 "configure"
+#line 12649 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:12593: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12654: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -12616,7 +12677,7 @@ fi
 done
 
  echo $ac_n "checking for db""... $ac_c" 1>&6
-echo "configure:12620: checking for db" >&5
+echo "configure:12681: checking for db" >&5
 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -12669,17 +12730,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:12673: checking for $ac_hdr" >&5
+echo "configure:12734: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 12678 "configure"
+#line 12739 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:12683: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12744: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -12710,7 +12771,7 @@ done
                have_wrappers=no
        else
                cat > conftest.$ac_ext <<EOF
-#line 12714 "configure"
+#line 12775 "configure"
 #include "confdefs.h"
 
 int allow_severity = 0;
@@ -12720,7 +12781,7 @@ int main() {
 hosts_access()
 ; return 0; }
 EOF
-if { (eval echo configure:12724: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:12785: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   have_wrappers=yes
 else
@@ -12740,7 +12801,7 @@ EOF
                WRAP_LIBS="-lwrap"
 
                                                echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
-echo "configure:12744: checking for main in -lnsl" >&5
+echo "configure:12805: checking for main in -lnsl" >&5
 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -12748,14 +12809,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 12752 "configure"
+#line 12813 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:12759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
 
 if test $ol_enable_syslog != no ; then
        echo $ac_n "checking for openlog""... $ac_c" 1>&6
-echo "configure:12800: checking for openlog" >&5
+echo "configure:12861: checking for openlog" >&5
 if eval "test \"\${ac_cv_func_openlog+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 12805 "configure"
+#line 12866 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char openlog(); below.  */
@@ -12825,7 +12886,7 @@ f = openlog;
 
 ; return 0; }
 EOF
-if { (eval echo configure:12829: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12890: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_openlog=yes"
 else
@@ -12855,17 +12916,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:12859: checking for $ac_hdr" >&5
+echo "configure:12920: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 12864 "configure"
+#line 12925 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:12869: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12930: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -12894,7 +12955,7 @@ done
 
 if test $ol_link_termcap = no ; then
        echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
-echo "configure:12898: checking for tputs in -ltermcap" >&5
+echo "configure:12959: checking for tputs in -ltermcap" >&5
 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -12902,7 +12963,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ltermcap  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 12906 "configure"
+#line 12967 "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
@@ -12913,7 +12974,7 @@ int main() {
 tputs()
 ; return 0; }
 EOF
-if { (eval echo configure:12917: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -12946,7 +13007,7 @@ fi
 
 if test $ol_link_termcap = no ; then
        echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
-echo "configure:12950: checking for initscr in -lncurses" >&5
+echo "configure:13011: checking for initscr in -lncurses" >&5
 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -12954,7 +13015,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lncurses  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 12958 "configure"
+#line 13019 "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
@@ -12965,7 +13026,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:12969: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -13009,17 +13070,17 @@ ol_link_spasswd=no
 if test $ol_with_cyrus_sasl != no ; then
        ac_safe=`echo "sasl.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for sasl.h""... $ac_c" 1>&6
-echo "configure:13013: checking for sasl.h" >&5
+echo "configure:13074: checking for sasl.h" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 13018 "configure"
+#line 13079 "configure"
 #include "confdefs.h"
 #include <sasl.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:13023: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:13084: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -13043,7 +13104,7 @@ fi
 
        if test $ac_cv_header_sasl_h = yes ; then
                echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
-echo "configure:13047: checking for sasl_client_init in -lsasl" >&5
+echo "configure:13108: checking for sasl_client_init in -lsasl" >&5
 ac_lib_var=`echo sasl'_'sasl_client_init | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -13051,7 +13112,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsasl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 13055 "configure"
+#line 13116 "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
@@ -13062,7 +13123,7 @@ int main() {
 sasl_client_init()
 ; return 0; }
 EOF
-if { (eval echo configure:13066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13127: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -13126,13 +13187,13 @@ if test $ol_with_fetch != no ; then
        ol_LIBS=$LIBS
 LIBS="-lfetch -lcom_err $LIBS"
 echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6
-echo "configure:13130: checking fetch(3) library" >&5
+echo "configure:13191: checking fetch(3) library" >&5
 if eval "test \"\${ol_cv_lib_fetch+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        cat > conftest.$ac_ext <<EOF
-#line 13136 "configure"
+#line 13197 "configure"
 #include "confdefs.h"
 
 #include <sys/param.h>
@@ -13142,7 +13203,7 @@ int main() {
 struct url *u = fetchParseURL("file:///"); 
 ; return 0; }
 EOF
-if { (eval echo configure:13146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_lib_fetch=yes
 else
@@ -13180,17 +13241,17 @@ if test $ol_with_readline != no ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:13184: checking for $ac_hdr" >&5
+echo "configure:13245: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 13189 "configure"
+#line 13250 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:13194: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:13255: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -13221,7 +13282,7 @@ done
                save_LIBS="$LIBS"
                LIBS="$TERMCAP_LIBS $LIBS"
                echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
-echo "configure:13225: checking for readline in -lreadline" >&5
+echo "configure:13286: checking for readline in -lreadline" >&5
 ac_lib_var=`echo readline'_'readline | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -13229,7 +13290,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lreadline  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 13233 "configure"
+#line 13294 "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
@@ -13240,7 +13301,7 @@ int main() {
 readline()
 ; return 0; }
 EOF
-if { (eval echo configure:13244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13305: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
 
 if test $ol_enable_crypt != no ; then
        echo $ac_n "checking for crypt""... $ac_c" 1>&6
-echo "configure:13286: checking for crypt" >&5
+echo "configure:13347: checking for crypt" >&5
 if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 13291 "configure"
+#line 13352 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char crypt(); below.  */
@@ -13311,7 +13372,7 @@ f = crypt;
 
 ; return 0; }
 EOF
-if { (eval echo configure:13315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_crypt=yes"
 else
@@ -13330,7 +13391,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:13334: checking for crypt in -lcrypt" >&5
+echo "configure:13395: checking for crypt in -lcrypt" >&5
 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -13338,7 +13399,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lcrypt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 13342 "configure"
+#line 13403 "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
@@ -13349,7 +13410,7 @@ int main() {
 crypt()
 ; return 0; }
 EOF
-if { (eval echo configure:13353: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
 
 if test $ol_enable_proctitle != no ; then
        echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
-echo "configure:13396: checking for setproctitle" >&5
+echo "configure:13457: checking for setproctitle" >&5
 if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 13401 "configure"
+#line 13462 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char setproctitle(); below.  */
@@ -13421,7 +13482,7 @@ f = setproctitle;
 
 ; return 0; }
 EOF
-if { (eval echo configure:13425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13486: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_setproctitle=yes"
 else
@@ -13440,7 +13501,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
-echo "configure:13444: checking for setproctitle in -lutil" >&5
+echo "configure:13505: checking for setproctitle in -lutil" >&5
 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -13448,7 +13509,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lutil  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 13452 "configure"
+#line 13513 "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
@@ -13459,7 +13520,7 @@ int main() {
 setproctitle()
 ; return 0; }
 EOF
-if { (eval echo configure:13463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13524: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -13495,12 +13556,12 @@ EOF
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:13499: checking for ANSI C header files" >&5
+echo "configure:13560: checking for ANSI C header files" >&5
 if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 13504 "configure"
+#line 13565 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -13508,7 +13569,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:13512: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:13573: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -13525,7 +13586,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 13529 "configure"
+#line 13590 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -13543,7 +13604,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 13547 "configure"
+#line 13608 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -13564,7 +13625,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 13568 "configure"
+#line 13629 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #if ((' ' & 0x0FF) == 0x020)
@@ -13582,7 +13643,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:13586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:13647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -13606,12 +13667,12 @@ EOF
 fi
 
 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:13610: checking for mode_t" >&5
+echo "configure:13671: checking for mode_t" >&5
 if eval "test \"\${ac_cv_type_mode_t+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 13615 "configure"
+#line 13676 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -13642,12 +13703,12 @@ EOF
 fi
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:13646: checking for off_t" >&5
+echo "configure:13707: checking for off_t" >&5
 if eval "test \"\${ac_cv_type_off_t+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 13651 "configure"
+#line 13712 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -13678,12 +13739,12 @@ EOF
 fi
 
 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:13682: checking for pid_t" >&5
+echo "configure:13743: checking for pid_t" >&5
 if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 13687 "configure"
+#line 13748 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -13714,19 +13775,19 @@ EOF
 fi
 
 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
-echo "configure:13718: checking for ptrdiff_t" >&5
+echo "configure:13779: checking for ptrdiff_t" >&5
 if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 13723 "configure"
+#line 13784 "configure"
 #include "confdefs.h"
 #include <stddef.h>
 int main() {
 ptrdiff_t p
 ; return 0; }
 EOF
-if { (eval echo configure:13730: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:13791: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_type_ptrdiff_t=yes
 else
@@ -13747,12 +13808,12 @@ EOF
    fi
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:13751: checking return type of signal handlers" >&5
+echo "configure:13812: checking return type of signal handlers" >&5
 if eval "test \"\${ac_cv_type_signal+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 13756 "configure"
+#line 13817 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -13769,7 +13830,7 @@ int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:13773: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:13834: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -13788,12 +13849,12 @@ EOF
 
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:13792: checking for size_t" >&5
+echo "configure:13853: checking for size_t" >&5
 if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 13797 "configure"
+#line 13858 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
 
 
 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
-echo "configure:13829: checking for ssize_t" >&5
+echo "configure:13890: checking for ssize_t" >&5
 if eval "test \"\${ac_cv_type_ssize_t+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 13834 "configure"
+#line 13895 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -13861,12 +13922,12 @@ EOF
 fi
 
 echo $ac_n "checking for caddr_t""... $ac_c" 1>&6
-echo "configure:13865: checking for caddr_t" >&5
+echo "configure:13926: checking for caddr_t" >&5
 if eval "test \"\${ac_cv_type_caddr_t+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 13870 "configure"
+#line 13931 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
 
 
 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
-echo "configure:13902: checking for socklen_t" >&5
+echo "configure:13963: checking for socklen_t" >&5
 if eval "test \"\${ol_cv_type_socklen_t+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 13907 "configure"
+#line 13968 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_SYS_TYPES_H
@@ -13917,7 +13978,7 @@ int main() {
 socklen_t len;
 ; return 0; }
 EOF
-if { (eval echo configure:13921: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:13982: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_type_socklen_t=yes
 else
@@ -13938,12 +13999,12 @@ EOF
   fi
  
 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
-echo "configure:13942: checking for member st_blksize in aggregate type struct stat" >&5
+echo "configure:14003: checking for member st_blksize in aggregate type struct stat" >&5
 if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 13947 "configure"
+#line 14008 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -13951,7 +14012,7 @@ int main() {
 struct stat foo; foo.st_blksize;
 ; return 0; }
 EOF
-if { (eval echo configure:13955: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:14016: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_struct_member_st_blksize=yes
 else
@@ -13973,12 +14034,12 @@ EOF
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:13977: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:14038: checking whether time.h and sys/time.h may both be included" >&5
 if eval "test \"\${ac_cv_header_time+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 13982 "configure"
+#line 14043 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -13987,7 +14048,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:13991: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:14052: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -14008,12 +14069,12 @@ EOF
 fi
 
 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:14012: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:14073: checking whether struct tm is in sys/time.h or time.h" >&5
 if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 14017 "configure"
+#line 14078 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <time.h>
@@ -14021,7 +14082,7 @@ int main() {
 struct tm *tp; tp->tm_sec;
 ; return 0; }
 EOF
-if { (eval echo configure:14025: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:14086: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm=time.h
 else
@@ -14042,12 +14103,12 @@ EOF
 fi
 
 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:14046: checking for uid_t in sys/types.h" >&5
+echo "configure:14107: checking for uid_t in sys/types.h" >&5
 if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 14051 "configure"
+#line 14112 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 EOF
@@ -14076,19 +14137,19 @@ EOF
 fi
 
 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
-echo "configure:14080: checking for sig_atomic_t" >&5
+echo "configure:14141: checking for sig_atomic_t" >&5
 if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 14085 "configure"
+#line 14146 "configure"
 #include "confdefs.h"
 #include <signal.h>
 int main() {
 sig_atomic_t atomic;
 ; return 0; }
 EOF
-if { (eval echo configure:14092: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:14153: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_type_sig_atomic_t=yes
 else
@@ -14112,13 +14173,13 @@ EOF
 
 # test for pw_gecos in struct passwd
 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
-echo "configure:14116: checking struct passwd for pw_gecos" >&5
+echo "configure:14177: checking struct passwd for pw_gecos" >&5
 if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        cat > conftest.$ac_ext <<EOF
-#line 14122 "configure"
+#line 14183 "configure"
 #include "confdefs.h"
 #include <pwd.h>
 int main() {
@@ -14128,7 +14189,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:14132: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:14193: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_struct_passwd_pw_gecos=yes
 else
 
 # test for pw_passwd in struct passwd
 echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6
-echo "configure:14154: checking struct passwd for pw_passwd" >&5
+echo "configure:14215: checking struct passwd for pw_passwd" >&5
 if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        cat > conftest.$ac_ext <<EOF
-#line 14160 "configure"
+#line 14221 "configure"
 #include "confdefs.h"
 #include <pwd.h>
 int main() {
@@ -14166,7 +14227,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:14170: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:14231: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_struct_passwd_pw_passwd=yes
 else
@@ -14188,7 +14249,7 @@ fi
 
 
 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
-echo "configure:14192: checking if toupper() requires islower()" >&5
+echo "configure:14253: checking if toupper() requires islower()" >&5
 if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -14197,7 +14258,7 @@ else
   ol_cv_c_upper_lower=safe
 else
   cat > conftest.$ac_ext <<EOF
-#line 14201 "configure"
+#line 14262 "configure"
 #include "confdefs.h"
 
 #include <ctype.h>
@@ -14209,7 +14270,7 @@ main()
                exit(1);
 }
 EOF
-if { (eval echo configure:14213: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:14274: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_c_upper_lower=no
 else
@@ -14232,12 +14293,12 @@ EOF
 fi
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:14236: checking for working const" >&5
+echo "configure:14297: checking for working const" >&5
 if eval "test \"\${ac_cv_c_const+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 14241 "configure"
+#line 14302 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -14286,7 +14347,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:14290: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:14351: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -14307,12 +14368,12 @@ EOF
 fi
 
 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
-echo "configure:14311: checking if compiler understands volatile" >&5
+echo "configure:14372: checking if compiler understands volatile" >&5
 if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 14316 "configure"
+#line 14377 "configure"
 #include "confdefs.h"
 int x, y, z;
 int main() {
@@ -14321,7 +14382,7 @@ volatile int a; int * volatile b = x ? &y : &z;
       *b = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:14325: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:14386: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_c_volatile=yes
 else
@@ -14351,14 +14412,14 @@ EOF
 
 else
        echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:14355: checking whether byte ordering is bigendian" >&5
+echo "configure:14416: checking whether byte ordering is bigendian" >&5
 if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_cv_c_bigendian=unknown
 # See if sys/param.h defines the BYTE_ORDER macro.
 cat > conftest.$ac_ext <<EOF
-#line 14362 "configure"
+#line 14423 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -14369,11 +14430,11 @@ int main() {
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:14373: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:14434: \"$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 14377 "configure"
+#line 14438 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -14384,7 +14445,7 @@ int main() {
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:14388: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:14449: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_bigendian=yes
 else
@@ -14404,7 +14465,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 14408 "configure"
+#line 14469 "configure"
 #include "confdefs.h"
 main () {
   /* Are we little or big endian?  From Harbison&Steele.  */
@@ -14417,7 +14478,7 @@ main () {
   exit (u.c[sizeof (long) - 1] == 1);
 }
 EOF
-if { (eval echo configure:14421: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:14482: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_bigendian=no
 else
 fi
 
 echo $ac_n "checking size of short""... $ac_c" 1>&6
-echo "configure:14447: checking size of short" >&5 
+echo "configure:14508: checking size of short" >&5 
 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
   cat > conftest.$ac_ext <<EOF
-#line 14453 "configure"
+#line 14514 "configure"
 #include "confdefs.h"
 #include "confdefs.h" 
 #include <sys/types.h> 
@@ -14459,7 +14520,7 @@ int main() {
 switch (0) case 0: case (sizeof (short) == $ac_size):;
 ; return 0; }
 EOF
-if { (eval echo configure:14463: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:14524: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_sizeof_short=$ac_size
 else
@@ -14482,13 +14543,13 @@ EOF
  
  
 echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:14486: checking size of int" >&5 
+echo "configure:14547: checking size of int" >&5 
 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
   cat > conftest.$ac_ext <<EOF
-#line 14492 "configure"
+#line 14553 "configure"
 #include "confdefs.h"
 #include "confdefs.h" 
 #include <sys/types.h> 
@@ -14498,7 +14559,7 @@ int main() {
 switch (0) case 0: case (sizeof (int) == $ac_size):;
 ; return 0; }
 EOF
-if { (eval echo configure:14502: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:14563: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_sizeof_int=$ac_size
 else
@@ -14521,13 +14582,13 @@ EOF
  
  
 echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:14525: checking size of long" >&5 
+echo "configure:14586: checking size of long" >&5 
 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
   cat > conftest.$ac_ext <<EOF
-#line 14531 "configure"
+#line 14592 "configure"
 #include "confdefs.h"
 #include "confdefs.h" 
 #include <sys/types.h> 
@@ -14537,7 +14598,7 @@ int main() {
 switch (0) case 0: case (sizeof (long) == $ac_size):;
 ; return 0; }
 EOF
-if { (eval echo configure:14541: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:14602: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_sizeof_long=$ac_size
 else
@@ -14588,7 +14649,7 @@ EOF
 
 
 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
-echo "configure:14592: checking for 8-bit clean memcmp" >&5
+echo "configure:14653: checking for 8-bit clean memcmp" >&5
 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -14596,7 +14657,7 @@ else
   ac_cv_func_memcmp_clean=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 14600 "configure"
+#line 14661 "configure"
 #include "confdefs.h"
 
 main()
@@ -14606,7 +14667,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:14610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:14671: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_memcmp_clean=yes
 else
@@ -14624,12 +14685,12 @@ echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
 
 echo $ac_n "checking for strftime""... $ac_c" 1>&6
-echo "configure:14628: checking for strftime" >&5
+echo "configure:14689: checking for strftime" >&5
 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 14633 "configure"
+#line 14694 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char strftime(); below.  */
@@ -14653,7 +14714,7 @@ f = strftime;
 
 ; return 0; }
 EOF
-if { (eval echo configure:14657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14718: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_strftime=yes"
 else
@@ -14675,7 +14736,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:14679: checking for strftime in -lintl" >&5
+echo "configure:14740: checking for strftime in -lintl" >&5
 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -14683,7 +14744,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lintl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 14687 "configure"
+#line 14748 "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
@@ -14694,7 +14755,7 @@ int main() {
 strftime()
 ; return 0; }
 EOF
-if { (eval echo configure:14698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
 
 
 echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6
-echo "configure:14726: checking for inet_aton()" >&5
+echo "configure:14787: checking for inet_aton()" >&5
 if eval "test \"\${ol_cv_func_inet_aton+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 14731 "configure"
+#line 14792 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_SYS_TYPES_H
@@ -14749,7 +14810,7 @@ struct in_addr in;
 int rc = inet_aton( "255.255.255.255", &in );
 ; return 0; }
 EOF
-if { (eval echo configure:14753: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14814: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_func_inet_aton=yes
 else
@@ -14771,12 +14832,12 @@ EOF
  
 
 echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6
-echo "configure:14775: checking for _spawnlp" >&5
+echo "configure:14836: checking for _spawnlp" >&5
 if eval "test \"\${ac_cv_func__spawnlp+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 14780 "configure"
+#line 14841 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _spawnlp(); below.  */
@@ -14800,7 +14861,7 @@ f = _spawnlp;
 
 ; return 0; }
 EOF
-if { (eval echo configure:14804: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func__spawnlp=yes"
 else
 
 
 echo $ac_n "checking for _snprintf""... $ac_c" 1>&6
-echo "configure:14828: checking for _snprintf" >&5
+echo "configure:14889: checking for _snprintf" >&5
 if eval "test \"\${ac_cv_func__snprintf+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 14833 "configure"
+#line 14894 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _snprintf(); below.  */
@@ -14853,7 +14914,7 @@ f = _snprintf;
 
 ; return 0; }
 EOF
-if { (eval echo configure:14857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func__snprintf=yes"
 else
 
 
 echo $ac_n "checking for _vsnprintf""... $ac_c" 1>&6
-echo "configure:14883: checking for _vsnprintf" >&5
+echo "configure:14944: checking for _vsnprintf" >&5
 if eval "test \"\${ac_cv_func__vsnprintf+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 14888 "configure"
+#line 14949 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _vsnprintf(); below.  */
@@ -14908,7 +14969,7 @@ f = _vsnprintf;
 
 ; return 0; }
 EOF
-if { (eval echo configure:14912: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func__vsnprintf=yes"
 else
 
 
 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
-echo "configure:14938: checking for vprintf" >&5
+echo "configure:14999: checking for vprintf" >&5
 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 14943 "configure"
+#line 15004 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char vprintf(); below.  */
@@ -14963,7 +15024,7 @@ f = vprintf;
 
 ; return 0; }
 EOF
-if { (eval echo configure:14967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15028: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_vprintf=yes"
 else
 
 if test "$ac_cv_func_vprintf" != yes; then
 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
-echo "configure:14991: checking for _doprnt" >&5
+echo "configure:15052: checking for _doprnt" >&5
 if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 14996 "configure"
+#line 15057 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _doprnt(); below.  */
@@ -15016,7 +15077,7 @@ f = _doprnt;
 
 ; return 0; }
 EOF
-if { (eval echo configure:15020: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15081: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func__doprnt=yes"
 else
@@ -15045,12 +15106,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:15049: checking for $ac_func" >&5
+echo "configure:15110: checking for $ac_func" >&5
 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 15054 "configure"
+#line 15115 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -15074,7 +15135,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:15078: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15139: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -15153,12 +15214,12 @@ for ac_func in \
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:15157: checking for $ac_func" >&5
+echo "configure:15218: checking for $ac_func" >&5
 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 15162 "configure"
+#line 15223 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -15182,7 +15243,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:15186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15247: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -15210,12 +15271,12 @@ done
 for ac_func in getopt tempnam
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:15214: checking for $ac_func" >&5
+echo "configure:15275: checking for $ac_func" >&5
 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 15219 "configure"
+#line 15280 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -15239,7 +15300,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:15243: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
 
 # Check Configuration
 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
-echo "configure:15280: checking declaration of sys_errlist" >&5
+echo "configure:15341: checking declaration of sys_errlist" >&5
 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        cat > conftest.$ac_ext <<EOF
-#line 15286 "configure"
+#line 15347 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -15295,7 +15356,7 @@ int main() {
 char *c = (char *) *sys_errlist
 ; return 0; }
 EOF
-if { (eval echo configure:15299: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:15360: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_dcl_sys_errlist=yes
        ol_cv_have_sys_errlist=yes
@@ -15318,20 +15379,20 @@ EOF
 
 
        echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
-echo "configure:15322: checking existence of sys_errlist" >&5
+echo "configure:15383: checking existence of sys_errlist" >&5
 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
                cat > conftest.$ac_ext <<EOF
-#line 15328 "configure"
+#line 15389 "configure"
 #include "confdefs.h"
 #include <errno.h>
 int main() {
 char *c = (char *) *sys_errlist
 ; return 0; }
 EOF
-if { (eval echo configure:15335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_have_sys_errlist=yes
 else
@@ -15562,6 +15623,25 @@ EOF
        fi
 fi
 
+if test "$ol_enable_sql" != no ; then
+       cat >> confdefs.h <<\EOF
+#define SLAPD_SQL 1
+EOF
+
+       BUILD_SLAPD=yes
+       BUILD_SQL=yes
+       SLAPD_SQL_LIBS=-liodbc
+       if test "$ol_with_sql_module" != static; then
+               cat >> confdefs.h <<\EOF
+#define SLAPD_SQL_DYNAMIC 1
+EOF
+
+               BUILD_SQL=mod
+               BUILD_SQL_DYNAMIC=shared
+               SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-sql/back_sql.la"
+       fi
+fi
+
 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
        $BUILD_SLAPD = yes ; then
        BUILD_SLURPD=yes
   
   
   
+  
+  
+
+
+
+
 
 
 
@@ -15717,6 +15803,7 @@ servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.i
 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
+servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
@@ -15817,11 +15904,13 @@ s%@BUILD_LDAP@%$BUILD_LDAP%g
 s%@BUILD_LDBM@%$BUILD_LDBM%g
 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
 s%@BUILD_SHELL@%$BUILD_SHELL%g
+s%@BUILD_SQL@%$BUILD_SQL%g
 s%@BUILD_DNSSRV_DYNAMIC@%$BUILD_DNSSRV_DYNAMIC%g
 s%@BUILD_LDAP_DYNAMIC@%$BUILD_LDAP_DYNAMIC%g
 s%@BUILD_LDBM_DYNAMIC@%$BUILD_LDBM_DYNAMIC%g
 s%@BUILD_PASSWD_DYNAMIC@%$BUILD_PASSWD_DYNAMIC%g
 s%@BUILD_SHELL_DYNAMIC@%$BUILD_SHELL_DYNAMIC%g
+s%@BUILD_SQL_DYNAMIC@%$BUILD_SQL_DYNAMIC%g
 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
 s%@LDAP_LIBS@%$LDAP_LIBS%g
 s%@LDIF_LIBS@%$LDIF_LIBS%g
@@ -15843,6 +15932,9 @@ s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
 s%@TLS_LIBS@%$TLS_LIBS%g
 s%@MODULES_LIBS@%$MODULES_LIBS%g
 s%@AUTH_LIBS@%$AUTH_LIBS%g
+s%@SLAPD_SQL_LDFLAGS@%$SLAPD_SQL_LDFLAGS%g
+s%@SLAPD_SQL_LIBS@%$SLAPD_SQL_LIBS%g
+s%@SLAPD_SQL_INCLUDES@%$SLAPD_SQL_INCLUDES%g
 
 CEOF
 EOF
@@ -15918,6 +16010,7 @@ servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.i
 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
+servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
index f778cb01937e75ae53cf1b528cdd26e6a8967f58..bedb3ecac34571fbf7cd5c440ea4d3a6e7dd7aa8 100644 (file)
@@ -171,6 +171,9 @@ OL_ARG_WITH(passwd_module,[      --with-passwd-module       module type], static,
 OL_ARG_ENABLE(shell,[    --enable-shell        enable shell backend], no)dnl
 OL_ARG_WITH(shell_module,[      --with-shell-module    module type], static,
        [static dynamic])
+OL_ARG_ENABLE(sql,[    --enable-sql    enable sql backend], no)dnl
+OL_ARG_WITH(sql_module,[      --with-sql-module        module type], static,
+       [static dynamic])
 
 dnl ----------------------------------------------------------------
 dnl SLURPD OPTIONS
@@ -204,6 +207,9 @@ if test $ol_enable_slapd = no ; then
        if test $ol_enable_shell = yes ; then
                AC_MSG_WARN([slapd disabled, ignoring --enable-shell argument])
        fi
+       if test $ol_enable_sql = yes ; then
+               AC_MSG_WARN([slapd disabled, ignoring --enable-sql argument])
+       fi
        if test $ol_enable_modules = yes ; then
                AC_MSG_WARN([slapd disabled, ignoring --enable-modules argument])
        fi
@@ -243,6 +249,9 @@ if test $ol_enable_slapd = no ; then
        if test $ol_with_shell_module != static ; then
                AC_MSG_WARN([slapd disabled, ignoring --with-shell-module argument])
        fi
+       if test $ol_with_sql_module != static ; then
+               AC_MSG_WARN([slapd disabled, ignoring --with-sql-module argument])
+       fi
        if test $ol_enable_slurpd = yes ; then
                AC_MSG_ERROR([slurpd requires slapd])
        fi
@@ -253,6 +262,7 @@ if test $ol_enable_slapd = no ; then
        ol_enable_ldbm=no
        ol_enable_passwd=no
        ol_enable_shell=no
+       ol_enable_sql=no
 
        ol_enable_modules=no
        ol_enable_multimaster=no
@@ -270,6 +280,7 @@ if test $ol_enable_slapd = no ; then
        ol_with_ldbm_module=static
        ol_with_passwd_module=static
        ol_with_shell_module=static
+       ol_with_sql_module=static
 
        ol_enable_slurpd=no
 
@@ -292,7 +303,8 @@ elif test $ol_enable_ldbm = no ; then
                $ol_enable_dnssrv = no -a \
                $ol_enable_ldap = no -a \
                $ol_enable_passwd = no -a \
-               $ol_enable_shell = no ; then
+               $ol_enable_shell = no -a \
+               $ol_enable_sql = no ; then
                AC_MSG_ERROR([slapd requires a backend])
        fi
 
@@ -365,17 +377,23 @@ BUILD_LDAP=no
 BUILD_LDBM=no
 BUILD_PASSWD=no
 BUILD_SHELL=no
+BUILD_SQL=no
 
 BUILD_DNSSRV_DYNAMIC=static
 BUILD_LDAP_DYNAMIC=static
 BUILD_LDBM_DYNAMIC=static
 BUILD_PASSWD_DYNAMIC=static
 BUILD_SHELL_DYNAMIC=static
+BUILD_SQL_DYNAMIC=static
 
 SLAPD_MODULES_LDFLAGS=
 SLAPD_MODULES_CPPFLAGS=
 SLAPD_MODULES_LIST=
 
+SLAPD_SQL_LDFLAGS=
+SLAPD_SQL_LIBS=
+SLAPD_SQL_INCLUDES=
+
 KRB4_LIBS=
 KRB5_LIBS=
 READLINE_LIBS=
@@ -568,6 +586,7 @@ else
        ol_with_ldbm_module=static
        ol_with_passwd_module=static
        ol_with_shell_module=static
+       ol_with_sql_module=static
 fi
 
 dnl ----------------------------------------------------------------
@@ -2115,6 +2134,20 @@ if test "$ol_enable_shell" != no ; then
        fi
 fi
 
+if test "$ol_enable_sql" != no ; then
+       AC_DEFINE(SLAPD_SQL,1,[define to support SQL backend])
+       BUILD_SLAPD=yes
+       BUILD_SQL=yes
+       SLAPD_SQL_LIBS=-liodbc
+       if test "$ol_with_sql_module" != static; then
+               AC_DEFINE(SLAPD_SQL_DYNAMIC,1,
+                       [define to support dynamic SQL backend])
+               BUILD_SQL=mod
+               BUILD_SQL_DYNAMIC=shared
+               SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-sql/back_sql.la"
+       fi
+fi
+
 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
        $BUILD_SLAPD = yes ; then
        BUILD_SLURPD=yes
@@ -2151,11 +2184,13 @@ AC_SUBST(BUILD_SLAPD)
   AC_SUBST(BUILD_LDBM)
   AC_SUBST(BUILD_PASSWD)
   AC_SUBST(BUILD_SHELL)
+  AC_SUBST(BUILD_SQL)
   AC_SUBST(BUILD_DNSSRV_DYNAMIC)
   AC_SUBST(BUILD_LDAP_DYNAMIC)
   AC_SUBST(BUILD_LDBM_DYNAMIC)
   AC_SUBST(BUILD_PASSWD_DYNAMIC)
   AC_SUBST(BUILD_SHELL_DYNAMIC)
+  AC_SUBST(BUILD_SQL_DYNAMIC)
 AC_SUBST(BUILD_SLURPD)
 
 AC_SUBST(LDAP_LIBS)
@@ -2181,6 +2216,10 @@ AC_SUBST(TLS_LIBS)
 AC_SUBST(MODULES_LIBS)
 AC_SUBST(AUTH_LIBS)
 
+AC_SUBST(SLAPD_SQL_LDFLAGS)
+AC_SUBST(SLAPD_SQL_LIBS)
+AC_SUBST(SLAPD_SQL_INCLUDES)
+
 dnl ----------------------------------------------------------------
 dnl final output
 dnl
@@ -2219,6 +2258,7 @@ servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.i
 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
+servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
index 840383499bbfae7a675c8062323980417642ad6c..54b003fa6a96903b92819ffea94a66eca02267ad 100644 (file)
 /* define to support dynamic SHELL backend */
 #undef SLAPD_SHELL_DYNAMIC
 
+/* define to support SQL backend */
+#undef SLAPD_SQL
+
+/* define to support dynamic SQL backend */
+#undef SLAPD_SQL_DYNAMIC
+
 
 /* begin of postamble */
 
diff --git a/servers/slapd/back-sql/Makefile.in b/servers/slapd/back-sql/Makefile.in
new file mode 100644 (file)
index 0000000..5ee2f0c
--- /dev/null
@@ -0,0 +1,24 @@
+# $OpenLDAP$
+
+SRCS   = init.c config.c search.c bind.c other.c \
+               entry-id.c schema-map.c sql-wrap.c modify.c util.c
+OBJS   = init.lo config.lo search.lo bind.lo other.lo \
+               entry-id.lo schema-map.lo sql-wrap.lo modify.lo util.lo
+
+LDAP_INCDIR= ../../../include       
+LDAP_LIBDIR= ../../../libraries
+
+BUILD_OPT = "--enable-sql"
+BUILD_MOD = @BUILD_SQL@
+LINKAGE = @BUILD_SQL_DYNAMIC@
+
+LIBBASE = back_sql
+
+XINCPATH = -I.. -I$(srcdir)/.. $(SLAPD_SQL_INCLUDES)
+XDEFS = $(MODULES_CPPFLAGS)
+
+all-local-lib: ../.backend
+
+../.backend: lib$(LIBBASE).a
+       @touch $@
+
diff --git a/servers/slapd/back-sql/back-sql.h b/servers/slapd/back-sql/back-sql.h
new file mode 100644 (file)
index 0000000..a63ca8e
--- /dev/null
@@ -0,0 +1,41 @@
+#ifndef __BACKSQL_H__
+#define __BACKSQL_H__
+
+/*
+ *      Copyright 1999, Dmitry Kovalev <mit@openldap.org>, All rights reserved.
+ *
+ *      Redistribution and use in source and binary forms are permitted only
+ *      as authorized by the OpenLDAP Public License.  A copy of this
+ *      license is available at http://www.OpenLDAP.org/license.html or
+ *      in file LICENSE in the top-level directory of the distribution.
+ */
+
+
+#include "external.h"
+#include "sql-types.h"
+#define BACKSQL_MAX_DN_LEN 255
+
+typedef struct
+{
+ char *dbhost;
+ int dbport;
+ char *dbuser;
+ char *dbpasswd;
+ char *dbname;
+ //SQL condition for subtree searches differs in syntax:
+ //"LIKE CONCAT('%',?)" or "LIKE '%'+?" or smth else
+ char *subtree_cond;
+ char *oc_query,*at_query;
+ char *insentry_query,*delentry_query;
+ char *id_query;
+ char *upper_func;
+ Avlnode *db_conns;
+ Avlnode *oc_by_name;
+ Avlnode *oc_by_id;
+ int schema_loaded;
+ ldap_pvt_thread_mutex_t dbconn_mutex;
+ ldap_pvt_thread_mutex_t schema_mutex;
+ SQLHENV db_env;
+}backsql_info;
+
+#endif
\ No newline at end of file
diff --git a/servers/slapd/back-sql/backsql.dsp b/servers/slapd/back-sql/backsql.dsp
new file mode 100644 (file)
index 0000000..8a5189e
--- /dev/null
@@ -0,0 +1,205 @@
+# Microsoft Developer Studio Project File - Name="backsql" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Static Library" 0x0104
+
+CFG=backsql - Win32 Single Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "backsql.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "backsql.mak" CFG="backsql - Win32 Single Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "backsql - Win32 Release" (based on "Win32 (x86) Static Library")
+!MESSAGE "backsql - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE "backsql - Win32 Single Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE "backsql - Win32 Single Release" (based on\
+ "Win32 (x86) Static Library")
+!MESSAGE 
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+
+!IF  "$(CFG)" == "backsql - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\..\..\Release"
+# PROP Intermediate_Dir "..\..\..\Release\backsql"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x419
+# ADD RSC /l 0x419
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\\" /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ELSEIF  "$(CFG)" == "backsql - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "..\..\..\Debug"
+# PROP Intermediate_Dir "..\..\..\Debug\backsql"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x419
+# ADD RSC /l 0x419
+# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "..\\" /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FR /YX /FD /c
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ELSEIF  "$(CFG)" == "backsql - Win32 Single Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "backsql"
+# PROP BASE Intermediate_Dir "backsql"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "..\..\..\SDebug"
+# PROP Intermediate_Dir "..\..\..\SDebug\backsql"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x419
+# ADD RSC /l 0x419
+# ADD BASE CPP /nologo /MTd /W3 /GX /Z7 /Od /I "..\\" /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FR /YX /FD /c
+# ADD CPP /nologo /W3 /GX /Z7 /Od /I "..\\" /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FR /YX /FD /c
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ELSEIF  "$(CFG)" == "backsql - Win32 Single Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "backldb0"
+# PROP BASE Intermediate_Dir "backldb0"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\..\..\SRelease"
+# PROP Intermediate_Dir "..\..\..\SRelease\backsql"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x419
+# ADD RSC /l 0x419
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\\" /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "..\\" /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ENDIF 
+
+# Begin Target
+
+# Name "backsql - Win32 Release"
+# Name "backsql - Win32 Debug"
+# Name "backsql - Win32 Single Debug"
+# Name "backsql - Win32 Single Release"
+# Begin Source File
+
+SOURCE=".\back-sql.h"
+# End Source File
+# Begin Source File
+
+SOURCE=.\bind.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\config.c
+# End Source File
+# Begin Source File
+
+SOURCE=".\entry-id.c"
+# End Source File
+# Begin Source File
+
+SOURCE=".\entry-id.h"
+# End Source File
+# Begin Source File
+
+SOURCE=.\external.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\init.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\modify.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\other.c
+# End Source File
+# Begin Source File
+
+SOURCE=".\schema-map.c"
+# End Source File
+# Begin Source File
+
+SOURCE=".\schema-map.h"
+# End Source File
+# Begin Source File
+
+SOURCE=.\search.c
+# End Source File
+# Begin Source File
+
+SOURCE=".\sql-types.h"
+# End Source File
+# Begin Source File
+
+SOURCE=".\sql-wrap.c"
+# End Source File
+# Begin Source File
+
+SOURCE=".\sql-wrap.h"
+# End Source File
+# Begin Source File
+
+SOURCE=.\util.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\util.h
+# End Source File
+# End Target
+# End Project
diff --git a/servers/slapd/back-sql/bind.c b/servers/slapd/back-sql/bind.c
new file mode 100644 (file)
index 0000000..20c566e
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ *      Copyright 1999, Dmitry Kovalev <mit@openldap.org>, All rights reserved.
+ *
+ *      Redistribution and use in source and binary forms are permitted only
+ *      as authorized by the OpenLDAP Public License.  A copy of this
+ *      license is available at http://www.OpenLDAP.org/license.html or
+ *      in file LICENSE in the top-level directory of the distribution.
+ */
+
+#include "portable.h"
+
+#ifdef SLAPD_SQL
+
+#include <stdio.h>
+#include <sys/types.h>
+#include "slap.h"
+#include "back-sql.h"
+#include "sql-wrap.h"
+
+int backsql_bind(BackendDB *be,Connection *conn,Operation *op,
+       const char *dn,const char *ndn,int method,struct berval *cred,char** edn)
+{
+ Debug(LDAP_DEBUG_TRACE,"==>backsql_bind()\n",0,0,0);
+ //for now, just return OK, allowing to test modify operations
+ send_ldap_result(conn,op,LDAP_SUCCESS,NULL,NULL,NULL,0);
+ Debug(LDAP_DEBUG_TRACE,"<==backsql_bind()\n",0,0,0);
+ return 0;
+}
+int backsql_unbind(BackendDB *be,Connection *conn,Operation *op)
+{
+ Debug(LDAP_DEBUG_TRACE,"==>backsql_unbind()\n",0,0,0);
+ send_ldap_result(conn,op,LDAP_SUCCESS,NULL,NULL,NULL,0);
+ Debug(LDAP_DEBUG_TRACE,"<==backsql_unbind()\n",0,0,0);
+ return 0;
+}
+
+#endif /* SLAPD_SQL */
diff --git a/servers/slapd/back-sql/config.c b/servers/slapd/back-sql/config.c
new file mode 100644 (file)
index 0000000..85c9cab
--- /dev/null
@@ -0,0 +1,187 @@
+/*
+ *      Copyright 1999, Dmitry Kovalev <mit@openldap.org>, All rights reserved.
+ *
+ *      Redistribution and use in source and binary forms are permitted only
+ *      as authorized by the OpenLDAP Public License.  A copy of this
+ *      license is available at http://www.OpenLDAP.org/license.html or
+ *      in file LICENSE in the top-level directory of the distribution.
+ */
+
+#include "portable.h"
+
+#ifdef SLAPD_SQL
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include "slap.h"
+#include "back-sql.h"
+#include "sql-wrap.h"
+
+int backsql_db_config(BackendDB *be,const char *fname,int lineno,int argc,char **argv)
+{
+ backsql_info *si=(backsql_info*) be->be_private;
+
+ Debug(LDAP_DEBUG_TRACE,"==>backsql_db_config()\n",0,0,0);
+ if (!si)
+  {
+   Debug(LDAP_DEBUG_TRACE,"backsql_db_config: be_private is NULL!!!\n",0,0,0);
+   exit(1);
+  }
+  
+ if (!strcasecmp(argv[0],"dbhost"))
+  {
+   if (argc<2)
+    {
+     Debug(LDAP_DEBUG_TRACE,"<==backsql_db_config (%s line %d): missing hostname in dbhost directive\n",
+                     fname,lineno,0);
+    }
+   else
+    {
+     si->dbhost=ch_strdup(argv[1]);
+     Debug(LDAP_DEBUG_TRACE,"<==backsql_db_config(): hostname=%s\n",si->dbhost,0,0);
+    }
+   return(0);
+  }
+  
+ if (!strcasecmp(argv[0],"dbuser"))
+  {
+   if (argc<2)
+    {
+     Debug(LDAP_DEBUG_TRACE,"<==backsql_db_config (%s line %d): missing username in dbuser directive\n",
+                     fname,lineno,0);
+    }
+   else
+    {
+     si->dbuser=ch_strdup(argv[1]);
+     Debug(LDAP_DEBUG_TRACE,"<==backsql_db_config(): dbuser=%s\n",argv[1],0,0);
+    }
+   return(0);
+  }
+ if (!strcasecmp(argv[0],"dbpasswd"))
+  {
+   if (argc<2)
+    {
+     Debug(LDAP_DEBUG_TRACE,"<==backsql_db_config (%s line %d): missing password in dbpasswd directive\n",
+                     fname,lineno,0);
+    }
+   else
+    {
+     si->dbpasswd=ch_strdup(argv[1]);
+     Debug(LDAP_DEBUG_TRACE,"<==backsql_db_config(): dbpasswd=%s\n",si->dbpasswd,0,0);
+    }
+   return(0);
+  }
+  
+ if (!strcasecmp(argv[0],"dbname"))
+  {
+   if (argc<2)
+    {
+     Debug(LDAP_DEBUG_TRACE,"<==backsql_db_config (%s line %d): missing database name in dbname directive\n",
+                     fname,lineno,0);
+    }
+   else
+    {
+     si->dbname=ch_strdup(argv[1]);
+     Debug(LDAP_DEBUG_TRACE,"<==backsql_db_config(): dbname=%s\n",si->dbname,0,0);
+    }
+   return(0);
+  }
+
+ if (!strcasecmp(argv[0],"subtree_cond"))
+  {
+   if (argc<2)
+    {
+     Debug(LDAP_DEBUG_TRACE,"<==backsql_db_config (%s line %d): missing SQL condition in subtree_cond directive\n",
+                     fname,lineno,0);
+    }
+   else
+    {
+     si->subtree_cond=ch_strdup(argv[1]);
+     Debug(LDAP_DEBUG_TRACE,"<==backsql_db_config(): subtree_cond=%s\n",si->subtree_cond,0,0);
+    }
+   return(0);
+  }
+
+ if (!strcasecmp(argv[0],"oc_query"))
+  {
+   if (argc<2)
+    {
+     Debug(LDAP_DEBUG_TRACE,"<==backsql_db_config (%s line %d): missing SQL statement in oc_query directive\n",
+                     fname,lineno,0);
+    }
+   else
+    {
+     si->oc_query=ch_strdup(argv[1]);
+     Debug(LDAP_DEBUG_TRACE,"<==backsql_db_config(): oc_query=%s\n",si->oc_query,0,0);
+    }
+   return(0);
+  }
+
+ if (!strcasecmp(argv[0],"at_query"))
+  {
+   if (argc<2)
+    {
+     Debug(LDAP_DEBUG_TRACE,"<==backsql_db_config (%s line %d): missing SQL statement in at_query directive\n",
+                     fname,lineno,0);
+    }
+   else
+    {
+     si->at_query=ch_strdup(argv[1]);
+     Debug(LDAP_DEBUG_TRACE,"<==backsql_db_config(): at_query=%s\n",si->at_query,0,0);
+    }
+   return(0);
+  }
+
+ if (!strcasecmp(argv[0],"insentry_query"))
+  {
+   if (argc<2)
+    {
+     Debug(LDAP_DEBUG_TRACE,"<==backsql_db_config (%s line %d): missing SQL statement in insentry_query directive\n",
+                     fname,lineno,0);
+    }
+   else
+    {
+     si->insentry_query=ch_strdup(argv[1]);
+     Debug(LDAP_DEBUG_TRACE,"<==backsql_db_config(): insentry_query=%s\n",si->insentry_query,0,0);
+    }
+   return(0);
+  }
+
+ if (!strcasecmp(argv[0],"upper_func"))
+  {
+   if (argc<2)
+    {
+     Debug(LDAP_DEBUG_TRACE,"<==backsql_db_config (%s line %d): missing function name in upper_func directive\n",
+                     fname,lineno,0);
+    }
+   else
+    {
+     si->upper_func=ch_strdup(argv[1]);
+     Debug(LDAP_DEBUG_TRACE,"<==backsql_db_config(): upper_func=%s\n",si->upper_func,0,0);
+    }
+   return(0);
+  }
+
+ if (!strcasecmp(argv[0],"delentry_query"))
+  {
+   if (argc<2)
+    {
+     Debug(LDAP_DEBUG_TRACE,"<==backsql_db_config (%s line %d): missing SQL statement in delentry_query directive\n",
+                     fname,lineno,0);
+    }
+   else
+    {
+     si->delentry_query=ch_strdup(argv[1]);
+     Debug(LDAP_DEBUG_TRACE,"<==backsql_db_config(): delentry_query=%s\n",si->delentry_query,0,0);
+    }
+   return(0);
+  }
+ Debug(LDAP_DEBUG_TRACE,"<==backsql_db_config (%s line %d): unknown directive '%s' (ignored)\n",
+                     fname,lineno,argv[0]);
+ return 0;
+}
+
+#endif /* SLAPD_SQL */
diff --git a/servers/slapd/back-sql/docs/bugs b/servers/slapd/back-sql/docs/bugs
new file mode 100644 (file)
index 0000000..c39e3f6
--- /dev/null
@@ -0,0 +1,30 @@
+1) driver name comparison for MS SQL Server workaround is realy kinda dirty
+   hack, but for now i don't know how to code it more carefully
+2) another dirty hack: length of LONGVARCHAR and LONGVARBINARY fields is
+   currently set to MAX_ATTR_LEN. Maybe such fields must be handled with
+   SQLGetData() instead of SQLBindCol(), but it is said in documentation,
+   that it is guaranteed to work only when such column goes after last bound
+   column. Or should we get ALL columns with SQLGetData (then something like 
+   _SQLFetchAsStrings() wrapper would do SQLGetData() for all columns)...
+4) in some cases (particularly, when using OpenLink Generic ODBC driver with
+   MS SQL Server), it returns "Function sequence error" after all records are
+   fetched. I really don't know what it means, and after all
+    - it works with any other driver I tried
+5) referral handling. this bug actually addresses all backends, as I can
+   understand. draft-ietf-ldapext-namedref-xx.txt says that referral should be
+   returned for ANY object containing "ref" attribute. And is_entry_referral
+   macro designed for "referral" objectclass only. This limits usability of
+   referrals too much. For instance, I could want to replicate some subtree on
+   another server, storing just "searchable" attributes + referral to full
+   object, and then use this subtree as kind of index for query routing.
+   If search returns referrals only for "referral" entries - I cannot do such
+   thing
+6) DO NOT EVER USE -O2 option (or any other optimization) under Un*x/gcc!!!
+   I have spent days trying to catch weird bugs, which went gone with optimization off
+7) The same thing that works on RedHat 6.0 (glibc 2.1.1), dumps core on
+   6.1 (glibc 2.1.2) (the same code behaves differently when built on 6.0 and 6.1)
+   my problem was solved by upgrading iODBC to 3.0 beta - but it is kinda strange
+   that beta works better than release (and release still works fine on 6.0)
+9) ldapsearch sometimes refuses to show some attributes ("NOT PRINTABLE" diags)
+   on Win32 (on linux everything's fine -- at least with mySQL)
+   
\ No newline at end of file
diff --git a/servers/slapd/back-sql/docs/concept b/servers/slapd/back-sql/docs/concept
new file mode 100644 (file)
index 0000000..357c0f8
--- /dev/null
@@ -0,0 +1,164 @@
+CONTENT
+1. Purpose
+2. Metainformation used
+3. Typical back-sql operation
+4. Perspectives on back-sql as effective storage backend (not MAPPER)
+
+
+1. Purpose
+Primary purpose of this backend is to PRESENT information stored in some RDBMS
+as an LDAP subtree. It is being designed to be tunable to virtually any
+relational schema without having to change source. It is NOT designed as backend
+that uses RDBMS to store LDAP data (though you can use it for this purpose, it 
+will definitely be not the most effective way). 
+But THIS backend primarily targets the situation when you ALREADY HAVE some
+data in one or more RDBMSes of one or more different vendors on one or more
+different hosts and operating systems, having one or more different
+relational schemas. These could be data used by different software, which you
+want to integrate, or just local parts of bigger information project. Using 
+LDAP standalone server with back-sql as middleware, you can integrate this
+heterogeneous information as a single distributed LDAP tree, and even organize
+data exchange between nodes, not having to worry about unique id's, different
+schemas etc (****see authordn attribute in samples, and dts_ldap utility).
+Or, you could simply want to export some information like ISP database to LDAP,
+to authenticate users, make email lookups or whatever...
+
+2. Metainformation used
+***
+Almost everything mentioned later is illustrated in example, which is located
+in backsql/RDBMS_DEPENDENT directory, and contains scripts for generating sample
+database for Oracle,MS SQL Server and mySQL.
+***
+First thing that one must arrange for himself is what set of objectclasses
+can present your RDBMS information. The easiest way is to create objectclass
+for each entity you had in ER-diagram when designing your relational schema.
+Or you could choose some other way...
+Nevertheless, when you think it out, we must define a way to translate LDAP
+operation requests to (series of) SQL queries. Let us deal with SEARCH 
+operation.
+
+Example:
+Lets suppose that we store information about persons working in our 
+organization in two tables:
+
+PERSONS                PHONES
+----------           -------------
+id integer             id integer
+first_name varchar      pers_id integer references persons(id)
+last_name varchar       phone
+middle_name varchar
+...
+
+(PHONES contains telephone numbers associated with persons). A person can have
+several numbers, then PHONES contains several records with corresponding 
+pers_id, or no numbers (and no records in PHONES with such pers_id). LDAP
+objectclass to present such information could look like this:
+person
+-------
+MUST cn
+MAY telephoneNumber
+MAY firstName
+MAY lastName
+...
+
+To fetch all values for cn attribute given person ID, we construct the query:
+SELECT CONCAT(persons.first_name,' ',persons.last_name) as cn FROM persons WHERE persons.id=?
+
+for telephoneNumber we can use:
+SELECT phones.phone as telephoneNumber FROM persons,phones WHERE persons.id=phones.pers.id and persons.id=?
+
+if we wanted to service LDAP request with filter like (telephoneNumber=123*),
+we would construct something like:
+SELECT ... FROM persons,phones WHERE persons.id=phones.pers.id and persons.id=? and phones.phone like '123%'
+
+So, if we had information about what tables contain values for given each 
+attribute, how to join this tables and arrange these values, we could try
+to automatically generate such statements, and translate search filters
+to SQL clauses
+
+To store such information, we add three more tables to our schema, so that
+ and fill it with data (see samples):
+
+ldap_objclasses
+---------------
+id=1
+name="person"
+keytbl="persons"
+keycol="id"
+create_proc="{call create_person(?)}"
+delete_proc="{call delete_person(?)}"
+
+ldap_attrs
+-----------
+id=1
+oc_id=1
+name="cn"
+sel_expr="CONCAT(persons.first_name,' ',persons.last_name)"
+from_tbls="persons"
+join_where=NULL
+add_proc=...
+delete_proc=...
+************
+id=<n>
+oc_id=1
+name="telephoneNumber"
+expr="phones.phone"
+from_tbls="persons,phones"
+join_where="phones.pers_id=persons.id"
+add_proc=...
+delete_proc=...
+
+
+ldap_entries
+------------
+id=1
+dn=<dn you choose>
+parent=<parent record id>
+keyval=<value of primary key>
+
+First two tables contain structured information about constructing queries like
+those we made in example. The latter (ldap_entries), contains information about
+structure of LDAP tree, referencing actual information by key value. Having 
+objectclass id, we can determine table and column which contain primary keys,
+and load data for the entry attributes using our queries.
+
+3. Typical back-sql operation
+Having metainformation loaded, back-sql uses these tables to determine a set
+of primary keys of candidates (depending on search scope and filter). It tries
+to do it for each objectclass registered in ldap_objclasses.
+Exapmle:
+for our query with filter (telephoneNumber=123*) we would get following
+query (which loads candidate IDs)
+SELECT ldap_entries.id,persons.id, 'person' AS objectClass, ldap_entries.dn AS dn FROM ldap_entries,persons,phones WHERE persons.id=ldap_entries.keyval AND ldap_entries.objclass=? AND ldap_entries.parent=? AND phones.pers_id=persons.id AND (phones.phone LIKE '123%')
+(for ONELEVEL search)
+or "... AND dn=?" (for BASE search)
+or "... AND dn LIKE '%?'" (for SUBTREE)
+
+Then, for each candidate, we load attributes requested using per-attribute queries
+like
+
+SELECT phones.phone AS telephoneNumber FROM persons,phones WHERE persons.id=? AND phones.pers_id=persons.id
+
+Then, we use test_filter() to test entry for full LDAP search filter match (since
+we cannot effectively make sense of SYNTAX of corresponding LDAP schema attribute,
+we translate the filter into most relaxed SQL condition to filter candidates),
+and send it to user.
+
+ADD,DELETE,MODIFY operations also performed on per-attribute metainformation
+(add_proc etc.). In those fields one can specify an SQL statement or stored procedure
+call which can add, or delete given value of given attribute, using given entry
+keyval (see examples -- mostly ORACLE and MSSQL - since there're no stored procs in mySQL).
+
+
+4. Perspectives on back-sql as effective storage backend (not MAPPER)
+Though as I said, back-sql is intended for presenting existing databases to LDAP,
+and as such is not most effective in presenting LDAP data to RDBMS, I have a couple
+of ideas on this point, and going to implement this in back-sql using 
+#ifdefs (one that wants to do RDBMS->LDAP, defines one flag, one that wants
+LDAP->RDBMS, defines another).
+These tasks have much in common (RDBMS access,connection handling etc), but
+latter does not need so much additional metainformation.
+For instance, it may have one table for each attribute type in LDAP schema,
+and use ldap_entries analog to present tree structure... Later this functionality
+will be described more closely...
+
diff --git a/servers/slapd/back-sql/docs/install b/servers/slapd/back-sql/docs/install
new file mode 100644 (file)
index 0000000..f5dab3a
--- /dev/null
@@ -0,0 +1,38 @@
+1. Build
+To build slapd with back-sql under Unix you need to build and install
+iODBC 2.50.3 (later versions should probably work). Then, run 
+"configure <other options you need> --enable-sql",
+this should build back-sql-enabled slapd, provided that you have iODBC 
+libraries and include files in include/library paths.
+
+Under Win32/MSVC++, I modified the workspace so that back-sql is built into
+slapd automatically, since MS odbc32 is included in standard library pack,
+and it does no bad even if you don't plan to use it. I also could provide
+precompiled executables for those who don't have MSVC.
+
+2. Tune datasources and slapd.conf
+Next, you need to define ODBC datasource with data you want to publish
+with help of back-sql. Assuming that you have your data in some SQL-compliant
+RDBMS, and have installed proper ODBC driver for this RDBMS, this is as simple
+as adding a record into odbc.ini (for iODBC), or using ODBC wizard in
+Control Panel (for odbc32). Next, you need to add appropriate "database"
+record to your slapd.conf. See
+sample provided in "back-sql/RDBMS_DEPENDENT/" subdirectory. The only thing
+worth noting about this is that "dbname" directive stands for ODBC datasource
+name, not the name of your database in RDBMS context.
+
+3. Creating and using back-sql metatables
+See SQL scripts and slapd.conf files in sample directory .
+Create db/user whatever for test, execute create.sql, create_testdb.sql,
+test_data.sql,test_metadata.sql from appropriate directory (use 
+"mysql < xxx.sql" for mySQL, Query Analyzer+Open query file for MS SQL,
+sqlplus and "@xxx.sql" for Oracle)
+
+4. Testing
+To diagnose back-sql, run slapd with debug level TRACE ("slapd -d 5" will go).
+Then, use some LDAP client to query corresponding subtree (for test database,
+you could for instance search one level from "o=sql,c=RU"). I personally used
+saucer, which is included in OpenLDAP package (it builds automatically under
+Unix/GNU configure and for MSVC I added appropriate project to workspace).
+And also Java LDAP browser-editor (see link somewhere on OpenLDAP site) to
+test ADD/DELETE/MODIFY operations on Oracle and MS SQL
diff --git a/servers/slapd/back-sql/docs/platforms b/servers/slapd/back-sql/docs/platforms
new file mode 100644 (file)
index 0000000..3c90ae5
--- /dev/null
@@ -0,0 +1,18 @@
+Platforms and configurations it has been tested on (for now I included only
+ configurations I've tested personally):
+
+1) slapd on redhat linux 6.0/6.1 (glibc 2.1.1/2.1.2), built with egcs
+   (versions packaged with appropriate red hat):
+ iODBC 2.50.3 (on 6.0), 3.0beta (on 6.1),
+ mySQL (on same linux) 3.22.25,3.22.30 trough myODBC 2.50.23,
+ MSSQL (on WinNT 4/sp3) 7.0 through OpenLink driver suite 3 (broker on NT),
+ Personal Oracle (on WinNT4/sp3) 8.0.3 through OpenLink driver suite 3 (broker on NT),
+ Oracle (on linux 6.0) 8.0.5 through  OpenLink driver suite 3 (broker on linux)
+2) slapd on WinNT4/sp3, Win98 second edition, Windows2000pre,
+   built with MSVC++ 5,6:
+  ODBC32.DLL shipped with appropriate system,
+  MSSQL (on WinNT4/sp3,Win98,Win2000) 7.0, through its native driver,
+  Personal Oracle (on WinNT4/sp3,Win98) 8.0.3, through its native driver,
+  Oracle 7 (on Solaris/Sparc 2.6) through its native driver
+  
diff --git a/servers/slapd/back-sql/docs/todo b/servers/slapd/back-sql/docs/todo
new file mode 100644 (file)
index 0000000..56073dd
--- /dev/null
@@ -0,0 +1,9 @@
+2) must add alias handling
+3) must set time limit when preparing all queries, and check size limit
+7) MOST important, probably - fix BUGS (see ...)     
+8) make an utility, which, given objectclass,name of attribute for RDN, and
+   base DN, adds appropriate records to ldap_entries for all data in your
+   RDBMS (until then, you have no automated way to fill in ldap_entries except
+   executing something like "insert into ldap_entries (dn,keyval,...) values
+     (select concat(...,<base>) as dn,id as keyval, ... from ...)")
+     
\ No newline at end of file
diff --git a/servers/slapd/back-sql/entry-id.c b/servers/slapd/back-sql/entry-id.c
new file mode 100644 (file)
index 0000000..e75ded3
--- /dev/null
@@ -0,0 +1,186 @@
+/*
+ *      Copyright 1999, Dmitry Kovalev <mit@openldap.org>, All rights reserved.
+ *
+ *      Redistribution and use in source and binary forms are permitted only
+ *      as authorized by the OpenLDAP Public License.  A copy of this
+ *      license is available at http://www.OpenLDAP.org/license.html or
+ *      in file LICENSE in the top-level directory of the distribution.
+ */
+
+#include "portable.h"
+
+#ifdef SLAPD_SQL
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <string.h>
+#include "slap.h"
+#include "back-sql.h"
+#include "sql-wrap.h"
+#include "schema-map.h"
+#include "entry-id.h"
+#include "util.h"
+
+backsql_entryID* backsql_free_entryID(backsql_entryID* id)
+{
+ backsql_entryID* next=id->next;
+ if (id->dn!=NULL)
+  free(id->dn);
+ free(id);
+ return next;
+}
+
+backsql_entryID* backsql_dn2id(backsql_info *bi,backsql_entryID *id,SQLHDBC dbh,char *dn)
+{
+ SQLHSTMT sth; 
+ BACKSQL_ROW_NTS row;
+ //SQLINTEGER nrows=0;
+ RETCODE rc;
+
+ Debug(LDAP_DEBUG_TRACE,"==>backsql_dn2id(): dn='%s'\n",dn,0,0);
+ backsql_Prepare(dbh,&sth,bi->id_query,0);
+ if ((rc=backsql_BindParamStr(sth,1,dn,BACKSQL_MAX_DN_LEN)) != SQL_SUCCESS)
+  {
+   Debug(LDAP_DEBUG_TRACE,"backsql_dn2id(): error binding dn parameter:\n",0,0,0);
+   backsql_PrintErrors(SQL_NULL_HENV,dbh,sth,rc);
+   SQLFreeStmt(sth,SQL_DROP);
+   return NULL;
+  }
+ if ((rc=SQLExecute(sth)) != SQL_SUCCESS)
+  {
+   Debug(LDAP_DEBUG_TRACE,"backsql_dn2id(): error executing query:\n",0,0,0);
+   backsql_PrintErrors(SQL_NULL_HENV,dbh,sth,rc);
+   SQLFreeStmt(sth,SQL_DROP);
+   return NULL;
+  }
+ backsql_BindRowAsStrings(sth,&row);
+ if ((rc=SQLFetch(sth)) == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO)
+  {
+   if (id==NULL)
+    {
+     id=(backsql_entryID*)ch_calloc(1,sizeof(backsql_entryID));
+    }
+   id->id=atoi(row.cols[0]);
+   id->keyval=atoi(row.cols[1]);
+   id->oc_id=atoi(row.cols[2]);
+   id->dn=ch_strdup(dn);
+   id->next=NULL;
+  }
+ else
+  id=NULL;
+ backsql_FreeRow(&row);
+ SQLFreeStmt(sth, SQL_DROP);
+ if (id!=NULL)
+  Debug(LDAP_DEBUG_TRACE,"<==backsql_dn2id(): id=%d\n",(int)id->id,0,0);
+ else
+  Debug(LDAP_DEBUG_TRACE,"<==backsql_dn2id(): no match\n",0,0,0);
+ return id;
+}
+
+
+int backsql_get_attr_vals(backsql_at_map_rec *at,backsql_srch_info *bsi)
+{
+ RETCODE rc;
+ SQLHSTMT sth;
+ BACKSQL_ROW_NTS row;
+ int i;
+ Debug(LDAP_DEBUG_TRACE,"==>backsql_get_attr_vals(): oc='%s' attr='%s' keyval=%d\n",
+                       bsi->oc->name,at->name,bsi->c_eid->keyval);
+
+ if ((rc=backsql_Prepare(bsi->dbh,&sth,at->query,0)) != SQL_SUCCESS)
+  {
+   Debug(LDAP_DEBUG_TRACE,"backsql_get_attr_values(): error preparing query: %s\n",at->query,0,0);
+   backsql_PrintErrors(bsi->bi->db_env,bsi->dbh,sth,rc);
+   return 1;
+  }
+
+ if (backsql_BindParamID(sth,1,&(bsi->c_eid->keyval)) != SQL_SUCCESS)
+ {
+  Debug(LDAP_DEBUG_TRACE,"backsql_get_attr_values(): error binding key value parameter\n",0,0,0);
+  return 1;
+ }
+
+ if ((rc=SQLExecute(sth)) != SQL_SUCCESS && rc!= SQL_SUCCESS_WITH_INFO)
+  {
+   Debug(LDAP_DEBUG_TRACE,"backsql_get_attr_values(): error executing attribute query '%s'\n",at->query,0,0);
+   backsql_PrintErrors(bsi->bi->db_env,bsi->dbh,sth,rc);
+   SQLFreeStmt(sth,SQL_DROP);
+   return 1;
+  }
+
+ backsql_BindRowAsStrings(sth,&row);
+ while ((rc=SQLFetch(sth)) == SQL_SUCCESS || rc==SQL_SUCCESS_WITH_INFO)
+  {
+   for (i=0;i<row.ncols;i++)
+    {
+     if (row.is_null[i]>0)
+      {
+       backsql_entry_addattr(bsi->e,row.col_names[i],row.cols[i],/*row.col_prec[i]*/
+                                       strlen(row.cols[i]));
+//       Debug(LDAP_DEBUG_TRACE,"prec=%d\n",(int)row.col_prec[i],0,0);
+      }
+    // else
+    //  Debug(LDAP_DEBUG_TRACE,"NULL value in this row for attribute '%s'\n",row.col_names[i],0,0);
+    }
+  }
+ backsql_FreeRow(&row);
+ SQLFreeStmt(sth,SQL_DROP);
+ Debug(LDAP_DEBUG_TRACE,"<==backsql_get_attr_vals()\n",0,0,0);
+ return 1;
+}
+
+
+Entry* backsql_id2entry(backsql_srch_info *bsi,Entry* e,backsql_entryID* eid)
+{
+ char **c_at_name;
+ backsql_at_map_rec *at;
+
+ Debug(LDAP_DEBUG_TRACE,"==>backsql_id2entry()\n",0,0,0);
+
+ bsi->oc=backsql_oc_with_id(bsi->bi,eid->oc_id);
+ bsi->e=e;
+ bsi->c_eid=eid;
+ e->e_attrs=NULL;
+ e->e_private=NULL;
+// if (bsi->base_dn != NULL)???
+
+ e->e_id=eid->id;
+ e->e_dn=ch_strdup(bsi->c_eid->dn);
+ e->e_ndn=dn_normalize(ch_strdup(bsi->c_eid->dn));
+ if (bsi->attrs!=NULL)
+ {
+  Debug(LDAP_DEBUG_TRACE,"backsql_id2entry(): custom attribute list\n",0,0,0);
+  for(c_at_name=bsi->attrs;*c_at_name!=NULL;c_at_name++)
+  {
+   if (!strcasecmp(*c_at_name,"objectclass") || !strcasecmp(*c_at_name,"0.10"))
+   {
+       //backsql_entry_addattr(bsi->e,"objectclass",bsi->oc->name,strlen(bsi->oc->name));
+    continue;
+   }
+   at=backsql_at_with_name(bsi->oc,*c_at_name);
+   if (at!=NULL)
+    backsql_get_attr_vals(at,bsi);
+   else
+       Debug(LDAP_DEBUG_TRACE,"backsql_id2entry(): attribute '%s' is not defined for objectlass '%s'\n",
+                       *c_at_name,bsi->oc->name,0);
+
+  }
+ }
+ else
+ {
+  Debug(LDAP_DEBUG_TRACE,"backsql_id2entry(): retrieving all attributes\n",0,0,0);
+  avl_apply(bsi->oc->attrs,(AVL_APPLY)backsql_get_attr_vals,bsi,0,AVL_INORDER);
+ }
+ backsql_entry_addattr(bsi->e,"objectclass",bsi->oc->name,strlen(bsi->oc->name));
+
+ Debug(LDAP_DEBUG_TRACE,"<==backsql_id2entry()\n",0,0,0);
+ return e;
+}
+
+#endif /* SLAPD_SQL */
diff --git a/servers/slapd/back-sql/entry-id.h b/servers/slapd/back-sql/entry-id.h
new file mode 100644 (file)
index 0000000..6ade0e0
--- /dev/null
@@ -0,0 +1,26 @@
+#ifndef __BACKSQL_ENTRYID_H__
+#define __BACKSQL_ENTRYID_H__
+
+/*
+ *      Copyright 1999, Dmitry Kovalev <mit@openldap.org>, All rights reserved.
+ *
+ *      Redistribution and use in source and binary forms are permitted only
+ *      as authorized by the OpenLDAP Public License.  A copy of this
+ *      license is available at http://www.OpenLDAP.org/license.html or
+ *      in file LICENSE in the top-level directory of the distribution.
+ */
+
+
+typedef struct __backsql_entryID
+{
+ unsigned long id;
+ unsigned long keyval;
+ unsigned long oc_id;
+ char *dn;
+ struct __backsql_entryID *next;
+}backsql_entryID;
+
+backsql_entryID* backsql_dn2id(backsql_info *bi,backsql_entryID* id,SQLHDBC dbh,char *dn);
+backsql_entryID* backsql_free_entryID(backsql_entryID* id);//returns next
+
+#endif
\ No newline at end of file
diff --git a/servers/slapd/back-sql/external.h b/servers/slapd/back-sql/external.h
new file mode 100644 (file)
index 0000000..14bac04
--- /dev/null
@@ -0,0 +1,75 @@
+/* $OpenLDAP$ */
+#ifndef _SQL_EXTERNAL_H
+#define _SQL_EXTERNAL_H
+
+/*
+ *      Copyright 1999, Dmitry Kovalev <mit@openldap.org>, All rights reserved.
+ *
+ *      Redistribution and use in source and binary forms are permitted only
+ *      as authorized by the OpenLDAP Public License.  A copy of this
+ *      license is available at http://www.OpenLDAP.org/license.html or
+ *      in file LICENSE in the top-level directory of the distribution.
+ */
+
+
+LDAP_BEGIN_DECL
+
+extern int     sql_back_initialize LDAP_P(( BackendInfo *bi ));
+extern int     backsql_destroy LDAP_P(( BackendInfo *bi ));
+
+extern int     backsql_db_init LDAP_P(( BackendDB *bd ));
+extern int     backsql_db_open LDAP_P(( BackendDB *bd ));
+extern int     backsql_db_close LDAP_P(( BackendDB *bd ));
+extern int     backsql_db_destroy LDAP_P(( BackendDB *bd ));
+
+extern int     backsql_db_config LDAP_P(( BackendDB *bd,
+       const char *fname, int lineno, int argc, char **argv ));
+
+extern int backsql_bind LDAP_P(( BackendDB *bd,
+       Connection *conn, Operation *op,
+       const char *dn, const char *ndn, int method,
+       struct berval *cred, char** edn ));
+
+extern int     backsql_unbind LDAP_P(( BackendDB *bd,
+       Connection *conn, Operation *op ));
+
+extern int     backsql_search LDAP_P(( BackendDB *bd,
+       Connection *conn, Operation *op,
+       const char *base, const char *nbase,
+       int scope, int deref, int sizelimit, int timelimit,
+       Filter *filter, const char *filterstr,
+       char **attrs, int attrsonly ));
+
+extern int     backsql_compare LDAP_P((BackendDB *bd,
+       Connection *conn, Operation *op,
+       const char *dn, const char *ndn,
+       AttributeAssertion *ava ));
+
+extern int     backsql_modify LDAP_P(( BackendDB *bd,
+       Connection *conn, Operation *op,
+       const char *dn, const char *ndn,
+       Modifications *ml ));
+
+extern int     backsql_modrdn LDAP_P(( BackendDB *bd,
+       Connection *conn, Operation *op,
+       const char *dn, const char *ndn,
+       const char *newrdn, int deleteoldrdn,
+       const char *newSuperior ));
+
+extern int     backsql_add LDAP_P(( BackendDB *bd,
+       Connection *conn, Operation *op, Entry *e ));
+
+extern int     backsql_delete LDAP_P(( BackendDB *bd,
+       Connection *conn, Operation *op,
+       const char *dn, const char *ndn ));
+
+extern int     backsql_abandon LDAP_P(( BackendDB *bd,
+       Connection *conn, Operation *op, int msgid ));
+
+extern int     backsql_connection_destroy LDAP_P(( BackendDB *bd,
+       Connection *conn));
+
+LDAP_END_DECL
+
+#endif /* _SQL_EXTERNAL_H */
+
diff --git a/servers/slapd/back-sql/init.c b/servers/slapd/back-sql/init.c
new file mode 100644 (file)
index 0000000..dca5ee5
--- /dev/null
@@ -0,0 +1,223 @@
+/*
+ *      Copyright 1999, Dmitry Kovalev <mit@openldap.org>, All rights reserved.
+ *
+ *      Redistribution and use in source and binary forms are permitted only
+ *      as authorized by the OpenLDAP Public License.  A copy of this
+ *      license is available at http://www.OpenLDAP.org/license.html or
+ *      in file LICENSE in the top-level directory of the distribution.
+ */
+
+#include "portable.h"
+
+#ifdef SLAPD_SQL
+
+#include <stdio.h>
+#include <sys/types.h>
+#include "slap.h"
+#include "back-sql.h"
+#include "sql-wrap.h"
+#include "schema-map.h"
+#include "util.h"
+
+#ifdef SLAPD_SQL_DYNAMIC
+
+int backsql_LTX_init_module(int argc, char *argv[]) {
+    BackendInfo bi;
+
+    memset( &bi, '\0', sizeof(bi) );
+    bi.bi_type = "sql";
+    bi.bi_init = backbacksql_initialize;
+
+    backend_add(&bi);
+    return 0;
+}
+
+#endif /* SLAPD_SHELL_DYNAMIC */
+
+int sql_back_initialize(
+    BackendInfo        *bi
+)
+{ 
+ Debug(LDAP_DEBUG_TRACE,"==>backsql_initialize()\n",0,0,0);
+       bi->bi_open = 0;
+       bi->bi_config = 0;
+       bi->bi_close = 0;
+       bi->bi_destroy = 0;
+
+       bi->bi_db_init = backsql_db_init;
+       bi->bi_db_config = backsql_db_config;
+       bi->bi_db_open = backsql_db_open;
+       bi->bi_db_close = backsql_db_close;
+       bi->bi_db_destroy = backsql_db_destroy;
+
+#ifdef BACKSQL_ALL_DONE
+       bi->bi_op_abandon = backsql_abandon;
+       bi->bi_op_compare = backsql_compare;
+#else
+       bi->bi_op_abandon = 0;
+       bi->bi_op_compare = 0;
+#endif
+       bi->bi_op_bind = backsql_bind;
+       bi->bi_op_unbind = backsql_unbind;
+       bi->bi_op_search = backsql_search;
+       bi->bi_op_modify = backsql_modify;
+       bi->bi_op_modrdn = backsql_modrdn;
+       bi->bi_op_add = backsql_add;
+       bi->bi_op_delete = backsql_delete;
+       
+       bi->bi_acl_group = 0;
+       bi->bi_acl_attribute = 0;
+       bi->bi_chk_referrals = 0;
+       bi->bi_connection_init = 0;
+       bi->bi_connection_destroy = backsql_connection_destroy;
+       
+       Debug(LDAP_DEBUG_TRACE,"<==backsql_initialize()\n",0,0,0);
+       return 0;
+}
+
+
+int backsql_destroy ( BackendInfo *bi )
+{
+ Debug(LDAP_DEBUG_TRACE,"==>backsql_destroy()\n",0,0,0);
+ Debug(LDAP_DEBUG_TRACE,"<==backsql_destroy()\n",0,0,0);
+ return 0;
+}
+
+int backsql_db_init(BackendDB *bd)
+{
+ backsql_info *si;
+ Debug(LDAP_DEBUG_TRACE,"==>backsql_db_init()\n",0,0,0);
+ si = (backsql_info *) ch_calloc( 1, sizeof(backsql_info) );
+ ldap_pvt_thread_mutex_init(&si->dbconn_mutex);
+ ldap_pvt_thread_mutex_init(&si->schema_mutex);
+ backsql_init_db_env(si);
+ bd->be_private=si;
+ Debug(LDAP_DEBUG_TRACE,"<==backsql_db_init()\n",0,0,0);
+ return 0;
+}
+
+int backsql_db_destroy(BackendDB *bd)
+{
+ backsql_info *si=(backsql_info*)bd->be_private;
+ Debug(LDAP_DEBUG_TRACE,"==>backsql_db_destroy()\n",0,0,0);
+ ldap_pvt_thread_mutex_lock(&si->dbconn_mutex);
+ backsql_free_db_env(si);
+ ldap_pvt_thread_mutex_unlock(&si->dbconn_mutex);
+ ldap_pvt_thread_mutex_lock(&si->schema_mutex);
+ backsql_destroy_schema_map(si);
+ ldap_pvt_thread_mutex_unlock(&si->schema_mutex);
+ ldap_pvt_thread_mutex_destroy(&si->schema_mutex);
+ ldap_pvt_thread_mutex_destroy(&si->dbconn_mutex);
+ free(si->dbname);
+ free(si->dbuser);
+ if (si->dbpasswd)
+  free(si->dbpasswd);
+ if (si->dbhost)
+  free(si->dbhost);
+ if (si->upper_func)
+  free(si->upper_func);
+ free(si->subtree_cond);
+ free(si->oc_query);
+ free(si->at_query);
+ free(si->insentry_query);
+ free(si->delentry_query);
+ free(si);
+ Debug(LDAP_DEBUG_TRACE,"<==backsql_db_destroy()\n",0,0,0);
+ return 0;
+}
+
+int backsql_db_open (BackendDB *bd)
+{
+ backsql_info *si=(backsql_info*)bd->be_private;
+ Connection tmp;
+ SQLHDBC dbh;
+ int idq_len;
+
+ Debug(LDAP_DEBUG_TRACE,"==>backsql_db_open(): testing RDBMS connection\n",0,0,0);
+ if (si->dbname==NULL)
+ {
+  Debug(LDAP_DEBUG_TRACE,"backsql_db_open(): datasource name not specified (use dbname directive in slapd.conf)\n",0,0,0);
+  return 1;
+ }
+ if (si->dbuser==NULL)
+ {
+  Debug(LDAP_DEBUG_TRACE,"backsql_db_open(): user name not specified (use dbuser directive in slapd.conf)\n",0,0,0);
+  return 1;
+ }
+ if (si->subtree_cond==NULL)
+ {
+  Debug(LDAP_DEBUG_TRACE,"backsql_db_open(): subtree search SQL condition not specified (use subtree_cond directive in slapd.conf)\n",0,0,0);
+  Debug(LDAP_DEBUG_TRACE,"backsql_db_open(): setting '%s' as default\n",backsql_def_subtree_cond,0,0);
+  si->subtree_cond=ch_strdup(backsql_def_subtree_cond);
+ }
+ if (si->oc_query==NULL)
+ {
+  Debug(LDAP_DEBUG_TRACE,"backsql_db_open(): objectclass mapping SQL statement not specified (use oc_query directive in slapd.conf)\n",0,0,0);
+  Debug(LDAP_DEBUG_TRACE,"backsql_db_open(): setting '%s' by default\n",backsql_def_oc_query,0,0);
+  si->oc_query=ch_strdup(backsql_def_oc_query);
+ }
+ if (si->at_query==NULL)
+ {
+  Debug(LDAP_DEBUG_TRACE,"backsql_db_open(): attribute mapping SQL statement not specified (use at_query directive in slapd.conf)\n",0,0,0);
+  Debug(LDAP_DEBUG_TRACE,"backsql_db_open(): setting '%s' by default\n",backsql_def_at_query,0,0);
+  si->at_query=ch_strdup(backsql_def_at_query);
+ }
+ if (si->insentry_query==NULL)
+ {
+  Debug(LDAP_DEBUG_TRACE,"backsql_db_open(): entry insertion SQL statement not specified (use insentry_query directive in slapd.conf)\n",0,0,0);
+  Debug(LDAP_DEBUG_TRACE,"backsql_db_open(): setting '%s' by default\n",backsql_def_insentry_query,0,0);
+  si->insentry_query=ch_strdup(backsql_def_insentry_query);
+ }
+ if (si->delentry_query==NULL)
+ {
+  Debug(LDAP_DEBUG_TRACE,"backsql_db_open(): entry deletion SQL statement not specified (use delentry_query directive in slapd.conf)\n",0,0,0);
+  Debug(LDAP_DEBUG_TRACE,"backsql_db_open(): setting '%s' by default\n",backsql_def_delentry_query,0,0);
+  si->delentry_query=ch_strdup(backsql_def_delentry_query);
+ }
+ si->id_query=NULL;
+ idq_len=0;
+ if (si->upper_func==NULL)
+ {
+  si->id_query=backsql_strcat(si->id_query,&idq_len,backsql_id_query,"dn=?",NULL);
+ }
+ else
+  {
+   si->id_query=backsql_strcat(si->id_query,&idq_len,backsql_id_query,si->upper_func,"(dn)=",si->upper_func,"(?)",NULL);
+  }
+ tmp.c_connid=-1;
+ dbh=backsql_get_db_conn(bd,&tmp);
+ if (!dbh)
+ {
+  Debug(LDAP_DEBUG_TRACE,"backsql_db_open(): connection failed, exiting\n",0,0,0);
+  return 1;
+ }
+ backsql_free_db_conn(bd,&tmp);
+ if (!si->schema_loaded)
+ {
+  Debug(LDAP_DEBUG_TRACE,"backsql_db_open(): test failed, schema map not loaded - exiting\n",0,0,0);
+  return 1;
+ }
+ Debug(LDAP_DEBUG_TRACE,"<==backsql_db_open(): test succeeded, schema map loaded\n",0,0,0);
+ return 0;
+}
+
+int backsql_db_close(BackendDB *bd)
+{
+ Debug(LDAP_DEBUG_TRACE,"==>backsql_db_close()\n",0,0,0);
+ Debug(LDAP_DEBUG_TRACE,"<==backsql_db_close()\n",0,0,0);
+ return 0;
+}
+
+int backsql_connection_destroy(BackendDB *be,Connection *conn)
+{
+ Debug(LDAP_DEBUG_TRACE,"==>backsql_connection_destroy()\n",0,0,0);
+ backsql_free_db_conn(be,conn);
+ Debug(LDAP_DEBUG_TRACE,"<==backsql_connection_destroy()\n",0,0,0);
+ return 0;
+}
+
+#endif /* SLAPD_SQL */
diff --git a/servers/slapd/back-sql/modify.c b/servers/slapd/back-sql/modify.c
new file mode 100644 (file)
index 0000000..ebaa783
--- /dev/null
@@ -0,0 +1,566 @@
+/*
+ *      Copyright 1999, Dmitry Kovalev <mit@openldap.org>, All rights reserved.
+ *
+ *      Redistribution and use in source and binary forms are permitted only
+ *      as authorized by the OpenLDAP Public License.  A copy of this
+ *      license is available at http://www.OpenLDAP.org/license.html or
+ *      in file LICENSE in the top-level directory of the distribution.
+ */
+
+#include "portable.h"
+
+#ifdef SLAPD_SQL
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <string.h>
+#include "slap.h"
+#include "back-sql.h"
+#include "sql-wrap.h"
+#include "schema-map.h"
+#include "entry-id.h"
+#include "util.h"
+
+int backsql_modify(BackendDB *be,Connection *conn,Operation *op,
+       const char *dn,const char *ndn,Modifications *modlist)
+{
+ backsql_info *bi=(backsql_info*)be->be_private;
+ SQLHDBC dbh;
+ SQLHSTMT sth;
+ RETCODE rc;
+ backsql_oc_map_rec *oc=NULL;
+ backsql_entryID e_id,*res;
+ Modification *c_mod;
+ Modifications *ml;
+ backsql_at_map_rec *at=NULL;
+ struct berval *at_val;
+ int i;
+ int pno,po;//first parameter no, parameter order
+ int prc; //procedure return code
+
+ Debug(LDAP_DEBUG_TRACE,"==>backsql_modify(): changing entry '%s'\n",ndn,0,0);
+ dbh=backsql_get_db_conn(be,conn);
+ if (!dbh)
+ {
+  Debug(LDAP_DEBUG_TRACE,"backsql_modify(): could not get connection handle - exiting\n",0,0,0);
+  send_ldap_result(conn,op,LDAP_OTHER,"","SQL-backend error",NULL,NULL);
+  return 1;
+ }
+ res=backsql_dn2id(bi,&e_id,dbh,(char*)ndn);
+ if (res==NULL)
+ {
+  Debug(LDAP_DEBUG_TRACE,"backsql_modify(): could not lookup entry id\n",0,0,0);
+  send_ldap_result(conn,op,LDAP_NO_SUCH_OBJECT,"",NULL,NULL,NULL);
+  return 1;
+ }
+
+ oc=backsql_oc_with_id(bi,e_id.oc_id);
+ if (oc==NULL)
+ {
+  Debug(LDAP_DEBUG_TRACE,"backsql_modify(): cannot determine objectclass of entry -- aborting\n",0,0,0);
+  send_ldap_result(conn,op,LDAP_OTHER,"","SQL-backend error",NULL,NULL);
+  return 1;
+ }
+
+ SQLAllocStmt(dbh, &sth);
+
+ Debug(LDAP_DEBUG_TRACE,"backsql_modify(): traversing modifications list\n",0,0,0);
+ for(ml=modlist;ml!=NULL;ml=ml->sml_next)
+ {
+  c_mod=&ml->sml_mod;
+  Debug(LDAP_DEBUG_TRACE,"backsql_modify(): attribute '%s'\n",c_mod->sm_desc->ad_cname->bv_val,0,0);
+  at=backsql_at_with_name(oc,c_mod->sm_desc->ad_cname->bv_val);
+  if (at==NULL)
+  {
+   Debug(LDAP_DEBUG_TRACE,"backsql_modify(): attribute provided is not registered in this objectclass ('%s')\n",c_mod->sm_desc->ad_cname->bv_val,0,0);
+   continue;
+  }
+  
+  switch(c_mod->sm_op)
+  {
+   case LDAP_MOD_REPLACE:
+                       {
+                        SQLHSTMT asth;
+                        BACKSQL_ROW_NTS row;
+                        
+                        Debug(LDAP_DEBUG_TRACE,"backsql_modify(): replacing values for attribute '%s'\n",at->name,0,0);
+             if (at->add_proc==NULL)
+                        {
+                         Debug(LDAP_DEBUG_TRACE,"backsql_modify(): add procedure is not defined for this attribute ('%s') - unable to perform replacements\n",at->name,0,0);
+                         break;
+                        }
+del_all:
+                        
+                        if ((rc=backsql_Prepare(dbh,&asth,at->query,0)) != SQL_SUCCESS)
+                        {
+                         Debug(LDAP_DEBUG_TRACE,"backsql_modify(): error preparing query\n",0,0,0);
+                         backsql_PrintErrors(bi->db_env,dbh,asth,rc);
+                         break;
+                        }
+
+                        if (backsql_BindParamID(asth,1,&e_id.keyval) != SQL_SUCCESS)
+                        {
+                         Debug(LDAP_DEBUG_TRACE,"backsql_modify(): error binding key value parameter\n",0,0,0);
+                         backsql_PrintErrors(bi->db_env,dbh,asth,rc);
+                         SQLFreeStmt(asth,SQL_DROP);
+                         break;
+                        }
+
+                        if ((rc=SQLExecute(asth)) != SQL_SUCCESS && rc!= SQL_SUCCESS_WITH_INFO)
+                        {
+                         Debug(LDAP_DEBUG_TRACE,"backsql_modify(): error executing attribute query\n",0,0,0);
+                         backsql_PrintErrors(bi->db_env,dbh,asth,rc);
+                         SQLFreeStmt(asth,SQL_DROP);
+                         break;
+                        }
+
+                        backsql_BindRowAsStrings(asth,&row);
+                        while ((rc=SQLFetch(asth)) == SQL_SUCCESS || rc==SQL_SUCCESS_WITH_INFO)
+                        {
+                         for (i=0;i<row.ncols;i++)
+                         {
+                          if (at->expect_return & BACKSQL_DEL)
+                          {
+                           pno=1;
+                           SQLBindParameter(sth,1,SQL_PARAM_OUTPUT,SQL_C_ULONG,SQL_INTEGER,0,0,&prc,0,0);
+                          }
+                          else
+                           pno=0;
+                          po=(at->param_order & BACKSQL_DEL)>0;
+                          SQLBindParameter(sth,(SQLUSMALLINT)(pno+1+po),SQL_PARAM_INPUT,SQL_C_ULONG,SQL_INTEGER,0,0,&e_id.keyval,0,0);
+                          //check for syntax needed here - maybe need binary bind?
+                          SQLBindParameter(sth,(SQLUSMALLINT)(pno+2-po),SQL_PARAM_INPUT,SQL_C_CHAR,SQL_CHAR,0,0,row.cols[i],strlen(row.cols[i]),0);
+                        
+                          Debug(LDAP_DEBUG_TRACE,"backsql_modify(): executing '%s'\n",at->delete_proc,0,0);
+                          rc=SQLExecDirect(sth,at->delete_proc,SQL_NTS);
+                          if (rc!=SQL_SUCCESS)
+                               {
+                            Debug(LDAP_DEBUG_TRACE,"backsql_modify(): delete_proc execution failed\n",0,0,0);
+                            backsql_PrintErrors(bi->db_env,dbh,sth,rc);
+                               }
+                         }
+                        }
+                        backsql_FreeRow(&row);
+             SQLFreeStmt(asth,SQL_DROP);
+                       }
+                       //PASSTHROUGH - to add new attributes -- do NOT add break
+  case LDAP_MOD_ADD:
+                       if (at->add_proc==NULL)
+                       {
+                        Debug(LDAP_DEBUG_TRACE,"backsql_modify(): add procedure is not defined for this attribute ('%s')\n",at->name,0,0);
+                        break;
+                       }
+                       if (c_mod->sm_bvalues==NULL)
+                       {
+                        Debug(LDAP_DEBUG_TRACE,"backsql_modify(): no values given to add for attribute '%s'\n",at->name,0,0);
+                        break;
+                       }
+                       Debug(LDAP_DEBUG_TRACE,"backsql_modify(): adding new values for attribute '%s'\n",at->name,0,0);
+                       for(i=0,at_val=c_mod->sm_bvalues[0];at_val!=NULL;i++,at_val=c_mod->sm_bvalues[i])
+                       {
+                        if (at->expect_return & BACKSQL_ADD)
+                        {
+                         pno=1;
+                         SQLBindParameter(sth,1,SQL_PARAM_OUTPUT,SQL_C_ULONG,SQL_INTEGER,0,0,&prc,0,0);
+                        }
+                        else
+                         pno=0;
+                        po=(at->param_order & BACKSQL_ADD)>0;
+                        SQLBindParameter(sth,(SQLUSMALLINT)(pno+1+po),SQL_PARAM_INPUT,SQL_C_ULONG,SQL_INTEGER,0,0,&e_id.keyval,0,0);
+                        //check for syntax needed here - maybe need binary bind?
+                        SQLBindParameter(sth,(SQLUSMALLINT)(pno+2-po),SQL_PARAM_INPUT,SQL_C_CHAR,SQL_CHAR,0,0,at_val->bv_val,at_val->bv_len,0);
+                        
+                        Debug(LDAP_DEBUG_TRACE,"backsql_modify(): executing '%s'\n",at->add_proc,0,0);
+                        rc=SQLExecDirect(sth,at->add_proc,SQL_NTS);
+                        if (rc!=SQL_SUCCESS)
+                        {
+                         Debug(LDAP_DEBUG_TRACE,"backsql_modify(): add_proc execution failed\n",0,0,0);
+                         backsql_PrintErrors(bi->db_env,dbh,sth,rc);
+                        }
+                       }
+                       break;
+  case LDAP_MOD_DELETE:
+                       if (at->delete_proc==NULL)
+                       {
+                        Debug(LDAP_DEBUG_TRACE,"backsql_modify(): delete procedure is not defined for this attribute ('%s')\n",at->name,0,0);
+                        break;
+                       }
+                       if (c_mod->sm_bvalues==NULL)
+                       {
+                        Debug(LDAP_DEBUG_TRACE,"backsql_modify(): no values given to delete for attribute '%s' -- deleting all values\n",at->name,0,0);
+                        goto del_all;
+                       }
+            Debug(LDAP_DEBUG_TRACE,"backsql_modify(): deleting values for attribute '%s'\n",at->name,0,0);
+                       for(i=0,at_val=c_mod->sm_bvalues[0];at_val!=NULL;i++,at_val=c_mod->sm_bvalues[i])
+                       {
+                        if (at->expect_return & BACKSQL_DEL)
+                         {
+                          pno=1;
+                          SQLBindParameter(sth,1,SQL_PARAM_OUTPUT,SQL_C_ULONG,SQL_INTEGER,0,0,&prc,0,0);
+                         }
+                        else
+                         pno=0;
+                        po=(at->param_order & BACKSQL_DEL)>0;
+                        SQLBindParameter(sth,(SQLUSMALLINT)(pno+1+po),SQL_PARAM_INPUT,SQL_C_ULONG,SQL_INTEGER,0,0,&e_id.keyval,0,0);
+                        //check for syntax needed here - maybe need binary bind?
+                        SQLBindParameter(sth,(SQLUSMALLINT)(pno+2-po),SQL_PARAM_INPUT,SQL_C_CHAR,SQL_CHAR,0,0,at_val->bv_val,at_val->bv_len,0);
+                          
+                        Debug(LDAP_DEBUG_TRACE,"backsql_modify(): executing '%s'\n",at->delete_proc,0,0);
+                        rc=SQLExecDirect(sth,at->delete_proc,SQL_NTS);
+                        if (rc!=SQL_SUCCESS)
+                        {
+                         Debug(LDAP_DEBUG_TRACE,"backsql_modify(): delete_proc execution failed\n",0,0,0);
+                         backsql_PrintErrors(bi->db_env,dbh,sth,rc);
+                        }
+                       }
+                       break;
+  }
+  SQLFreeStmt(sth,SQL_RESET_PARAMS);
+ }
+
+ SQLFreeStmt(sth,SQL_DROP);
+ send_ldap_result(conn,op,LDAP_SUCCESS,"",NULL,NULL,NULL);
+ Debug(LDAP_DEBUG_TRACE,"<==backsql_modify()\n",0,0,0);
+ return 0;
+}
+
+int backsql_modrdn(BackendDB *be,Connection *conn,Operation *op,
+       const char *dn,const char *ndn,const char *newrdn,int deleteoldrdn,const char *newSuperior)
+{
+ backsql_info *bi=(backsql_info*)be->be_private;
+ SQLHDBC dbh;
+ SQLHSTMT sth;
+ RETCODE rc;
+ backsql_oc_map_rec *oc=NULL;
+ backsql_entryID e_id,pe_id,new_pid,*res;
+ backsql_at_map_rec *at=NULL;
+ char *p_dn=NULL,*new_pdn=NULL, *new_dn;
+ Debug(LDAP_DEBUG_TRACE,"==>backsql_modrdn() renaming entry '%s', newrdn='%s', newSuperior='%s'\n",dn,newrdn,newSuperior);
+ dbh=backsql_get_db_conn(be,conn);
+ if (!dbh)
+ {
+  Debug(LDAP_DEBUG_TRACE,"backsql_modrdn(): could not get connection handle - exiting\n",0,0,0);
+  send_ldap_result(conn,op,LDAP_OTHER,"","SQL-backend error",NULL,NULL);
+  return 1;
+ }
+ res=backsql_dn2id(bi,&e_id,dbh,(char*)ndn);
+ if (res==NULL)
+ {
+  Debug(LDAP_DEBUG_TRACE,"backsql_modrdn(): could not lookup entry id\n",0,0,0);
+  send_ldap_result(conn,op,LDAP_NO_SUCH_OBJECT,"",NULL,NULL,NULL);
+  return 1;
+ }
+ Debug(LDAP_DEBUG_TRACE,"backsql_modrdn(): entry id is %d\n",e_id.id,0,0);
+
+ p_dn=dn_parent(be,ndn);
+
+ if (newSuperior)
+  new_pdn=dn_validate(ch_strdup(newSuperior));
+ else
+   new_pdn=p_dn;
+
+ SQLAllocStmt(dbh, &sth);
+
+ if (newSuperior && !strcasecmp(p_dn,new_pdn))
+ {
+  Debug(LDAP_DEBUG_TRACE,"backsql_modrdn(): newSuperior is equal to old parent - aborting\n",0,0,0);
+  send_ldap_result(conn,op,LDAP_OTHER,"",NULL,NULL,NULL);
+  goto modrdn_return;
+ }
+
+ if (newSuperior && !strcasecmp(ndn,new_pdn))
+ {
+  Debug(LDAP_DEBUG_TRACE,"backsql_modrdn(): newSuperior is equal to entry being moved - aborting\n",0,0,0);
+  send_ldap_result(conn,op,LDAP_OTHER,"",NULL,NULL,NULL);
+  goto modrdn_return;
+ }
+
+ build_new_dn( &new_dn, dn, new_pdn, newrdn ); 
+ if (!dn_validate(new_dn))
+ {
+  Debug(LDAP_DEBUG_TRACE,"backsql_modrdn(): new dn is invalid ('%s') - aborting\n",new_dn,0,0);
+  send_ldap_result(conn,op,LDAP_OTHER,"",NULL,NULL,NULL);
+  goto modrdn_return;
+ }
+ Debug(LDAP_DEBUG_TRACE,"backsql_modrdn(): new entry dn is '%s'\n",new_dn,0,0);
+
+ res=backsql_dn2id(bi,&pe_id,dbh,(char*)p_dn);
+ if (res==NULL)
+ {
+  Debug(LDAP_DEBUG_TRACE,"backsql_modrdn(): could not lookup old parent entry id\n",0,0,0);
+  send_ldap_result(conn,op,LDAP_NO_SUCH_OBJECT,"",NULL,NULL,NULL);
+  goto modrdn_return;
+ }
+ Debug(LDAP_DEBUG_TRACE,"backsql_modrdn(): old parent entry id is %d\n",pe_id.id,0,0);
+
+ res=backsql_dn2id(bi,&new_pid,dbh,(char*)new_pdn);
+ if (res==NULL)
+ {
+  Debug(LDAP_DEBUG_TRACE,"backsql_modrdn(): could not lookup new parent entry id\n",0,0,0);
+  send_ldap_result(conn,op,LDAP_NO_SUCH_OBJECT,"",NULL,NULL,NULL);
+  goto modrdn_return;
+ }
+ Debug(LDAP_DEBUG_TRACE,"backsql_modrdn(): new parent entry id is %d\n",new_pid.id,0,0);
+
+ Debug(LDAP_DEBUG_TRACE,"backsql_modrdn(): executing delentry_query\n",0,0,0);
+ SQLBindParameter(sth,1,SQL_PARAM_INPUT,SQL_C_ULONG,SQL_INTEGER,0,0,&e_id.id,0,0);
+ rc=SQLExecDirect(sth,bi->delentry_query,SQL_NTS);
+ if (rc != SQL_SUCCESS)
+ {
+  Debug(LDAP_DEBUG_TRACE,"backsql_modrdn(): failed to delete record from ldap_entries\n",0,0,0);
+  backsql_PrintErrors(bi->db_env,dbh,sth,rc);
+  send_ldap_result(conn,op,LDAP_OTHER,"","SQL-backend error",NULL,NULL);
+  goto modrdn_return;
+ }
+
+ SQLFreeStmt(sth,SQL_RESET_PARAMS);
+
+ Debug(LDAP_DEBUG_TRACE,"backsql_modrdn(): executing insentry_query\n",0,0,0);
+ backsql_BindParamStr(sth,1,new_dn,BACKSQL_MAX_DN_LEN);
+ SQLBindParameter(sth,2,SQL_PARAM_INPUT,SQL_C_LONG,SQL_INTEGER,0,0,&e_id.oc_id,0,0);
+ SQLBindParameter(sth,3,SQL_PARAM_INPUT,SQL_C_LONG,SQL_INTEGER,0,0,&new_pid.id,0,0);
+ SQLBindParameter(sth,4,SQL_PARAM_INPUT,SQL_C_LONG,SQL_INTEGER,0,0,&e_id.keyval,0,0);
+ rc=SQLExecDirect(sth,bi->insentry_query,SQL_NTS);
+ if (rc != SQL_SUCCESS)
+ {
+  Debug(LDAP_DEBUG_TRACE,"backsql_modrdn(): could not insert ldap_entries record\n",0,0,0);
+  backsql_PrintErrors(bi->db_env,dbh,sth,rc);
+  send_ldap_result(conn,op,LDAP_OTHER,"","SQL-backend error",NULL,NULL);
+  goto modrdn_return;
+ }
+
+ //should process deleteoldrdn here...
+
+ send_ldap_result(conn,op,LDAP_SUCCESS,"",NULL,NULL,NULL);
+modrdn_return:
+ SQLFreeStmt(sth,SQL_DROP);
+ if (p_dn)
+  ch_free(p_dn);
+ if (newSuperior && new_pdn)
+  ch_free(new_pdn);
+ if (new_dn)
+  ch_free(new_dn);
+ Debug(LDAP_DEBUG_TRACE,"<==backsql_modrdn()\n",0,0,0);
+ return 0;
+}
+
+int backsql_add(BackendDB *be,Connection *conn,Operation *op,Entry *e)
+{
+ backsql_info *bi=(backsql_info*)be->be_private;
+ SQLHDBC dbh;
+ SQLHSTMT sth;
+ unsigned long new_keyval;
+ long i;
+ RETCODE rc;
+ backsql_oc_map_rec *oc=NULL;
+ backsql_at_map_rec *at_rec=NULL;
+ backsql_entryID parent_id,*res;
+ Attribute *at;
+ struct berval *at_val;
+ char *pdn;
+ int pno,po;//first parameter no, parameter order
+ int prc; //procedure return code
+
+ Debug(LDAP_DEBUG_TRACE,"==>backsql_add(): adding entry '%s'\n",e->e_dn,0,0);
+ if (dn_validate(e->e_dn)==NULL)
+ {
+  Debug(LDAP_DEBUG_TRACE,"==>backsql_add(): invalid dn '%s' -- aborting\n",e->e_dn,0,0);
+ }
+ for(at=e->e_attrs;at!=NULL;at=at->a_next)
+ {
+  //Debug(LDAP_DEBUG_TRACE,"backsql_add(): scanning entry -- %s\n",at->a_type,0,0);
+  if (!strcasecmp(at->a_desc->ad_cname->bv_val,"objectclass"))
+  {
+   oc=backsql_oc_with_name(bi,at->a_vals[0]->bv_val);
+   break;
+  }
+ }
+
+ if (oc==NULL)
+ {
+  Debug(LDAP_DEBUG_TRACE,"backsql_add(): cannot determine objectclass of entry -- aborting\n",0,0,0);
+  send_ldap_result(conn,op,LDAP_OTHER,"","SQL-backend error",NULL,NULL);
+  return 1;
+ }
+ if (oc->create_proc == NULL)
+ {
+  Debug(LDAP_DEBUG_TRACE,"backsql_add(): create procedure is not defined for this objectclass - aborting\n",0,0,0);
+  send_ldap_result(conn,op,LDAP_OTHER,"","SQL-backend error",NULL,NULL);
+  return 1;
+ }
+
+ dbh=backsql_get_db_conn(be,conn);
+ if (!dbh)
+ {
+  Debug(LDAP_DEBUG_TRACE,"backsql_add(): could not get connection handle - exiting\n",0,0,0);
+  send_ldap_result(conn,op,LDAP_OTHER,"","SQL-backend error",NULL,NULL);
+  return 1;
+ }
+
+ SQLAllocStmt(dbh, &sth);
+ SQLBindParameter(sth,1,SQL_PARAM_OUTPUT,SQL_C_ULONG,SQL_INTEGER,0,0,&new_keyval,0,0);
+
+ Debug(LDAP_DEBUG_TRACE,"backsql_add(): executing '%s'\n",oc->create_proc,0,0);
+ rc=SQLExecDirect(sth,oc->create_proc,SQL_NTS);
+ if (rc != SQL_SUCCESS)
+ {
+  Debug(LDAP_DEBUG_TRACE,"backsql_add(): create_proc execution failed\n",0,0,0);
+  backsql_PrintErrors(bi->db_env,dbh,sth,rc);
+  SQLFreeStmt(sth,SQL_DROP);
+  send_ldap_result(conn,op,LDAP_OTHER,"","SQL-backend error",NULL,NULL);
+  return 1;
+ }
+ SQLFreeStmt(sth,SQL_RESET_PARAMS);
+ Debug(LDAP_DEBUG_TRACE,"backsql_add(): create_proc returned keyval=%d\n",new_keyval,0,0);
+
+ for(at=e->e_attrs;at!=NULL;at=at->a_next)
+ {
+  at_rec=backsql_at_with_name(oc,at->a_desc->ad_cname->bv_val); 
+  
+  if (at_rec==NULL)
+  {
+   Debug(LDAP_DEBUG_TRACE,"backsql_add(): attribute provided is not registered in this objectclass ('%s')\n",at->a_desc->ad_cname->bv_val,0,0);
+   continue;
+  }
+  if (at_rec->add_proc==NULL)
+  {
+   Debug(LDAP_DEBUG_TRACE,"backsql_add(): add procedure is not defined for this attribute ('%s')\n",at->a_desc->ad_cname->bv_val,0,0);
+   continue;
+  }
+  
+  for(i=0,at_val=at->a_vals[0];at_val!=NULL;i++,at_val=at->a_vals[i])
+  {
+       if (at_rec->expect_return & BACKSQL_ADD)
+       {
+        pno=1;
+        SQLBindParameter(sth,1,SQL_PARAM_OUTPUT,SQL_C_ULONG,SQL_INTEGER,0,0,&prc,0,0);
+       }
+       else
+        pno=0;
+       po=(at_rec->param_order & BACKSQL_ADD)>0;
+       SQLBindParameter(sth,(SQLUSMALLINT)(pno+1+po),SQL_PARAM_INPUT,SQL_C_ULONG,SQL_INTEGER,0,0,&new_keyval,0,0);
+       //check for syntax needed here - maybe need binary bind?
+       SQLBindParameter(sth,(SQLUSMALLINT)(pno+2-po),SQL_PARAM_INPUT,SQL_C_CHAR,SQL_CHAR,0,0,at_val->bv_val,at_val->bv_len,0);
+   Debug(LDAP_DEBUG_TRACE,"backsql_add(): executing '%s'\n",at_rec->add_proc,0,0);
+   rc=SQLExecDirect(sth,at_rec->add_proc,SQL_NTS);
+   if (rc!=SQL_SUCCESS)
+   {
+       Debug(LDAP_DEBUG_TRACE,"backsql_add(): add_proc execution failed\n",0,0,0);
+       backsql_PrintErrors(bi->db_env,dbh,sth,rc);
+   }
+  }
+ }
+ SQLFreeStmt(sth,SQL_RESET_PARAMS); 
+ pdn=dn_parent(be,e->e_dn);
+ res=backsql_dn2id(bi,&parent_id,dbh,pdn);
+ if (res==NULL)
+ {
+  Debug(LDAP_DEBUG_TRACE,"backsql_add(): could not lookup parent entry for new record ('%s')\n",
+                                                                                               pdn,0,0);
+  send_ldap_result(conn,op,LDAP_OTHER,"","SQL-backend error",NULL,NULL);
+  return 1;
+ }
+ free(pdn);
+ backsql_BindParamStr(sth,1,e->e_dn,BACKSQL_MAX_DN_LEN);
+ SQLBindParameter(sth,2,SQL_PARAM_INPUT,SQL_C_LONG,SQL_INTEGER,0,0,&oc->id,0,0);
+ SQLBindParameter(sth,3,SQL_PARAM_INPUT,SQL_C_LONG,SQL_INTEGER,0,0,&parent_id.id,0,0);
+ SQLBindParameter(sth,4,SQL_PARAM_INPUT,SQL_C_LONG,SQL_INTEGER,0,0,&new_keyval,0,0);
+ rc=SQLExecDirect(sth,bi->insentry_query,SQL_NTS);
+ if (rc != SQL_SUCCESS)
+ {
+  Debug(LDAP_DEBUG_TRACE,"backsql_add(): could not insert ldap_entries record\n",0,0,0);
+  backsql_PrintErrors(bi->db_env,dbh,sth,rc);
+  //execute delete_proc to delete data added !!!
+  SQLFreeStmt(sth,SQL_DROP);
+  send_ldap_result(conn,op,LDAP_OTHER,"","SQL-backend error",NULL,NULL);
+  return 1;
+ }
+ SQLFreeStmt(sth,SQL_DROP);
+ send_ldap_result(conn,op,LDAP_SUCCESS,"",NULL,NULL,NULL);
+ return 0;
+}
+
+int backsql_delete(BackendDB *be,Connection *conn,Operation *op,
+       const char *dn,const char *ndn)
+{
+ backsql_info *bi=(backsql_info*)be->be_private;
+ SQLHDBC dbh;
+ SQLHSTMT sth;
+ RETCODE rc;
+ backsql_oc_map_rec *oc=NULL;
+ backsql_entryID e_id,*res;
+ int pno;//first parameter no, parameter order
+
+ Debug(LDAP_DEBUG_TRACE,"==>backsql_delete(): deleting entry '%s'\n",ndn,0,0);
+ dbh=backsql_get_db_conn(be,conn);
+ if (!dbh)
+ {
+  Debug(LDAP_DEBUG_TRACE,"backsql_delete(): could not get connection handle - exiting\n",0,0,0);
+  send_ldap_result(conn,op,LDAP_OTHER,"","SQL-backend error",NULL,NULL);
+  return 1;
+ }
+ res=backsql_dn2id(bi,&e_id,dbh,(char*)ndn);
+ if (res==NULL)
+ {
+  Debug(LDAP_DEBUG_TRACE,"backsql_delete(): could not lookup entry id\n",0,0,0);
+  send_ldap_result(conn,op,LDAP_NO_SUCH_OBJECT,"",NULL,NULL,NULL);
+  return 1;
+ }
+
+ oc=backsql_oc_with_id(bi,e_id.oc_id);
+ if (oc==NULL)
+ {
+  Debug(LDAP_DEBUG_TRACE,"backsql_delete(): cannot determine objectclass of entry -- aborting\n",0,0,0);
+  send_ldap_result(conn,op,LDAP_OTHER,"","SQL-backend error",NULL,NULL);
+  return 1;
+ }
+ if (oc->delete_proc == NULL)
+ {
+  Debug(LDAP_DEBUG_TRACE,"backsql_delete(): delete procedure is not defined for this objectclass - aborting\n",0,0,0);
+  send_ldap_result(conn,op,LDAP_OTHER,"","SQL-backend error",NULL,NULL);
+  return 1;
+ }
+
+ SQLAllocStmt(dbh, &sth);
+ if (oc->expect_return)
+ {
+  pno=1;
+  SQLBindParameter(sth,1,SQL_PARAM_OUTPUT,SQL_C_ULONG,SQL_INTEGER,0,0,&rc,0,0);
+ }
+ else
+  pno=0;
+ SQLBindParameter(sth,(SQLUSMALLINT)(pno+1),SQL_PARAM_INPUT,SQL_C_ULONG,SQL_INTEGER,0,0,&e_id.keyval,0,0);
+ //SQLBindParameter(sth,2,SQL_PARAM_OUTPUT,SQL_C_SLONG,SQL_INTEGER,0,0,&retcode,0,0);
+
+ Debug(LDAP_DEBUG_TRACE,"backsql_delete(): executing '%s'\n",oc->delete_proc,0,0);
+ rc=SQLExecDirect(sth,oc->delete_proc,SQL_NTS);
+ if (rc != SQL_SUCCESS)
+ {
+  Debug(LDAP_DEBUG_TRACE,"backsql_delete(): delete_proc execution failed\n",0,0,0);
+  backsql_PrintErrors(bi->db_env,dbh,sth,rc);
+  SQLFreeStmt(sth,SQL_DROP);
+  send_ldap_result(conn,op,LDAP_OTHER,"","SQL-backend error",NULL,NULL);
+  return 1;
+ }
+ SQLFreeStmt(sth,SQL_RESET_PARAMS);
+
+ SQLBindParameter(sth,1,SQL_PARAM_INPUT,SQL_C_ULONG,SQL_INTEGER,0,0,&e_id.id,0,0);
+ rc=SQLExecDirect(sth,bi->delentry_query,SQL_NTS);
+ if (rc != SQL_SUCCESS)
+ {
+  Debug(LDAP_DEBUG_TRACE,"backsql_delete(): failed to delete record from ldap_entries\n",0,0,0);
+  backsql_PrintErrors(bi->db_env,dbh,sth,rc);
+  SQLFreeStmt(sth,SQL_DROP);
+  send_ldap_result(conn,op,LDAP_OTHER,"","SQL-backend error",NULL,NULL);
+  return 1;
+ }
+ SQLFreeStmt(sth,SQL_DROP);
+
+ send_ldap_result(conn,op,LDAP_SUCCESS,"",NULL,NULL,NULL);
+ Debug(LDAP_DEBUG_TRACE,"<==backsql_delete()\n",0,0,0);
+ return 0;
+}
+
+#endif /* SLAPD_SQL */
diff --git a/servers/slapd/back-sql/other.c b/servers/slapd/back-sql/other.c
new file mode 100644 (file)
index 0000000..c89e4d0
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ *      Copyright 1999, Dmitry Kovalev <mit@openldap.org>, All rights reserved.
+ *
+ *      Redistribution and use in source and binary forms are permitted only
+ *      as authorized by the OpenLDAP Public License.  A copy of this
+ *      license is available at http://www.OpenLDAP.org/license.html or
+ *      in file LICENSE in the top-level directory of the distribution.
+ */
+
+#include "portable.h"
+
+#ifdef SLAPD_SQL
+
+#include <stdio.h>
+#include <sys/types.h>
+#include "slap.h"
+#include "back-sql.h"
+#include "sql-wrap.h"
+
+int backsql_dummy()
+{
+ return 0;
+}
+
+int    backsql_compare(BackendDB *bd,
+       Connection *conn, Operation *op,
+       const char *dn, const char *ndn,
+       AttributeAssertion *ava )
+{
+ Debug(LDAP_DEBUG_TRACE,"==>backsql_compare()\n",0,0,0);
+ return 0;
+}
+
+int backsql_abandon( BackendDB *be,
+       Connection *conn, Operation *op, int msgid )
+{
+ Debug(LDAP_DEBUG_TRACE,"==>backsql_abandon()\n",0,0,0);
+ Debug(LDAP_DEBUG_TRACE,"<==backsql_abandon()\n",0,0,0);
+ return 0;
+}
+
+#endif /* SLAPD_SQL */
diff --git a/servers/slapd/back-sql/rdbms_depend/mssql/slapd.conf b/servers/slapd/back-sql/rdbms_depend/mssql/slapd.conf
new file mode 100644 (file)
index 0000000..c3032f2
--- /dev/null
@@ -0,0 +1,30 @@
+# $OpenLDAP$
+#
+# See slapd.conf(5) for details on configuration options.
+# This file should NOT be world readable.
+#
+include                ./schema/core.schema
+include                ./schema/cosine.schema
+include                ./schema/inetorgperson.schema
+
+# Define global ACLs to disable default read access.
+
+# Do not enable referrals until AFTER you have a working directory
+# service AND an understanding of referrals.
+#referral      ldap://root.openldap.org
+
+pidfile                ./slapd.pid
+argsfile       ./slapd.args
+
+#######################################################################
+# sql database definitions
+#######################################################################
+
+database       sql
+suffix         "o=sql,c=RU"
+rootdn         "cn=root,o=sql,c=RU"
+rootpw         secret
+dbname         ldap_mssql
+dbuser         ldap
+dbpasswd       ldap
+subtree_cond   "ldap_entries.dn LIKE '%'+?"
diff --git a/servers/slapd/back-sql/rdbms_depend/mysql/slapd.conf b/servers/slapd/back-sql/rdbms_depend/mysql/slapd.conf
new file mode 100644 (file)
index 0000000..3157628
--- /dev/null
@@ -0,0 +1,31 @@
+# $OpenLDAP$
+#
+# See slapd.conf(5) for details on configuration options.
+# This file should NOT be world readable.
+#
+include                /usr/local/etc/openldap/schema/core.schema
+include                /usr/local/etc/openldap/schema/cosine.schema
+include                /usr/local/etc/openldap/schema/inetorgperson.schema
+
+# Define global ACLs to disable default read access.
+
+# Do not enable referrals until AFTER you have a working directory
+# service AND an understanding of referrals.
+#referral      ldap://root.openldap.org
+
+pidfile                /usr/local/var/slapd.pid
+argsfile       /usr/local/var/slapd.args
+
+#######################################################################
+# sql database definitions
+#######################################################################
+
+database       sql
+suffix         "o=sql,c=RU"
+rootdn         "cn=root,o=sql,c=RU"
+rootpw         secret
+dbname         ldap_mysql
+dbuser         root
+dbpasswd       
+subtree_cond   "ldap_entries.dn LIKE CONCAT('%',?)"
+insentry_query "INSERT INTO ldap_entries (dn,oc_map_id,parent,keyval) VALUES (?,?,?,?)"
diff --git a/servers/slapd/back-sql/rdbms_depend/oracle/slapd.conf b/servers/slapd/back-sql/rdbms_depend/oracle/slapd.conf
new file mode 100644 (file)
index 0000000..e943682
--- /dev/null
@@ -0,0 +1,32 @@
+# $OpenLDAP$
+#
+# See slapd.conf(5) for details on configuration options.
+# This file should NOT be world readable.
+#
+include                /usr/local/etc/openldap/schema/core.schema
+include                /usr/local/etc/openldap/schema/cosine.schema
+include                /usr/local/etc/openldap/schema/inetorgperson.schema
+
+# Define global ACLs to disable default read access.
+
+# Do not enable referrals until AFTER you have a working directory
+# service AND an understanding of referrals.
+#referral      ldap://root.openldap.org
+
+pidfile                /usr/local/var/slapd.pid
+argsfile       /usr/local/var/slapd.args
+
+#######################################################################
+# sql database definitions
+#######################################################################
+
+database       sql
+suffix         "o=sql,c=RU"
+rootdn         "cn=root,o=sql,c=RU"
+rootpw         secret
+dbname         ldap_ora8
+dbuser         ldap
+dbpasswd       ldap
+subtree_cond   "UPPER(ldap_entries.dn) LIKE CONCAT('%',UPPER(?))"
+insentry_query "INSERT INTO ldap_entries (id,dn,oc_map_id,parent,keyval) VALUES (ldap_entry_ids.nextval,?,?,?,?)"
+upper_func     UPPER
diff --git a/servers/slapd/back-sql/schema-map.c b/servers/slapd/back-sql/schema-map.c
new file mode 100644 (file)
index 0000000..ca76a30
--- /dev/null
@@ -0,0 +1,296 @@
+/*
+ *      Copyright 1999, Dmitry Kovalev <mit@openldap.org>, All rights reserved.
+ *
+ *      Redistribution and use in source and binary forms are permitted only
+ *      as authorized by the OpenLDAP Public License.  A copy of this
+ *      license is available at http://www.OpenLDAP.org/license.html or
+ *      in file LICENSE in the top-level directory of the distribution.
+ */
+
+#include "portable.h"
+
+#ifdef SLAPD_SQL
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <string.h>
+#include "slap.h"
+#include "back-sql.h"
+#include "sql-wrap.h"
+#include "schema-map.h"
+#include "util.h"
+
+int backsql_dummy(void *,void *);
+
+int backsql_cmp_oc_name(backsql_oc_map_rec *m1,backsql_oc_map_rec *m2)
+{
+ return strcasecmp(m1->name,m2->name);
+}
+
+int backsql_cmp_oc_id(backsql_oc_map_rec *m1,backsql_oc_map_rec *m2)
+{
+ if (m1->id < m2->id)
+  return -1;
+ if (m1->id > m2->id)
+  return 1;
+ return 0;
+}
+
+int backsql_cmp_attr(backsql_at_map_rec *m1,backsql_at_map_rec *m2)
+{
+ return strcasecmp(m1->name,m2->name);
+}
+
+char* backsql_make_attr_query(backsql_oc_map_rec *oc_map,backsql_at_map_rec *at_map)
+{
+ char *tmps;
+ int tmpslen;
+
+ tmps=NULL;tmpslen=0;
+ tmps=backsql_strcat(tmps,&tmpslen,"SELECT ",at_map->sel_expr," AS ",at_map->name,
+                       " FROM ",at_map->from_tbls,
+                       " WHERE ",oc_map->keytbl,".",oc_map->keycol,"=?",NULL);
+ if (at_map->join_where!=NULL && at_map->join_where[0]!='\0')
+  tmps=backsql_strcat(tmps,&tmpslen," AND ",at_map->join_where,NULL);
+ at_map->query=ch_strdup(tmps);
+ ch_free(tmps);
+ return at_map->query;
+}
+
+
+int backsql_add_sysmaps(backsql_oc_map_rec *oc_map)
+{
+ backsql_at_map_rec *at_map;
+ int len;
+ char s[30]; 
+
+ sprintf(s,"%d",oc_map->id);
+ at_map=(backsql_at_map_rec*)ch_calloc(1,sizeof(backsql_at_map_rec));
+ at_map->name=ch_strdup("objectClass");
+ at_map->sel_expr=ch_strdup("ldap_entry_objclasses.oc_name");
+ at_map->from_tbls=ch_strdup("ldap_entry_objclasses,ldap_entries");
+ len=strlen(at_map->from_tbls);
+ backsql_merge_from_clause(&at_map->from_tbls,&len,oc_map->keytbl);
+ at_map->join_where=NULL; len=0;
+ at_map->join_where=backsql_strcat(at_map->join_where,&len,
+                       "ldap_entries.id=ldap_entry_objclasses.entry_id and ldap_entries.keyval=",
+                       oc_map->keytbl,".",oc_map->keycol," and ldap_entries.oc_map_id=",s,NULL);
+ at_map->add_proc=NULL;
+ at_map->delete_proc=NULL;
+ at_map->param_order=0;
+ at_map->expect_return=0;
+ backsql_make_attr_query(oc_map,at_map);
+ avl_insert(&oc_map->attrs,at_map,(AVL_CMP)backsql_cmp_attr,backsql_dummy);
+
+ at_map=(backsql_at_map_rec*)ch_calloc(1,sizeof(backsql_at_map_rec));
+ at_map->name=ch_strdup("ref");
+ at_map->sel_expr=ch_strdup("ldap_referrals.url");
+ at_map->from_tbls=ch_strdup("ldap_referrals,ldap_entries");
+ len=strlen(at_map->from_tbls);
+ backsql_merge_from_clause(&at_map->from_tbls,&len,oc_map->keytbl);
+ at_map->join_where=NULL; len=0;
+ at_map->join_where=backsql_strcat(at_map->join_where,&len,
+                       "ldap_entries.id=ldap_referrals.entry_id and ldap_entries.keyval=",
+                       oc_map->keytbl,".",oc_map->keycol," and ldap_entries.oc_map_id=",s,NULL);
+ at_map->add_proc=NULL;
+ at_map->delete_proc=NULL;
+ at_map->param_order=0;
+ at_map->expect_return=0;
+ backsql_make_attr_query(oc_map,at_map);
+ avl_insert(&oc_map->attrs,at_map,(AVL_CMP)backsql_cmp_attr,backsql_dummy);
+
+ return 1;
+}
+
+int backsql_load_schema_map(backsql_info *si,SQLHDBC dbh)
+{
+ SQLHSTMT oc_sth,at_sth;
+ RETCODE rc;
+ BACKSQL_ROW_NTS oc_row,at_row;
+ unsigned long oc_id;
+ backsql_oc_map_rec *oc_map;
+ backsql_at_map_rec *at_map;
+ char *tmps;
+ int tmpslen;
+
+ Debug(LDAP_DEBUG_TRACE,"==>load_schema_map()\n",0,0,0);
+ rc=backsql_Prepare(dbh,&oc_sth,si->oc_query,0);
+ if (rc != SQL_SUCCESS)
+  {
+   Debug(LDAP_DEBUG_TRACE,"load_schema_map(): error preparing oc_query: '%s'\n",si->oc_query,0,0);
+   backsql_PrintErrors(si->db_env,dbh,oc_sth,rc);
+   return -1;
+  }
+ rc=backsql_Prepare(dbh,&at_sth,si->at_query,0);
+ if (rc != SQL_SUCCESS)
+  {
+   Debug(LDAP_DEBUG_TRACE,"load_schema_map(): error preparing at_query: '%s'\n",si->at_query,0,0);
+   backsql_PrintErrors(si->db_env,dbh,at_sth,rc);
+   return -1;
+  }
+ if ((rc=backsql_BindParamID(at_sth,1,&oc_id)) != SQL_SUCCESS)
+  {
+   Debug(LDAP_DEBUG_TRACE,"load_schema_map(): error binding param for at_query: \n",0,0,0);
+   backsql_PrintErrors(si->db_env,dbh,at_sth,rc);
+   return -1;
+  }
+ if ((rc=SQLExecute(oc_sth)) != SQL_SUCCESS)
+  {
+   Debug(LDAP_DEBUG_TRACE,"load_schema_map(): error executing oc_query: \n",0,0,0);
+   backsql_PrintErrors(si->db_env,dbh,oc_sth,rc);
+   return -1;
+  }
+ backsql_BindRowAsStrings(oc_sth,&oc_row);
+ while ((rc=SQLFetch(oc_sth)) == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO)
+  {
+   oc_map=(backsql_oc_map_rec*)ch_calloc(1,sizeof(backsql_oc_map_rec));
+   oc_map->id=atoi(oc_row.cols[0]);
+   oc_map->name=ch_strdup(oc_row.cols[1]);
+   oc_map->keytbl=ch_strdup(oc_row.cols[2]);
+   oc_map->keycol=ch_strdup(oc_row.cols[3]);
+   oc_map->create_proc=(oc_row.is_null[4]<0)?NULL:ch_strdup(oc_row.cols[4]);
+   oc_map->delete_proc=(oc_row.is_null[5]<0)?NULL:ch_strdup(oc_row.cols[5]);
+   oc_map->expect_return=atoi(oc_row.cols[6]);
+
+   oc_map->attrs=NULL;
+   avl_insert(&si->oc_by_name,oc_map,(AVL_CMP)backsql_cmp_oc_name,backsql_dummy);
+   avl_insert(&si->oc_by_id,oc_map,(AVL_CMP)backsql_cmp_oc_id,backsql_dummy);
+   oc_id=oc_map->id;
+   Debug(LDAP_DEBUG_TRACE,"load_schema_map(): objectclass '%s': keytbl='%s' keycol='%s' ",
+          oc_map->name,oc_map->keytbl,oc_map->keycol);
+   Debug(LDAP_DEBUG_TRACE,"create_proc='%s' delete_proc='%s' expect_return=%d; attributes:\n",
+       oc_map->create_proc,oc_map->delete_proc,oc_map->expect_return);
+   Debug(LDAP_DEBUG_TRACE,"load_schema_map(): autoadding 'objectClass' and 'ref' mappings\n",0,0,0);
+   backsql_add_sysmaps(oc_map);
+   if ((rc=SQLExecute(at_sth)) != SQL_SUCCESS)
+    {
+     Debug(LDAP_DEBUG_TRACE,"load_schema_map(): error executing at_query: \n",0,0,0);
+     backsql_PrintErrors(SQL_NULL_HENV,dbh,at_sth,rc);
+     return -1;
+    }
+   backsql_BindRowAsStrings(at_sth,&at_row);
+   while ((rc=SQLFetch(at_sth)) == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO)
+    {
+     Debug(LDAP_DEBUG_TRACE,"********'%s'\n",at_row.cols[0],0,0);
+     Debug(LDAP_DEBUG_TRACE,"name='%s',sel_expr='%s' from='%s' ",at_row.cols[0],
+             at_row.cols[1],at_row.cols[2]);
+        Debug(LDAP_DEBUG_TRACE,"join_where='%s',add_proc='%s' ",at_row.cols[3],
+             at_row.cols[4],0);
+        Debug(LDAP_DEBUG_TRACE,"delete_proc='%s'\n",at_row.cols[5],0,0);
+     at_map=(backsql_at_map_rec*)ch_calloc(1,sizeof(backsql_at_map_rec));
+     at_map->name=ch_strdup(at_row.cols[0]);
+     at_map->sel_expr=ch_strdup(at_row.cols[1]);
+        tmps=NULL;tmpslen=0;
+        backsql_merge_from_clause(&tmps,&tmpslen,at_row.cols[2]);
+     at_map->from_tbls=ch_strdup(tmps);
+        ch_free(tmps);
+        at_map->join_where=ch_strdup((at_row.is_null[3]<0)?"":at_row.cols[3]);
+        at_map->add_proc=(at_row.is_null[4]<0)?NULL:ch_strdup(at_row.cols[4]);
+        at_map->delete_proc=(at_row.is_null[5]<0)?NULL:ch_strdup(at_row.cols[5]);
+        at_map->param_order=atoi(at_row.cols[6]);
+        at_map->expect_return=atoi(at_row.cols[7]);
+        backsql_make_attr_query(oc_map,at_map);
+        Debug(LDAP_DEBUG_TRACE,"load_schema_map(): preconstructed query '%s'\n",at_map->query,0,0);
+     avl_insert(&oc_map->attrs,at_map,(AVL_CMP)backsql_cmp_attr,backsql_dummy);
+    }
+   backsql_FreeRow(&at_row);
+   SQLFreeStmt(at_sth,SQL_CLOSE);
+  }
+ backsql_FreeRow(&oc_row);
+ SQLFreeStmt(at_sth,SQL_DROP);
+ SQLFreeStmt(oc_sth,SQL_DROP);
+ si->schema_loaded=1;
+ Debug(LDAP_DEBUG_TRACE,"<==load_schema_map()\n",0,0,0);
+ return 1;
+}
+
+backsql_oc_map_rec* backsql_oc_with_name(backsql_info *si,char* objclass)
+{
+ backsql_oc_map_rec tmp,*res;
+// Debug(LDAP_DEBUG_TRACE,"==>oc_with_name(): searching for objectclass with name='%s'\n",objclass,0,0);
+ tmp.name=objclass;
+ res=(backsql_oc_map_rec*)avl_find(si->oc_by_name,&tmp,(AVL_CMP)backsql_cmp_oc_name);
+// if (res!=NULL)
+//  Debug(LDAP_DEBUG_TRACE,"<==oc_with_name(): found name='%s', id=%d\n",res->name,res->id,0);
+// else
+//  Debug(LDAP_DEBUG_TRACE,"<==oc_with_name(): not found\n",0,0,0);
+ return res;
+}
+
+backsql_oc_map_rec* backsql_oc_with_id(backsql_info *si,unsigned long id)
+{
+ backsql_oc_map_rec tmp,*res;
+// Debug(LDAP_DEBUG_TRACE,"==>oc_with_id(): searching for objectclass with id='%d'\n",id,0,0);
+ tmp.id=id;
+ res=(backsql_oc_map_rec*)avl_find(si->oc_by_id,&tmp,(AVL_CMP)backsql_cmp_oc_id);
+// if (res!=NULL)
+//  Debug(LDAP_DEBUG_TRACE,"<==oc_with_name(): found name='%s', id=%d\n",res->name,res->id,0);
+// else
+//  Debug(LDAP_DEBUG_TRACE,"<==oc_with_name(): not found\n",0,0,0);
+ return res;
+}
+
+backsql_at_map_rec* backsql_at_with_name(backsql_oc_map_rec* objclass,char* attr)
+{
+ backsql_at_map_rec tmp,*res;
+ //Debug(LDAP_DEBUG_TRACE,"==>at_with_name(): searching for attribute with name='%s' (for objectclass '%s')\n",
+ //                attr,objclass->name,0);
+ tmp.name=attr;
+ res=(backsql_at_map_rec*)avl_find(objclass->attrs,&tmp,(AVL_CMP)backsql_cmp_attr);
+ //if (res!=NULL)
+  //Debug(LDAP_DEBUG_TRACE,"<==at_with_name(): found name='%s', sel_expr='%s'\n",
+  //            res->name,res->sel_expr,0);
+ //else
+ // Debug(LDAP_DEBUG_TRACE,"<==at_with_name(): not found\n",0,0,0);
+ return res;
+}
+
+int backsql_free_attr(backsql_at_map_rec *at)
+{
+ Debug(LDAP_DEBUG_TRACE,"==>free_attr(): '%s'\n",at->name,0,0);
+ ch_free(at->name);
+ ch_free(at->sel_expr);
+ if (at->from_tbls!=NULL)
+  ch_free(at->from_tbls);
+ if (at->join_where!=NULL)
+  ch_free(at->join_where);
+ if (at->add_proc!=NULL)
+  ch_free(at->add_proc);
+ if (at->delete_proc!=NULL)
+  ch_free(at->delete_proc);
+ if (at->query)
+  ch_free(at->query);
+ ch_free(at);
+ Debug(LDAP_DEBUG_TRACE,"<==free_attr()\n",0,0,0);
+ return 1;
+}
+
+int backsql_free_oc(backsql_oc_map_rec *oc)
+{
+ Debug(LDAP_DEBUG_TRACE,"==>free_oc(): '%s'\n",oc->name,0,0);
+ avl_free(oc->attrs,(AVL_FREE)backsql_free_attr);
+ ch_free(oc->name);
+ ch_free(oc->keytbl);
+ ch_free(oc->keycol);
+ if (oc->create_proc!=NULL)
+  ch_free(oc->create_proc);
+ if (oc->delete_proc!=NULL)
+  ch_free(oc->delete_proc);
+ ch_free(oc);
+ Debug(LDAP_DEBUG_TRACE,"<==free_oc()\n",0,0,0);
+ return 1;
+}
+
+int backsql_destroy_schema_map(backsql_info *si)
+{
+ Debug(LDAP_DEBUG_TRACE,"==>destroy_schema_map()\n",0,0,0);
+ avl_free(si->oc_by_id,(AVL_FREE)backsql_free_oc);
+ avl_free(si->oc_by_name,(AVL_FREE)backsql_dummy);
+ Debug(LDAP_DEBUG_TRACE,"<==destroy_schema_map()\n",0,0,0);
+ return 0;
+}
+
+#endif /* SLAPD_SQL */
diff --git a/servers/slapd/back-sql/schema-map.h b/servers/slapd/back-sql/schema-map.h
new file mode 100644 (file)
index 0000000..6e48c36
--- /dev/null
@@ -0,0 +1,50 @@
+#ifndef __BACKSQL_SCHEMA_MAP_H__
+#define __BACKSQL_SCHEMA_MAP_H__
+
+/*
+ *      Copyright 1999, Dmitry Kovalev <mit@openldap.org>, All rights reserved.
+ *
+ *      Redistribution and use in source and binary forms are permitted only
+ *      as authorized by the OpenLDAP Public License.  A copy of this
+ *      license is available at http://www.OpenLDAP.org/license.html or
+ *      in file LICENSE in the top-level directory of the distribution.
+ */
+
+
+typedef struct
+{
+ char *name;
+ char *keytbl;
+ char *keycol;
+ char *create_proc;//expected to return keyval of newly created entry
+ char *delete_proc;//supposed to expect keyval as parameter and delete all the attributes as well
+ int expect_return; //flags whether delete_proc is a function (whether back-sql should bind first parameter as output for return code)
+ unsigned long id;
+ Avlnode *attrs;
+}backsql_oc_map_rec;
+
+typedef struct
+{
+ char *name;//literal name of corresponding LDAP attribute type
+ char *from_tbls;
+ char *join_where;
+ char *sel_expr;
+ char *add_proc; //supposed to expect 2 binded values: entry keyval and attr. value to add, like "add_name(?,?,?)"
+ char *delete_proc; //supposed to expect 2 binded values: entry keyval and attr. value to delete
+ char *query; //for optimization purposes attribute load query is preconstructed from parts on schemamap load time
+ //following flags are bitmasks (first bit used for add_proc, second - for modify, third - for delete_proc)
+ int param_order; //order of parameters for procedures above; 1 means "data then keyval", 0 means "keyval then data"
+ int expect_return; //flags whether one or more of procedures is a function (whether back-sql should bind first parameter as output for return code)
+}backsql_at_map_rec;
+
+//defines to support bitmasks above
+#define BACKSQL_ADD    1
+#define BACKSQL_DEL    2
+
+int backsql_load_schema_map(backsql_info *si,SQLHDBC dbh);
+backsql_oc_map_rec* backsql_oc_with_name(backsql_info *si,char* objclass);
+backsql_oc_map_rec* backsql_oc_with_id(backsql_info *si,unsigned long id);
+backsql_at_map_rec* backsql_at_with_name(backsql_oc_map_rec* objclass,char* attr);
+int backsql_destroy_schema_map(backsql_info *si);
+
+#endif
\ No newline at end of file
diff --git a/servers/slapd/back-sql/search.c b/servers/slapd/back-sql/search.c
new file mode 100644 (file)
index 0000000..e8b2d58
--- /dev/null
@@ -0,0 +1,549 @@
+/*
+ *      Copyright 1999, Dmitry Kovalev <mit@openldap.org>, All rights reserved.
+ *
+ *      Redistribution and use in source and binary forms are permitted only
+ *      as authorized by the OpenLDAP Public License.  A copy of this
+ *      license is available at http://www.OpenLDAP.org/license.html or
+ *      in file LICENSE in the top-level directory of the distribution.
+ */
+
+#include "portable.h"
+
+#ifdef SLAPD_SQL
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <string.h>
+#include "slap.h"
+#include "back-sql.h"
+#include "sql-wrap.h"
+#include "schema-map.h"
+#include "entry-id.h"
+#include "util.h"
+
+int backsql_attrlist_add(backsql_srch_info *bsi,char *at_name)
+{
+ char **p=bsi->attrs;
+ int n_attrs=0;
+
+ if (bsi->attrs==NULL)
+  return 1;
+
+ while(*p)
+ {
+  Debug(LDAP_DEBUG_TRACE,"==>backsql_attrlist_add(): attribute '%s' is in list\n",*p,0,0);
+  if (!strcasecmp(*p,at_name))
+   return 1;
+  n_attrs++;
+  p++;
+ }
+ Debug(LDAP_DEBUG_TRACE,"==>backsql_attrlist_add(): adding '%s' to list\n",at_name,0,0);
+ bsi->attrs=(char**)ch_realloc(bsi->attrs,(n_attrs+2)*sizeof(char*));
+ bsi->attrs[n_attrs]=ch_strdup(at_name);
+ bsi->attrs[n_attrs+1]=NULL;
+ return 1;
+}
+
+void backsql_init_search(backsql_srch_info *bsi,backsql_info *bi,char *nbase,int scope,
+                                                int slimit,int tlimit,time_t stoptime,Filter *filter,
+                                                SQLHDBC dbh,BackendDB *be,Connection *conn,Operation *op,char **attrs)
+{
+ char **p;
+ bsi->base_dn=nbase;
+ bsi->scope=scope;
+ bsi->slimit=slimit;
+ bsi->tlimit=tlimit;
+ bsi->filter=filter;
+ bsi->dbh=dbh;
+ bsi->be=be;
+ bsi->conn=conn;
+ bsi->op=op;
+ if (attrs!=NULL)
+ {
+  bsi->attrs=(char**)ch_calloc(1,sizeof(char*));
+  bsi->attrs[0]=NULL;
+  for(p=attrs;*p!=NULL;p++)
+   backsql_attrlist_add(bsi,*p);
+ }
+ else
+  bsi->attrs=attrs;
+ bsi->abandon=0;
+ bsi->id_list=NULL;
+ bsi->stoptime=stoptime;
+ bsi->bi=bi;
+ bsi->sel=NULL; bsi->from=NULL; bsi->join_where=NULL; bsi->flt_where=NULL;
+ bsi->sel_len=0; bsi->from_len=0; bsi->jwhere_len=0; bsi->fwhere_len=0;
+}
+
+int backsql_process_filter_list(backsql_srch_info *bsi,Filter *f,int op)
+{
+ char *sub_clause=NULL;
+ int len=0,res;
+
+ if (!f)
+  return 0;
+ bsi->flt_where=backsql_strcat(bsi->flt_where,&bsi->fwhere_len,"(",NULL);
+ while(1)
+ {
+  res=backsql_process_filter(bsi,f);
+  
+  f=f->f_next;
+  if (f==NULL)
+   break;
+
+  switch (op)
+  {
+   case LDAP_FILTER_AND:
+                       bsi->flt_where=backsql_strcat(bsi->flt_where,&bsi->fwhere_len," AND ",NULL);
+                       break;
+   case LDAP_FILTER_OR:
+                       bsi->flt_where=backsql_strcat(bsi->flt_where,&bsi->fwhere_len," OR ",NULL);
+                       break;
+  }
+ }
+
+ bsi->flt_where=backsql_strcat(bsi->flt_where,&bsi->fwhere_len,")",NULL);
+ return 1;
+}
+
+int backsql_process_sub_filter(backsql_srch_info *bsi,Filter *f)
+{
+ int i;
+ backsql_at_map_rec *at=backsql_at_with_name(bsi->oc,f->f_sub_desc->ad_cname->bv_val);
+ if (!f)
+  return 0;
+
+ bsi->flt_where=backsql_strcat(bsi->flt_where,&bsi->fwhere_len,"(",NULL);
+
+ if (bsi->bi->upper_func)
+ {
+  bsi->flt_where=backsql_strcat(bsi->flt_where,&bsi->fwhere_len,
+         bsi->bi->upper_func,"(",at->sel_expr,")",
+                               " LIKE '",NULL);
+ }
+ else
+ {
+  bsi->flt_where=backsql_strcat(bsi->flt_where,&bsi->fwhere_len,at->sel_expr,
+                               " LIKE '",NULL);
+ }
+ if (f->f_sub_initial!=NULL)
+ {
+  bsi->flt_where=backsql_strcat(bsi->flt_where,&bsi->fwhere_len,f->f_sub_initial->bv_val,NULL);
+ }
+
+ bsi->flt_where=backsql_strcat(bsi->flt_where,&bsi->fwhere_len,"%",NULL);
+
+ if (f->f_sub_any!=NULL)
+  for(i=0;f->f_sub_any[i]!=NULL;i++)
+  {
+   //Debug(LDAP_DEBUG_TRACE,"==>backsql_process_sub_filter(): sub_any='%s'\n",f->f_sub_any[i]->bv_val,0,0);
+   bsi->flt_where=backsql_strcat(bsi->flt_where,&bsi->fwhere_len,f->f_sub_any[i]->bv_val,"%",NULL);
+  }
+
+ if (f->f_sub_final!=NULL)
+  bsi->flt_where=backsql_strcat(bsi->flt_where,&bsi->fwhere_len,f->f_sub_final->bv_val,NULL);
+
+ bsi->flt_where=backsql_strcat(bsi->flt_where,&bsi->fwhere_len,"')",NULL);
+ return 1;
+}
+
+int backsql_process_filter(backsql_srch_info *bsi,Filter *f)
+{
+ backsql_at_map_rec *at;
+ backsql_at_map_rec oc_attr={"objectClass","","",NULL,NULL,NULL,NULL};
+ char *at_name=NULL;
+ int done=0,len=0;
+
+ Debug(LDAP_DEBUG_TRACE,"==>backsql_process_filter()\n",0,0,0);
+ if (f==NULL)
+  {
+   return 0;
+  }
+  
+ switch(f->f_choice)
+ {
+  case LDAP_FILTER_OR:
+                       backsql_process_filter_list(bsi,f->f_or,LDAP_FILTER_OR);
+                       done=1;
+                       break;
+  case LDAP_FILTER_AND:
+                       backsql_process_filter_list(bsi,f->f_and,LDAP_FILTER_AND);
+                       done=1;
+                       break;
+  case LDAP_FILTER_NOT:
+                       bsi->flt_where=backsql_strcat(bsi->flt_where,&bsi->fwhere_len,"NOT (",NULL);
+                       backsql_process_filter(bsi,f->f_not);
+                       bsi->flt_where=backsql_strcat(bsi->flt_where,&bsi->fwhere_len,")",NULL);
+                       done=1;
+                       break;
+  case LDAP_FILTER_PRESENT:
+                       at_name=f->f_desc->ad_cname->bv_val;
+                       break;
+  default:
+                        at_name=f->f_av_desc->ad_cname->bv_val;
+                       break;
+ }
+ if (done)
+  goto done;
+
+ if (strcasecmp(at_name,"objectclass"))
+  at=backsql_at_with_name(bsi->oc,at_name);
+ else
+ {
+  at=&oc_attr;
+  at->sel_expr=backsql_strcat(at->sel_expr,&len,"'",bsi->oc->name,"'",NULL);
+ }
+ if (at==NULL)
+ {
+  Debug(LDAP_DEBUG_TRACE,"backsql_process_filter(): attribute '%s' is not defined for objectclass '%s'\n",
+                      at_name,bsi->oc->name,0);
+  bsi->flt_where=backsql_strcat(bsi->flt_where,&bsi->fwhere_len," 1=0 ",NULL);
+  return -1;
+ }
+                       
+ backsql_merge_from_clause(&bsi->from,&bsi->from_len,at->from_tbls);
+ //need to add this attribute to list of attrs to load, so that we could do test_filter() later
+ backsql_attrlist_add(bsi,at_name);
+
+ if (at->join_where != NULL && strstr(bsi->join_where,at->join_where)==NULL)
+  bsi->join_where=backsql_strcat(bsi->join_where,&bsi->jwhere_len," AND ",at->join_where,NULL);
+
+ //if (at!=&oc_attr)
+ // bsi->sel=backsql_strcat(bsi->sel,&bsi->sel_len,",",at->sel_expr," AS ",at->name,NULL);
+
+ switch(f->f_choice)
+ {
+  case LDAP_FILTER_EQUALITY:
+                       //maybe we should check type of at->sel_expr here somehow,
+                       //to know whether upper_func is applicable, but for now
+                       //upper_func stuff is made for Oracle, where UPPER is
+                       //safely applicable to NUMBER etc.
+                       if (bsi->bi->upper_func)
+                       bsi->flt_where=backsql_strcat(bsi->flt_where,&bsi->fwhere_len,"(",
+                                       bsi->bi->upper_func,"(",at->sel_expr,")='",
+                                               f->f_av_value->bv_val,"')",NULL);
+                       else
+                        bsi->flt_where=backsql_strcat(bsi->flt_where,&bsi->fwhere_len,"(",at->sel_expr,"='",
+                                                       f->f_av_value->bv_val,"')",NULL);
+
+                       break;
+  case LDAP_FILTER_GE:
+                       bsi->flt_where=backsql_strcat(bsi->flt_where,&bsi->fwhere_len,"(",at->sel_expr,">=",
+                                                       f->f_av_value->bv_val,")",NULL);
+
+                       break;
+  case LDAP_FILTER_LE:
+                       bsi->flt_where=backsql_strcat(bsi->flt_where,&bsi->fwhere_len,"(",at->sel_expr,"<=",
+                                                       f->f_av_value->bv_val,")",NULL);
+                       break;
+  case LDAP_FILTER_PRESENT:
+                       bsi->flt_where=backsql_strcat(bsi->flt_where,&bsi->fwhere_len,"NOT (",at->sel_expr,
+                                               " IS NULL)",NULL);
+                       break;
+  case LDAP_FILTER_SUBSTRINGS:
+                       backsql_process_sub_filter(bsi,f);
+                       break;
+ }
+
+done:
+ if (oc_attr.sel_expr!=NULL)
+  free(oc_attr.sel_expr);
+ Debug(LDAP_DEBUG_TRACE,"<==backsql_process_filter()\n",0,0,0);
+ return 1;
+}
+
+char* backsql_srch_query(backsql_srch_info *bsi)
+{
+ char *query=NULL;
+ int q_len=0;
+
+ Debug(LDAP_DEBUG_TRACE,"==>backsql_srch_query()\n",0,0,0);
+ bsi->sel=NULL;
+ bsi->from=NULL;
+ bsi->join_where=NULL;
+ bsi->flt_where=NULL;
+ bsi->sel_len=bsi->from_len=bsi->jwhere_len=bsi->fwhere_len=0;
+
+ bsi->sel=backsql_strcat(bsi->sel,&bsi->sel_len,
+                               "SELECT ldap_entries.id,",bsi->oc->keytbl,".",bsi->oc->keycol,
+                               ", '",bsi->oc->name,"' AS objectClass",
+                               ", ldap_entries.dn AS dn",
+                               NULL);
+ bsi->from=backsql_strcat(bsi->from,&bsi->from_len," FROM ldap_entries,",bsi->oc->keytbl,NULL);
+ bsi->join_where=backsql_strcat(bsi->join_where,&bsi->jwhere_len," WHERE ",
+        bsi->oc->keytbl,".",bsi->oc->keycol,"=ldap_entries.keyval AND ",
+        "ldap_entries.oc_map_id=? AND ",NULL);
+
+ switch(bsi->scope)
+ {
+  case LDAP_SCOPE_BASE:
+        if (bsi->bi->upper_func)
+                {
+                 bsi->join_where=backsql_strcat(bsi->join_where,&bsi->jwhere_len,
+                        bsi->bi->upper_func,"(","ldap_entries.dn)=(?)",NULL);
+                }
+               else
+                {
+                 bsi->join_where=backsql_strcat(bsi->join_where,&bsi->jwhere_len,
+                               "ldap_entries.dn=?",NULL);
+                }
+               break;
+  case LDAP_SCOPE_ONELEVEL:
+               bsi->join_where=backsql_strcat(bsi->join_where,&bsi->jwhere_len,
+                               "ldap_entries.parent=?",NULL);
+               break;
+  case LDAP_SCOPE_SUBTREE:
+               bsi->join_where=backsql_strcat(bsi->join_where,&bsi->jwhere_len,
+                               bsi->bi->subtree_cond,NULL);
+               break;
+ }
+ if (backsql_process_filter(bsi,bsi->filter))
+  query=backsql_strcat(query,&q_len,bsi->sel,bsi->from,bsi->join_where," AND ",bsi->flt_where,NULL);
+
+ free(bsi->sel);
+ free(bsi->from);
+ free(bsi->join_where);
+ free(bsi->flt_where);
+ bsi->sel_len=bsi->from_len=bsi->jwhere_len=bsi->fwhere_len=0;
+ Debug(LDAP_DEBUG_TRACE,"<==backsql_srch_query()\n",0,0,0);
+ return query;
+}
+
+int backsql_oc_get_candidates(backsql_oc_map_rec *oc,backsql_srch_info *bsi)
+{
+ char *query=NULL;
+ SQLHSTMT sth;
+ RETCODE rc;
+ backsql_entryID base_id,*res,*c_id;
+ //Entry *e;
+ BACKSQL_ROW_NTS row;
+ //int i;
+ Debug(LDAP_DEBUG_TRACE,"==>backsql_oc_get_candidates(): oc='%s'\n",oc->name,0,0);
+ bsi->oc=oc;
+ query=backsql_srch_query(bsi);
+ if (query==NULL)
+ {
+  Debug(LDAP_DEBUG_TRACE,"backsql_oc_get_candidates(): could not construct query for objectclass\n",0,0,0);
+  return 1;
+ }
+
+ Debug(LDAP_DEBUG_TRACE,"Constructed query: %s\n",query,0,0);
+ if ((rc=backsql_Prepare(bsi->dbh,&sth,query,0)) != SQL_SUCCESS)
+  {
+   Debug(LDAP_DEBUG_TRACE,"backsql_oc_get_candidates(): error preparing query\n",0,0,0);
+   backsql_PrintErrors(bsi->bi->db_env,bsi->dbh,sth,rc);
+   free(query);
+   return 1;
+  }
+ free(query);
+
+ if (backsql_BindParamID(sth,1,&bsi->oc->id) != SQL_SUCCESS)
+ {
+  Debug(LDAP_DEBUG_TRACE,"backsql_oc_get_candidates(): error binding objectclass id parameter\n",0,0,0);
+  return 1;
+ }
+ switch(bsi->scope)
+ {
+  case LDAP_SCOPE_BASE:
+  case LDAP_SCOPE_SUBTREE:
+               if ((rc=backsql_BindParamStr(sth,2,bsi->base_dn,BACKSQL_MAX_DN_LEN)) != SQL_SUCCESS)
+               {
+         Debug(LDAP_DEBUG_TRACE,"backsql_oc_get_candidates(): error binding base_dn parameter\n",0,0,0);
+                backsql_PrintErrors(bsi->bi->db_env,bsi->dbh,sth,rc);
+         return 1;
+               }
+               break;
+  case LDAP_SCOPE_ONELEVEL:
+               res=backsql_dn2id(bsi->bi,&base_id,bsi->dbh,bsi->base_dn);
+               if (res==NULL)
+               {
+                Debug(LDAP_DEBUG_TRACE,"backsql_oc_get_candidates(): could not retrieve base_dn id - no such entry\n",0,0,0);
+                bsi->status=LDAP_NO_SUCH_OBJECT;
+                return 0;
+               }
+               if (backsql_BindParamID(sth,2,&base_id.id) != SQL_SUCCESS)
+               {
+                Debug(LDAP_DEBUG_TRACE,"backsql_oc_get_candidates(): error binding base id parameter\n",0,0,0);
+                free(base_id.dn);
+                return 1;
+               }               
+               free(base_id.dn);
+               break;
+ }
+ if ((rc=SQLExecute(sth)) != SQL_SUCCESS && rc!= SQL_SUCCESS_WITH_INFO)
+  {
+   Debug(LDAP_DEBUG_TRACE,"backsql_oc_get_candidates(): error executing query\n",0,0,0);
+   backsql_PrintErrors(bsi->bi->db_env,bsi->dbh,sth,rc);
+   SQLFreeStmt(sth,SQL_DROP);
+   return 1;
+  }
+
+ backsql_BindRowAsStrings(sth,&row);
+ while ((rc=SQLFetch(sth)) == SQL_SUCCESS || rc==SQL_SUCCESS_WITH_INFO)
+  {
+   /*
+   e=(Entry*)ch_calloc(1,sizeof(Entry)); 
+   for (i=1;i<row.ncols;i++)
+    {
+     if (row.is_null[i]>0)
+      {
+       backsql_entry_addattr(e,row.col_names[i],row.cols[i],row.col_prec[i]);
+//       Debug(LDAP_DEBUG_TRACE,"prec=%d\n",(int)row.col_prec[i],0,0);
+      }
+    // else
+    //  Debug(LDAP_DEBUG_TRACE,"NULL value in this row for attribute '%s'\n",row.col_names[i],0,0);
+    }
+   */
+
+   c_id=(backsql_entryID*)ch_calloc(1,sizeof(backsql_entryID));
+   c_id->id=atoi(row.cols[0]);
+   c_id->keyval=atoi(row.cols[1]);
+   c_id->oc_id=bsi->oc->id;
+   c_id->dn=ch_strdup(row.cols[3]);
+   c_id->next=bsi->id_list;
+   bsi->id_list=c_id;
+   Debug(LDAP_DEBUG_TRACE,"backsql_oc_get_candidates(): added entry id=%d, keyval=%d dn='%s'\n",
+               c_id->id,c_id->keyval,row.cols[3]);
+  }
+ backsql_FreeRow(&row);
+ SQLFreeStmt(sth,SQL_DROP);
+ Debug(LDAP_DEBUG_TRACE,"<==backsql_oc_get_candidates()\n",0,0,0);
+ return 1;
+}
+
+int backsql_search(BackendDB *be,Connection *conn,Operation *op,
+       const char *base, const char *nbase, int scope,int deref,int slimit,int tlimit,
+       Filter *filter, const char *filterstr,char **attrs,int attrsonly)
+{
+ backsql_info *bi=(backsql_info*)be->be_private;
+ SQLHDBC dbh;
+ int sres;
+ int nentries;
+ Entry *entry,*res;
+ int manageDSAit = get_manageDSAit( op );
+ struct berval **v2refs = NULL;
+ time_t        stoptime;
+ backsql_srch_info srch_info;
+ backsql_entryID *eid=NULL;
+
+ Debug(LDAP_DEBUG_TRACE,"==>backsql_search(): base='%s', filter='%s', scope=%d,",
+                     nbase,filterstr,scope);
+ Debug(LDAP_DEBUG_TRACE," deref=%d, attrsonly=%d, attributes to load: %s\n",
+        deref,attrsonly,attrs==NULL?"all":"custom list");
+ dbh=backsql_get_db_conn(be,conn);
+
+ if (!dbh)
+ {
+  Debug(LDAP_DEBUG_TRACE,"backsql_search(): could not get connection handle - exiting\n",0,0,0);
+  send_ldap_result(conn,op,LDAP_OTHER,"","SQL-backend error",NULL,NULL);
+  return 1;
+ }
+ if (tlimit == 0 && be_isroot(be,op->o_dn))
+  {
+   tlimit = -1;        /* allow root to set no limit */
+  } 
+ else
+  {
+   tlimit = (tlimit > be->be_timelimit || tlimit < 1) ?
+                   be->be_timelimit : tlimit;
+   stoptime = op->o_time + tlimit;
+  }
+  
+ if (slimit == 0 && be_isroot(be,op->o_dn))
+  {
+   slimit = -1;        /* allow root to set no limit */
+  }
+ else
+  {
+   slimit = (slimit > be->be_sizelimit || slimit < 1) ?
+                   be->be_sizelimit : slimit;
+  }
+
+ backsql_init_search(&srch_info,bi,(char*)nbase,scope,slimit,tlimit,stoptime,filter,dbh,
+                be,conn,op,attrs);
+
+ //for each objectclass we try to construct query which gets IDs
+ //of entries matching LDAP query filter and scope (or at least candidates),
+ //and get the IDs
+ avl_apply(bi->oc_by_name,(AVL_APPLY)backsql_oc_get_candidates,&srch_info,0,AVL_INORDER);
+            
+ nentries=0;
+ //now we load candidate entries (only those attrubutes mentioned in attrs and filter),
+ //test it against full filter and then send to client
+ for(eid=srch_info.id_list;eid!=NULL;eid=eid->next)
+  {
+   /* check for abandon */
+   ldap_pvt_thread_mutex_lock(&op->o_abandonmutex);
+   if (op->o_abandon)
+    {
+     ldap_pvt_thread_mutex_unlock(&op->o_abandonmutex);
+     break;
+    }
+   ldap_pvt_thread_mutex_unlock(&op->o_abandonmutex);
+
+   /* check time limit */
+   if ( tlimit != -1 && slap_get_time() > stoptime)
+    {
+        send_search_result( conn, op, LDAP_TIMELIMIT_EXCEEDED,
+                               NULL, NULL, v2refs, NULL, nentries );
+     
+     break;
+    }
+     
+   Debug(LDAP_DEBUG_TRACE,"backsql_search(): loading data for entry id=%d, oc_id=%d, keyval=%d\n",
+               eid->id,eid->oc_id,eid->keyval);
+   
+   entry=(Entry *)ch_calloc(sizeof(Entry),1);
+   res=backsql_id2entry(&srch_info,entry,eid);
+   if (res==NULL)
+    {
+     Debug(LDAP_DEBUG_TRACE,"backsql_search(): error in backsql_id2entry() - skipping entry\n",0,0,0);
+     continue;
+    }
+
+   if ( !manageDSAit && scope != LDAP_SCOPE_BASE &&
+                       is_entry_referral( entry ) )
+    {
+     struct berval **refs = get_entry_referrals(be,conn,op,entry);
+
+     send_search_reference( be, conn, op, entry, refs, scope, NULL, &v2refs );
+     ber_bvecfree( refs );
+     continue;
+    }
+
+   if (test_filter(be,conn,op,entry,filter)==LDAP_COMPARE_TRUE)
+    {
+     if ((sres=send_search_entry(be,conn,op,entry,attrs,attrsonly,NULL))==-1)
+      {
+       Debug(LDAP_DEBUG_TRACE,"backsql_search(): connection lost\n",0,0,0);
+       break;
+      }
+     nentries+=!sres;                                  
+    }
+   entry_free(entry);
+  }
+
+ for(eid=srch_info.id_list;eid!=NULL;eid=backsql_free_entryID(eid));
+
+ charray_free(srch_info.attrs);
+
+ if (nentries>0)
+  send_search_result( conn, op,
+               v2refs == NULL ? LDAP_SUCCESS : LDAP_REFERRAL,
+               NULL, NULL, v2refs, NULL, nentries );
+ else
+  send_ldap_result(conn,op,LDAP_NO_SUCH_OBJECT,NULL,NULL,NULL,0);
+ Debug(LDAP_DEBUG_TRACE,"<==backsql_search()\n",0,0,0);
+ return 0;
+}
+
+#endif /* SLAPD_SQL */
diff --git a/servers/slapd/back-sql/sql-types.h b/servers/slapd/back-sql/sql-types.h
new file mode 100644 (file)
index 0000000..f709cd3
--- /dev/null
@@ -0,0 +1,25 @@
+#ifndef __BACKSQL_SQL_TYPES_H__
+#define __BACKSQL_SQL_TYPES_H__
+
+/*
+ *      Copyright 1999, Dmitry Kovalev <mit@openldap.org>, All rights reserved.
+ *
+ *      Redistribution and use in source and binary forms are permitted only
+ *      as authorized by the OpenLDAP Public License.  A copy of this
+ *      license is available at http://www.OpenLDAP.org/license.html or
+ *      in file LICENSE in the top-level directory of the distribution.
+ */
+
+#include <sql.h>
+#include <sqlext.h>
+
+typedef struct
+{
+ SWORD ncols;
+ char** col_names;
+ UDWORD *col_prec;
+ char** cols;
+ SQLINTEGER* is_null;
+}BACKSQL_ROW_NTS;
+
+#endif
\ No newline at end of file
diff --git a/servers/slapd/back-sql/sql-wrap.c b/servers/slapd/back-sql/sql-wrap.c
new file mode 100644 (file)
index 0000000..4b54c99
--- /dev/null
@@ -0,0 +1,316 @@
+/*
+ *      Copyright 1999, Dmitry Kovalev <mit@openldap.org>, All rights reserved.
+ *
+ *      Redistribution and use in source and binary forms are permitted only
+ *      as authorized by the OpenLDAP Public License.  A copy of this
+ *      license is available at http://www.OpenLDAP.org/license.html or
+ *      in file LICENSE in the top-level directory of the distribution.
+ */
+
+#include "portable.h"
+
+#ifdef SLAPD_SQL
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include "slap.h"
+#include "back-sql.h"
+#include "sql-types.h"
+#include "sql-wrap.h"
+#include "schema-map.h"
+
+#define MAX_ATTR_LEN 16384
+
+typedef struct backsql_conn
+{
+ int ldap_cid;
+ SQLHDBC dbh;
+}backsql_db_conn;
+
+int backsql_dummy(void *,void *);
+
+void backsql_PrintErrors(SQLHENV henv, SQLHDBC hdbc, SQLHSTMT sth,int rc)
+{
+ SQLCHAR           msg[SQL_MAX_MESSAGE_LENGTH];    /* msg. buffer    */
+ SQLCHAR           state[SQL_SQLSTATE_SIZE];       /* statement buf. */
+ SDWORD        iSqlCode;                              /* return code    */
+ SWORD       len=SQL_MAX_MESSAGE_LENGTH-1;                               /* return length  */
+
+ Debug(LDAP_DEBUG_TRACE,"Return code: %d\n", rc,0,0);
+  
+ while((rc=SQLError(henv,hdbc,sth,state,&iSqlCode,msg,
+             SQL_MAX_MESSAGE_LENGTH - 1, &len)) == SQL_SUCCESS
+       || rc == SQL_SUCCESS_WITH_INFO
+       )
+ {
+  Debug(LDAP_DEBUG_TRACE,"SQL engine state: %s\n", state,0,0);
+  Debug(LDAP_DEBUG_TRACE,"Native error code: %d\n",(int) iSqlCode,0,0);
+  Debug(LDAP_DEBUG_TRACE,"Message: %s\n",msg,0,0);
+ }
+}
+
+RETCODE backsql_Prepare(SQLHDBC dbh,SQLHSTMT *sth,char* query,int timeout)
+{
+ RETCODE rc;
+ char drv_name[30];
+ SWORD len;
+ int i;
+ rc=SQLAllocStmt(dbh,sth);
+ if (rc != SQL_SUCCESS)
+  return rc;
+ //Debug(LDAP_DEBUG_TRACE,"==>_SQLPrepare()\n", 0,0,0);
+ SQLGetInfo(dbh,SQL_DRIVER_NAME,drv_name,30,&len);
+ //Debug(LDAP_DEBUG_TRACE,"_SQLPrepare(): driver name='%s'\n", drv_name,0,0);
+ for (i=0;i<30 && drv_name[i];i++)
+  drv_name[i]=toupper(drv_name[i]);
+ if (!strncmp(drv_name,"SQLSRV32.DLL",30))
+  {
+   //stupid default result set in MS SQL Server does not support multiple active statements
+   //on the same connection -- so we are trying to make it not to use default result set...
+   Debug(LDAP_DEBUG_TRACE,"_SQLprepare(): enabling MS SQL Server default result set workaround\n", 0,0,0);
+   rc=SQLSetStmtOption(*sth,SQL_CONCURRENCY,SQL_CONCUR_ROWVER);
+   if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO)
+   {
+    Debug(LDAP_DEBUG_TRACE,"_SQLPrepare(): SQLSetStmtOption(SQL_CONCURRENCY,SQL_CONCUR_ROWVER) failed:\n", 0,0,0);
+    backsql_PrintErrors(SQL_NULL_HENV,dbh,sth,rc);
+   }
+  }
+ if (timeout>0)
+  {
+   Debug(LDAP_DEBUG_TRACE,"_SQLprepare(): setting query timeout to %d sec.\n", timeout,0,0);
+   if ((rc=SQLSetStmtOption(*sth,SQL_QUERY_TIMEOUT,timeout)) != SQL_SUCCESS)
+    {
+     backsql_PrintErrors(SQL_NULL_HENV,dbh,sth,rc);
+    }
+  }
+ //Debug(LDAP_DEBUG_TRACE,"<==_SQLPrepare() calling SQLPrepare()\n", 0,0,0);
+ return SQLPrepare(*sth,query,SQL_NTS);
+}
+
+RETCODE backsql_BindParamStr(SQLHSTMT sth,int par_ind,char *str,int maxlen)
+{
+ RETCODE rc;
+ SQLINTEGER len=SQL_NTS;
+ rc=SQLBindParameter(sth,(SQLUSMALLINT)par_ind,SQL_PARAM_INPUT,SQL_C_CHAR,SQL_VARCHAR,
+         (SQLUINTEGER)maxlen,0,(SQLPOINTER)str,(SQLUINTEGER)maxlen,NULL);
+ return rc;
+}
+
+RETCODE backsql_BindParamID(SQLHSTMT sth,int par_ind,unsigned long *id)
+{
+ return SQLBindParameter(sth,(SQLUSMALLINT)par_ind,SQL_PARAM_INPUT,SQL_C_ULONG,SQL_INTEGER,
+         0,0,(SQLPOINTER)id,0,(SQLINTEGER*)NULL);
+}
+
+RETCODE backsql_BindRowAsStrings(SQLHSTMT sth,BACKSQL_ROW_NTS *row)
+{
+ RETCODE rc;
+ SQLCHAR colname[64];
+ SQLSMALLINT name_len,col_type,col_scale,col_null;
+ UDWORD col_prec;
+ int i;
+ if (row == NULL)
+  return SQL_ERROR;
+ //Debug(LDAP_DEBUG_TRACE,"==> backsql_BindRowAsStrings()\n",0,0,0);
+ rc=SQLNumResultCols(sth,&row->ncols);
+ if (rc != SQL_SUCCESS)
+ {
+  //Debug(LDAP_DEBUG_TRACE,"_SQLBindRowAsStrings(): SQLNumResultCols() failed:\n",0,0,0);
+  backsql_PrintErrors(SQL_NULL_HENV,SQL_NULL_HDBC,sth,rc);
+ }
+ else
+ {
+  //Debug(LDAP_DEBUG_TRACE,"backsql_BindRowAsStrings: ncols=%d\n",(int)row->ncols,0,0);
+  row->col_names=(char**)ch_calloc(row->ncols,sizeof(char*));
+  row->cols=(char**)ch_calloc(row->ncols,sizeof(char*));
+  row->col_prec=(UDWORD*)ch_calloc(row->ncols,sizeof(UDWORD));
+  row->is_null=(SQLINTEGER*)ch_calloc(row->ncols,sizeof(SQLINTEGER));
+  for (i=1;i<=row->ncols;i++)
+  {
+   rc=SQLDescribeCol(sth,(SQLSMALLINT)i,&colname[0],(SQLUINTEGER)sizeof(colname)-1,&name_len,&col_type,
+          (UDWORD*) &col_prec,&col_scale,&col_null);
+   row->col_names[i-1]=ch_strdup(colname);
+   //Debug(LDAP_DEBUG_TRACE,"backsql_BindRowAsStrings: col_name=%s, col_prec[%d]=%d\n",colname,(int)i,(int)col_prec);
+   if (col_type == SQL_LONGVARCHAR || col_type== SQL_LONGVARBINARY)
+   {
+       //row->cols[i-1]=NULL;
+    //row->col_prec[i-1]=-1;
+       //such fields must be handled in some other way since they return 2G 
+       //as their precision (at least it does so with MS SQL Server w/native driver)
+       //for now, we just set fixed precision for such fields - dirty hack, but...
+       //no time to deal with SQLGetData()
+       col_prec=MAX_ATTR_LEN;
+       row->cols[i-1]=(char*)ch_calloc((col_prec+1),sizeof(char));
+    row->col_prec[i-1]=col_prec;
+       rc=SQLBindCol(sth,(SQLUSMALLINT)i,SQL_C_CHAR,(SQLPOINTER)row->cols[i-1],col_prec+1,
+                                                      &row->is_null[i-1]);
+   }
+   else
+   {
+    row->cols[i-1]=(char*)ch_calloc((col_prec+1),sizeof(char));
+    row->col_prec[i-1]=col_prec;
+       rc=SQLBindCol(sth,(SQLUSMALLINT)i,SQL_C_CHAR,(SQLPOINTER)row->cols[i-1],col_prec+1,
+                                                      &row->is_null[i-1]);
+   }
+  }
+ }
+ //Debug(LDAP_DEBUG_TRACE,"<== backsql_BindRowAsStrings()\n",0,0,0);
+ return rc;
+}
+
+RETCODE backsql_FreeRow(BACKSQL_ROW_NTS *row)
+{
+ int i;
+ if (row->cols == NULL)
+  return SQL_ERROR;
+ for(i=0;i<row->ncols;i++)
+  {
+   free(row->cols[i]);
+  }
+ free(row->col_names);
+ free(row->col_prec);
+ free(row->cols);
+ free(row->is_null);
+ return SQL_SUCCESS;
+}
+
+int backsql_cmp_connid(backsql_db_conn *c1,backsql_db_conn *c2)
+{
+ if (c1->ldap_cid > c2->ldap_cid)
+  return 1; 
+ if (c1->ldap_cid < c2->ldap_cid)
+  return -1; 
+ return 0;
+}
+
+
+int backsql_close_db_conn(backsql_db_conn *conn)
+{
+ Debug(LDAP_DEBUG_TRACE,"==>backsql_close_db_conn()\n",0,0,0);
+ SQLDisconnect(conn->dbh);
+ SQLFreeConnect(conn->dbh);
+ Debug(LDAP_DEBUG_TRACE,"<==backsql_close_db_conn()\n",0,0,0);
+ return 1;
+}
+
+int backsql_init_db_env(backsql_info *si)
+{
+ RETCODE rc;
+ Debug(LDAP_DEBUG_TRACE,"==>backsql_init_db_env()\n",0,0,0);
+ if ((rc=SQLAllocEnv(&si->db_env)) != SQL_SUCCESS)
+  {
+   Debug(LDAP_DEBUG_TRACE,"init_db_env: SQLAllocEnv failed:\n",0,0,0);
+   backsql_PrintErrors(SQL_NULL_HENV,SQL_NULL_HDBC,SQL_NULL_HENV,rc);
+  }
+ Debug(LDAP_DEBUG_TRACE,"<==backsql_init_db_env()\n",0,0,0);
+ return SQL_SUCCESS;
+}
+
+int backsql_free_db_env(backsql_info *si)
+{
+ Debug(LDAP_DEBUG_TRACE,"==>backsql_free_db_env()\n",0,0,0);
+ //Debug(LDAP_DEBUG_TRACE,"free_db_env(): delete AVL tree here!!!\n",0,0,0);
+ //stop, if frontend waits for all threads to shutdown before calling this --
+ //then what we are going to delete?? everything is deleted already...
+ Debug(LDAP_DEBUG_TRACE,"<==backsql_free_db_env()\n",0,0,0);
+ return SQL_SUCCESS;
+}
+
+backsql_db_conn* backsql_open_db_conn(backsql_info *si,int ldap_cid)
+{
+ backsql_db_conn *dbc=(backsql_db_conn*)ch_calloc(1,sizeof(backsql_db_conn));
+ int rc;
+ Debug(LDAP_DEBUG_TRACE,"==>backsql_open_db_conn()\n",0,0,0);
+ dbc->ldap_cid=ldap_cid;
+ if ((rc=SQLAllocConnect(si->db_env,&dbc->dbh)) != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO)
+  {
+   Debug(LDAP_DEBUG_TRACE,"backsql_open_db_conn: SQLAllocConnect() failed:\n",0,0,0);
+   backsql_PrintErrors(si->db_env,SQL_NULL_HDBC,SQL_NULL_HENV,rc);
+   return NULL;
+  }
+ if ((rc=SQLConnect(dbc->dbh,si->dbname,SQL_NTS,si->dbuser,SQL_NTS,
+                      si->dbpasswd,SQL_NTS) != SQL_SUCCESS))
+  {
+   if (rc != SQL_SUCCESS_WITH_INFO)
+    Debug(LDAP_DEBUG_TRACE,"backsql_open_db_conn: SQLConnect() failed:\n",0,0,0);
+   else
+       Debug(LDAP_DEBUG_TRACE,"backsql_open_db_conn: SQLConnect() succeeded with info:\n",0,0,0);
+   backsql_PrintErrors(si->db_env,dbc->dbh,SQL_NULL_HENV,rc);
+   if (rc != SQL_SUCCESS_WITH_INFO)
+    return NULL;
+  }
+                                            
+ Debug(LDAP_DEBUG_TRACE,"backsql_open_db_conn(): connected, adding to tree\n",0,0,0);
+ ldap_pvt_thread_mutex_lock(&si->dbconn_mutex);
+ avl_insert(&si->db_conns,dbc,(AVL_CMP)backsql_cmp_connid,backsql_dummy);
+ ldap_pvt_thread_mutex_unlock(&si->dbconn_mutex);
+ Debug(LDAP_DEBUG_TRACE,"<==backsql_open_db_conn()\n",0,0,0);
+ return dbc;
+}
+
+int backsql_free_db_conn(Backend *be,Connection *ldapc)
+{
+ backsql_info *si=(backsql_info*)be->be_private;
+ backsql_db_conn tmp,*conn;
+ Debug(LDAP_DEBUG_TRACE,"==>backsql_free_db_conn()\n",0,0,0);
+ tmp.ldap_cid=ldapc->c_connid;
+ ldap_pvt_thread_mutex_lock(&si->dbconn_mutex);
+ conn=(backsql_db_conn*)avl_delete(&si->db_conns,&tmp,(AVL_CMP)backsql_cmp_connid);
+ ldap_pvt_thread_mutex_unlock(&si->dbconn_mutex);
+ //we have one thread per connection, as I understand -- so we can
+ //get this out of critical section
+ if (conn!=NULL)
+  { 
+   Debug(LDAP_DEBUG_TRACE,"backsql_free_db_conn(): closing db connection\n",0,0,0);
+   backsql_close_db_conn(conn);
+  }
+ Debug(LDAP_DEBUG_TRACE,"<==backsql_free_db_conn()\n",0,0,0);
+ return SQL_SUCCESS;
+}
+
+SQLHDBC backsql_get_db_conn(Backend *be,Connection *ldapc)
+{
+ backsql_info *si=(backsql_info*)be->be_private;
+ backsql_db_conn *dbc;
+ backsql_db_conn tmp;
+ Debug(LDAP_DEBUG_TRACE,"==>backsql_get_db_conn()\n",0,0,0);
+ tmp.ldap_cid=ldapc->c_connid;
+ //we have one thread per connection, as I understand -- so we do not need
+ // locking here
+ dbc=(backsql_db_conn*)avl_find(si->db_conns,&tmp,(AVL_CMP)backsql_cmp_connid);
+ if (!dbc)
+  dbc=backsql_open_db_conn(si,ldapc->c_connid);
+  
+ if (!dbc)
+ {
+   Debug(LDAP_DEBUG_TRACE,"backsql_get_db_conn(): could not get connection handle -- returning NULL\n",0,0,0);
+   return NULL;
+ }
+ ldap_pvt_thread_mutex_lock(&si->schema_mutex);
+ if (!si->schema_loaded)
+  {
+   Debug(LDAP_DEBUG_TRACE,"backsql_get_db_conn(): first call -- reading schema map\n",0,0,0);
+   backsql_load_schema_map(si,dbc->dbh);
+  }
+ ldap_pvt_thread_mutex_unlock(&si->schema_mutex);
+ Debug(LDAP_DEBUG_TRACE,"<==backsql_get_db_conn()\n",0,0,0);
+ return dbc->dbh;
+}
+
+#endif /* SLAPD_SQL */
diff --git a/servers/slapd/back-sql/sql-wrap.h b/servers/slapd/back-sql/sql-wrap.h
new file mode 100644 (file)
index 0000000..64067f1
--- /dev/null
@@ -0,0 +1,28 @@
+#ifndef __BACKSQL_SQL_WRAP_H__
+#define __BACKSQL_SQL_WRAP_H__
+
+/*
+ *      Copyright 1999, Dmitry Kovalev <mit@openldap.org>, All rights reserved.
+ *
+ *      Redistribution and use in source and binary forms are permitted only
+ *      as authorized by the OpenLDAP Public License.  A copy of this
+ *      license is available at http://www.OpenLDAP.org/license.html or
+ *      in file LICENSE in the top-level directory of the distribution.
+ */
+
+#include "back-sql.h"
+#include "sql-types.h"
+
+RETCODE backsql_Prepare(SQLHDBC dbh,SQLHSTMT *sth,char* query,int timeout);
+RETCODE backsql_BindParamStr(SQLHSTMT sth,int par_ind,char *str,int maxlen);
+RETCODE backsql_BindParamID(SQLHSTMT sth,int par_ind,unsigned long *id);
+RETCODE backsql_BindRowAsStrings(SQLHSTMT sth,BACKSQL_ROW_NTS *row);
+RETCODE backsql_FreeRow(BACKSQL_ROW_NTS *row);
+void backsql_PrintErrors(SQLHENV henv, SQLHDBC hdbc, SQLHSTMT sth,int rc);
+
+int backsql_init_db_env(backsql_info *si);
+int backsql_free_db_env(backsql_info *si);
+SQLHDBC backsql_get_db_conn(Backend *be,Connection *ldapc);
+int backsql_free_db_conn(Backend *be,Connection *ldapc);
+
+#endif
\ No newline at end of file
diff --git a/servers/slapd/back-sql/util.c b/servers/slapd/back-sql/util.c
new file mode 100644 (file)
index 0000000..5d89c71
--- /dev/null
@@ -0,0 +1,160 @@
+/*
+ *      Copyright 1999, Dmitry Kovalev <mit@openldap.org>, All rights reserved.
+ *
+ *      Redistribution and use in source and binary forms are permitted only
+ *      as authorized by the OpenLDAP Public License.  A copy of this
+ *      license is available at http://www.OpenLDAP.org/license.html or
+ *      in file LICENSE in the top-level directory of the distribution.
+ */
+
+#include "portable.h"
+
+#ifdef SLAPD_SQL
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <string.h>
+#include <stdarg.h>
+#include "slap.h"
+#include "back-sql.h"
+#include "schema-map.h"
+#include "util.h"
+
+
+char backsql_def_oc_query[]="SELECT id,name,keytbl,keycol,create_proc,delete_proc,expect_return FROM ldap_oc_mappings";
+char backsql_def_at_query[]="SELECT name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_return FROM ldap_attr_mappings WHERE oc_map_id=?";
+char backsql_def_delentry_query[]="DELETE FROM ldap_entries WHERE id=?";
+char backsql_def_insentry_query[]="INSERT INTO ldap_entries (dn,oc_map_id,parent,keyval) VALUES (?,?,?,?)";
+char backsql_def_subtree_cond[]="ldap_entries.dn LIKE CONCAT('%',?)";
+char backsql_id_query[]="SELECT id,keyval,oc_map_id FROM ldap_entries WHERE ";
+
+char* backsql_strcat(char* dest,int *buflen, ...)
+{
+ va_list strs;
+ int cdlen,cslen,grow;
+ char *cstr;
+ //Debug(LDAP_DEBUG_TRACE,"==>my_strcat()\n");
+ va_start(strs,buflen);
+ if (dest==NULL || *buflen<=0)
+  {
+   dest=(char*)ch_calloc(BACKSQL_STR_GROW,sizeof(char));
+   *buflen=BACKSQL_STR_GROW;
+  }
+ cdlen=strlen(dest)+1;
+ while ((cstr=va_arg(strs,char*)) != NULL)
+  {
+   cslen=strlen(cstr);
+   grow=BACKSQL_MAX(BACKSQL_STR_GROW,cslen);
+   if (*buflen-cdlen < cslen)
+    {
+     //Debug(LDAP_DEBUG_TRACE,"my_strcat(): buflen=%d, cdlen=%d, cslen=%d -- reallocating dest\n",
+     //                     *buflen,cdlen,cslen);
+     dest=(char*)ch_realloc(dest,(*buflen)+grow*sizeof(char));
+     if (dest == NULL)
+      {
+       Debug(LDAP_DEBUG_ANY,"my_strcat(): could not reallocate string buffer.\n",0,0,0);
+      }
+     *buflen+=grow;
+     //Debug(LDAP_DEBUG_TRACE,"my_strcat(): new buflen=%d, dest=%p\n",*buflen,dest,0);
+    }
+   strcat(dest,cstr);
+   cdlen+=cslen;
+  }
+ va_end(strs);
+ //Debug(LDAP_DEBUG_TRACE,"<==my_strcat() (dest='%s')\n",dest,0,0);
+ return dest;
+} 
+
+int backsql_entry_addattr(Entry *e,char *at_name,char *at_val,unsigned int at_val_len)
+{
+ Attribute *c_at=e->e_attrs;
+ struct berval* add_val[2];
+ struct berval cval;
+ AttributeDescription *ad;
+ int rc;
+ const char *text;
+ Debug(LDAP_DEBUG_TRACE,"backsql_entry_addattr(): at_name='%s', at_val='%s'\n",at_name,at_val,0);
+ cval.bv_val=at_val;
+ cval.bv_len=at_val_len;
+ add_val[0]=&cval;
+ add_val[1]=NULL;
+ ad=NULL;
+ rc = slap_str2ad( at_name, &ad, &text );
+ if( rc != LDAP_SUCCESS ) 
+  {
+   Debug(LDAP_DEBUG_TRACE,"backsql_entry_addattr(): failed to find AttributeDescription for '%s'\n",at_name,0,0);
+   return 0;
+  }
+  
+ rc = attr_merge(e,ad,add_val);
+ ad_free( ad, 1 );
+
+ if( rc != 0 )
+  {
+   Debug(LDAP_DEBUG_TRACE,"backsql_entry_addattr(): failed to merge value '%s' for attribute '%s'\n",at_val,at_name,0);
+   return 0;
+  }
+ Debug(LDAP_DEBUG_TRACE,"<==backsql_query_addattr()\n",0,0,0);
+ return 1;
+}
+
+char* backsql_get_table_spec(char **p)
+{
+ char *s,*q;
+ char *res=NULL;
+ int res_len=0;
+
+ s=*p;
+ while(**p && **p!=',') (*p)++;
+ if (**p)
+  *(*p)++='\0';
+
+#define BACKSQL_NEXT_WORD  {while (*s && isspace(*s)) s++; if (!*s) return res; q=s; while (*q && !isspace(*q)) q++; if (*q) *q++='\0';}
+ BACKSQL_NEXT_WORD;
+ res=backsql_strcat(res,&res_len,s,NULL);//table name
+ s=q;
+
+ BACKSQL_NEXT_WORD;
+ if (!strcasecmp(s,"as"))
+ {
+  s=q;
+  BACKSQL_NEXT_WORD;
+ }
+ //res=backsql_strcat(res,&res_len," AS ",s,NULL);//table alias
+ //oracle doesn't understand AS :(
+ res=backsql_strcat(res,&res_len," ",s,NULL);//table alias
+ return res;
+}
+
+int backsql_merge_from_clause(char **dest_from,int *dest_len,char *src_from)
+{
+ char *s,*p,*srcc,*pos,e;
+
+ //Debug(LDAP_DEBUG_TRACE,"==>backsql_merge_from_clause(): dest_from='%s',src_from='%s'\n",
+ //                            dest_from,src_from,0);
+ srcc=ch_strdup(src_from);
+ p=srcc;
+ while(*p)
+ {
+  s=backsql_get_table_spec(&p);
+ // Debug(LDAP_DEBUG_TRACE,"backsql_merge_from_clause(): p='%s' s='%s'\n",p,s,0);  
+  if (*dest_from==NULL)
+   *dest_from=backsql_strcat(*dest_from,dest_len,s,NULL);
+  else
+       if((pos=strstr(*dest_from,s))==NULL)
+     *dest_from=backsql_strcat(*dest_from,dest_len,",",s,NULL);
+    else if((e=pos[strlen(s)])!='\0' && e!=',')
+      *dest_from=backsql_strcat(*dest_from,dest_len,",",s,NULL);
+  if (s)
+       ch_free(s);
+ }
+// Debug(LDAP_DEBUG_TRACE,"<==backsql_merge_from_clause()\n",0,0,0);
+ free(srcc);
+ return 1;
+}
+
+#endif /* SLAPD_SQL */
diff --git a/servers/slapd/back-sql/util.h b/servers/slapd/back-sql/util.h
new file mode 100644 (file)
index 0000000..1fe0cba
--- /dev/null
@@ -0,0 +1,60 @@
+#ifndef __BACKSQL_UTIL_H__
+#define __BACKSQL_UTIL_H__
+
+/*
+ *      Copyright 1999, Dmitry Kovalev <mit@openldap.org>, All rights reserved.
+ *
+ *      Redistribution and use in source and binary forms are permitted only
+ *      as authorized by the OpenLDAP Public License.  A copy of this
+ *      license is available at http://www.OpenLDAP.org/license.html or
+ *      in file LICENSE in the top-level directory of the distribution.
+ */
+
+
+#include "entry-id.h"
+#include "schema-map.h"
+
+#define BACKSQL_MAX(a,b) ((a)>(b)?(a):(b))
+#define BACKSQL_MIN(a,b) ((a)<(b)?(a):(b))
+
+#define BACKSQL_STR_GROW 64
+
+char* backsql_strcat(char* dest,int *buflen, ...);
+
+int backsql_entry_addattr(Entry *e,char *at_name,char *at_val,unsigned int at_val_len);
+
+typedef struct __backsql_srch_info
+{
+ char *base_dn;
+ int scope;
+ Filter *filter;
+ int slimit,tlimit;
+ time_t        stoptime;
+ backsql_entryID *id_list,*c_eid;
+ int abandon;
+ backsql_info *bi;
+ backsql_oc_map_rec *oc;
+ char *sel,*from,*join_where,*flt_where;
+ int sel_len,from_len,jwhere_len,fwhere_len;
+ SQLHDBC dbh;
+ int status;
+ Backend *be;
+ Connection *conn;
+ Operation *op;
+ char **attrs;
+ Entry *e;
+}backsql_srch_info;
+
+int backsql_process_filter(backsql_srch_info *bsi,Filter *f);
+void backsql_init_search(backsql_srch_info *bsi,backsql_info *bi,char *nbase,int scope,
+                                                int slimit,int tlimit,time_t stoptime,Filter *filter,
+                                                SQLHDBC dbh,Backend *be,Connection *conn,Operation *op,char **attrs);
+Entry* backsql_id2entry(backsql_srch_info *bsi,Entry* e,backsql_entryID* id);
+
+extern char backsql_def_oc_query[],backsql_def_at_query[],
+                       backsql_def_delentry_query[],backsql_def_insentry_query[],
+                       backsql_def_subtree_cond[],backsql_id_query[];
+
+int backsql_merge_from_clause(char **dest_from,int *dest_len,char *src_from);
+
+#endif
\ No newline at end of file