]> git.sur5r.net Git - bacula/bacula/commitdiff
Add back db.m4 needed for dbi code
authorKern Sibbald <kern@sibbald.com>
Sun, 5 Oct 2008 12:54:40 +0000 (12:54 +0000)
committerKern Sibbald <kern@sibbald.com>
Sun, 5 Oct 2008 12:54:40 +0000 (12:54 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7711 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/autoconf/aclocal.m4
bacula/autoconf/bacula-macros/db.m4 [new file with mode: 0644]
bacula/configure

index d92b16e5bbc2f3b078ea7622a5a18ac40f66c856..a1c61deb138634c0d62af1a6265df083e8424134 100644 (file)
 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 # PARTICULAR PURPOSE.
 
-# AM_CONDITIONAL                                            -*- Autoconf -*-
-
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 7
-
-# AM_CONDITIONAL(NAME, SHELL-CONDITION)
-# -------------------------------------
-# Define a conditional.
-AC_DEFUN([AM_CONDITIONAL],
-[AC_PREREQ(2.52)dnl
- ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
-       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
-AC_SUBST([$1_TRUE])
-AC_SUBST([$1_FALSE])
-if $2; then
-  $1_TRUE=
-  $1_FALSE='#'
-else
-  $1_TRUE='#'
-  $1_FALSE=
-fi
-AC_CONFIG_COMMANDS_PRE(
-[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
-  AC_MSG_ERROR([[conditional "$1" was never defined.
-Usually this means the macro was only invoked conditionally.]])
-fi])])
-
 m4_include([gettext-macros/codeset.m4])
 m4_include([gettext-macros/gettext.m4])
 m4_include([gettext-macros/glibc2.m4])
@@ -73,5 +40,6 @@ m4_include([gettext-macros/ulonglong.m4])
 m4_include([gettext-macros/wchar_t.m4])
 m4_include([gettext-macros/wint_t.m4])
 m4_include([gettext-macros/xsize.m4])
+m4_include([bacula-macros/db.m4])
 m4_include([bacula-macros/largefiles.m4])
 m4_include([bacula-macros/os.m4])
diff --git a/bacula/autoconf/bacula-macros/db.m4 b/bacula/autoconf/bacula-macros/db.m4
new file mode 100644 (file)
index 0000000..69cce45
--- /dev/null
@@ -0,0 +1,1325 @@
+AC_DEFUN([BA_CHECK_DBI_DB],
+[
+db_found=no
+AC_MSG_CHECKING(for DBI support)
+AC_ARG_WITH(dbi,
+[
+  --with-dbi@<:@=DIR@:>@     Include DBI support.  DIR is the DBD base
+                          install directory, default is to search through
+                          a number of common places for the DBI files.],
+[
+  if test "$withval" != "no"; then
+     if test "$withval" = "yes"; then
+        if test -f /usr/local/include/dbi/dbi.h; then
+           DBI_INCDIR=/usr/local/dbi/include
+           if test -d /usr/local/lib64; then
+              DBI_LIBDIR=/usr/local/lib64
+           else
+              DBI_LIBDIR=/usr/local/lib
+           fi
+           DBI_BINDIR=/usr/local/bin
+        elif test -f /usr/include/dbi/dbi.h; then
+           DBI_INCDIR=/usr/include
+           if test -d /usr/lib64; then
+              DBI_LIBDIR=/usr/lib64
+           else
+              DBI_LIBDIR=/usr/lib
+           fi
+           DBI_BINDIR=/usr/bin      
+        elif test -f $prefix/include/dbi/dbi.h; then
+           DBI_INCDIR=$prefix/include
+           if test -d $prefix/lib64; then
+              DBI_LIBDIR=$prefix/lib64
+           else
+              DBI_LIBDIR=$prefix/lib
+           fi
+           DBI_BINDIR=$prefix/bin      
+        else
+           AC_MSG_RESULT(no)
+           AC_MSG_ERROR(Unable to find dbi.h in standard locations)
+        fi
+        if test -d /usr/local/lib/dbd; then
+           DRIVERDIR=/usr/local/lib/dbd
+           if test -d /usr/local/lib64/dbd; then
+              DRIVERDIR=/usr/local/lib64/dbd
+           else
+              DRIVERDIR=/usr/local/lib/dbd
+           fi
+        elif test -d /usr/lib/dbd; then
+           DRIVERDIR=/usr/lib/dbd
+           if test -d /usr/lib64/dbd; then
+              DRIVERDIR=/usr/lib64/dbd
+           else
+              DRIVERDIR=/usr/lib/dbd
+           fi
+        elif test -d $prefix/lib/dbd; then
+           if test -d $prefix/lib64/dbd; then
+              DRIVERDIR=$prefix/lib64/dbd
+           else
+              DRIVERDIR=$prefix/lib/dbd
+           fi
+        else
+           AC_MSG_RESULT(no)
+           AC_MSG_ERROR(Unable to find DBD drivers in standard locations)
+        fi
+     else
+        if test -f $withval/dbi.h; then
+           DBI_INCDIR=$withval
+           DBI_LIBDIR=$withval
+           DBI_BINDIR=$withval
+        elif test -f $withval/include/dbi/dbi.h; then
+           DBI_INCDIR=$withval/include
+           if test -d $withval/lib64; then
+              DBI_LIBDIR=$withval/lib64
+           else
+              DBI_LIBDIR=$withval/lib
+           fi
+           DBI_BINDIR=$withval/bin
+        else
+           AC_MSG_RESULT(no)
+           AC_MSG_ERROR(Invalid DBI directory $withval - unable to find dbi.h under $withval)
+        fi
+        if test -d $withval/dbd; then
+           DRIVERDIR=$withval/dbd
+        elif test -d $withval/lib/; then
+           if test -d $withval/lib64/dbd; then
+              DRIVERDIR=$withval/lib64/dbd
+           else
+              DRIVERDIR=$withval/lib/dbd
+           fi
+        else
+           AC_MSG_RESULT(no)
+           AC_MSG_ERROR(Invalid DBD driver directory $withval - unable to find DBD drivers under $withval)
+        fi
+     fi
+     SQL_INCLUDE=-I$DBI_INCDIR
+     SQL_LFLAGS="-L$DBI_LIBDIR -ldbi"
+     SQL_BINDIR=$DBI_BINDIR
+     SQL_LIB=$DBI_LIBDIR/libdbi.a
+     DBI_DBD_DRIVERDIR="-D DBI_DRIVER_DIR=\\\"$DRIVERDIR\\\""
+
+     AC_DEFINE(HAVE_DBI, 1, [Set if you have the DBI driver])
+     AC_MSG_RESULT(yes)
+     db_found=yes
+     support_dbi=yes
+     db_type=DBI
+     DB_TYPE=dbi
+     uncomment_dbi=" "
+
+  else
+     AC_MSG_RESULT(no)
+  fi
+],[
+  AC_MSG_RESULT(no)
+])
+AC_SUBST(SQL_LFLAGS)
+AC_SUBST(SQL_INCLUDE)
+AC_SUBST(SQL_BINDIR)
+AC_SUBST(DBI_DBD_DRIVERDIR)  
+AC_SUBST(uncomment_dbi)
+
+])
+
+AC_DEFUN([BA_CHECK_DBI_DRIVER],
+[
+db_found=no
+db_prog=no
+AC_MSG_CHECKING(for DBI drivers support)
+AC_ARG_WITH(dbi-driver,
+[
+  --with-dbi-driver@<:@=DRIVER@:>@     Suport for DBI driver.  DRIVER is 
+                          the one DBI driver like Mysql, Postgresql, others.
+                          Default is to not configure any driver.],
+[
+  if test "$withval" != "no"; then
+     case $withval in
+        "mysql")
+           db_prog="mysql"
+           if test -f /usr/local/mysql/bin/mysql; then
+              SQL_BINDIR=/usr/local/mysql/bin
+              if test -f /usr/local/mysql/lib64/mysql/libmysqlclient_r.a \
+                 -o -f /usr/local/mysql/lib64/mysql/libmysqlclient_r.so; then
+                 SQL_LIBDIR=/usr/local/mysql/lib64/mysql
+              else
+                 SQL_LIBDIR=/usr/local/mysql/lib/mysql
+              fi
+           elif test -f /usr/bin/mysql; then
+              SQL_BINDIR=/usr/bin
+              if test -f /usr/lib64/mysql/libmysqlclient_r.a \
+                  -o -f /usr/lib64/mysql/libmysqlclient_r.so; then  
+                  SQL_LIBDIR=/usr/lib64/mysql
+              elif test -f /usr/lib/mysql/libmysqlclient_r.a \
+                  -o -f /usr/lib/mysql/libmysqlclient_r.so; then
+                  SQL_LIBDIR=/usr/lib/mysql
+              else
+                  SQL_LIBDIR=/usr/lib
+              fi
+           elif test -f /usr/local/bin/mysql; then
+              SQL_BINDIR=/usr/local/bin
+              if test -f /usr/local/lib64/mysql/libmysqlclient_r.a \
+                  -o -f /usr/local/lib64/mysql/libmysqlclient_r.so; then  
+                  SQL_LIBDIR=/usr/local/lib64/mysql
+              elif test -f /usr/local/lib/mysql/libmysqlclient_r.a \
+                  -o -f /usr/local/lib/mysql/libmysqlclient_r.so; then
+                  SQL_LIBDIR=/usr/local/lib/mysql
+              else
+                  SQL_LIBDIR=/usr/local/lib
+              fi
+           elif test -f $withval/bin/mysql; then
+              SQL_BINDIR=$withval/bin
+              if test -f $withval/lib64/mysql/libmysqlclient_r.a \
+                  -o -f $withval/lib64/mysql/libmysqlclient_r.so; then
+                  SQL_LIBDIR=$withval/lib64/mysql
+              elif test -f $withval/lib64/libmysqlclient_r.a \
+                  -o -f $withval/lib64/libmysqlclient_r.so; then
+                  SQL_LIBDIR=$withval/lib64
+              elif test -f $withval/lib/libmysqlclient_r.a \
+                  -o -f $withval/lib/libmysqlclient_r.so; then
+                  SQL_LIBDIR=$withval/lib/
+              else
+                  SQL_LIBDIR=$withval/lib/mysql
+              fi
+           else
+              AC_MSG_RESULT(no)
+              AC_MSG_ERROR(Unable to find mysql in standard locations)
+           fi
+           DB_PROG_LIB=$SQL_LIBDIR/libmysqlclient_r.a
+        ;;
+        "postgresql")
+           db_prog="postgresql"
+           PG_CONFIG=`which pg_config`
+           if test -n "$PG_CONFIG"; then
+              SQL_BINDIR=`"$PG_CONFIG" --bindir`
+              SQL_LIBDIR=`"$PG_CONFIG" --libdir`
+           elif test -f /usr/local/bin/psql; then
+              SQL_BINDIR=/usr/local/bin
+              if test -d /usr/local/lib64; then
+                 SQL_LIBDIR=/usr/local/lib64
+              else
+                 SQL_LIBDIR=/usr/local/lib
+              fi
+           elif test -f /usr/bin/psql; then
+              SQL_BINDIR=/usr/local/bin
+              if test -d /usr/lib64/postgresql; then
+                 SQL_LIBDIR=/usr/lib64/postgresql
+              elif test -d /usr/lib/postgresql; then
+                 SQL_LIBDIR=/usr/lib/postgresql
+              elif test -d /usr/lib64; then
+                 SQL_LIBDIR=/usr/lib64
+              else
+                 SQL_LIBDIR=/usr/lib
+              fi
+           elif test -f $withval/bin/psql; then
+              SQL_BINDIR=$withval/bin
+              if test -d $withval/lib64; then
+                 SQL_LIBDIR=$withval/lib64
+              else
+                 SQL_LIBDIR=$withval/lib
+              fi
+           else
+              AC_MSG_RESULT(no)
+              AC_MSG_ERROR(Unable to find psql in standard locations)
+           fi
+           DB_PROG_LIB=$SQL_LIBDIR/libpq.a
+        ;;
+        "sqlite")
+           db_prog="sqlite"
+           if test -f /usr/local/bin/sqlite; then
+              SQL_BINDIR=/usr/local/bin
+              if test -d /usr/local/lib64; then
+                 SQL_LIBDIR=/usr/local/lib64
+              else
+                 SQL_LIBDIR=/usr/local/lib
+              fi
+           elif test -f /usr/bin/sqlite; then
+              SQL_BINDIR=/usr/bin
+              if test -d /usr/lib64; then
+                 SQL_LIBDIR=/usr/lib64
+              else
+                 SQL_LIBDIR=/usr/lib
+              fi                 
+           elif test -f $withval/bin/sqlite; then
+              SQL_BINDIR=$withval/bin
+              if test -d $withval/lib64; then
+                 SQL_LIBDIR=$withval/lib64
+              else
+                 SQL_LIBDIR=$withval/lib
+              fi                 
+           else
+              AC_MSG_RESULT(no)
+              AC_MSG_ERROR(Unable to find sqlite in standard locations)
+           fi
+           DB_PROG_LIB=$SQL_LIBDIR/libsqlite.a
+        ;;
+        "sqlite3")
+           db_prog="sqlite3"
+           if test -f /usr/local/bin/sqlite3; then
+              SQL_BINDIR=/usr/local/bin
+              if test -d /usr/local/lib64; then
+                 SQL_LIBDIR=/usr/local/lib64
+              else
+                 SQL_LIBDIR=/usr/local/lib
+              fi
+           elif test -f /usr/bin/sqlite3; then
+              SQL_BINDIR=/usr/bin
+              if test -d /usr/lib64; then
+                 SQL_LIBDIR=/usr/lib64
+              else
+                 SQL_LIBDIR=/usr/lib
+              fi                 
+           elif test -f $withval/bin/sqlite3; then
+              SQL_BINDIR=$withval/bin
+              if test -d $withval/lib64; then
+                 SQL_LIBDIR=$withval/lib64
+              else
+                 SQL_LIBDIR=$withval/lib
+              fi                 
+           else
+              AC_MSG_RESULT(no)
+              AC_MSG_ERROR(Unable to find sqlite in standard locations)
+           fi
+           DB_PROG_LIB=$SQL_LIBDIR/libsqlite3.a
+        ;;                
+        *)
+           AC_MSG_RESULT(no)
+           AC_MSG_ERROR(Unable to set DBI driver. $withval is not supported)
+        ;;
+     esac
+
+     AC_MSG_RESULT(yes)
+     DB_PROG=$db_prog
+  else
+     AC_MSG_RESULT(no)
+  fi
+],[
+  AC_MSG_RESULT(no)
+])
+AC_SUBST(SQL_BINDIR)
+AC_SUBST(DB_PROG)
+AC_SUBST(DB_PROG_LIB)
+
+])
+
+
+AC_DEFUN([BA_CHECK_MYSQL_DB],
+[
+db_found=no
+AC_MSG_CHECKING(for MySQL support)
+AC_ARG_WITH(mysql,
+[
+  --with-mysql@<:@=DIR@:>@      Include MySQL support.  DIR is the MySQL base
+                          install directory, default is to search through
+                          a number of common places for the MySQL files.],
+[
+  if test "$withval" != "no"; then
+        if test "$withval" = "yes"; then
+           if test -f /usr/local/mysql/include/mysql/mysql.h; then
+                   MYSQL_INCDIR=/usr/local/mysql/include/mysql
+                   if test -f /usr/local/mysql/lib64/mysql/libmysqlclient_r.a \
+                        -o -f /usr/local/mysql/lib64/mysql/libmysqlclient_r.so; then
+                           MYSQL_LIBDIR=/usr/local/mysql/lib64/mysql
+                   else
+                           MYSQL_LIBDIR=/usr/local/mysql/lib/mysql
+                   fi
+                   MYSQL_BINDIR=/usr/local/mysql/bin
+           elif test -f /usr/include/mysql/mysql.h; then
+                   MYSQL_INCDIR=/usr/include/mysql
+                   if test -f /usr/lib64/mysql/libmysqlclient_r.a \
+                        -o -f /usr/lib64/mysql/libmysqlclient_r.so; then  
+                           MYSQL_LIBDIR=/usr/lib64/mysql
+                   elif test -f /usr/lib/mysql/libmysqlclient_r.a \
+                          -o -f /usr/lib/mysql/libmysqlclient_r.so; then
+                           MYSQL_LIBDIR=/usr/lib/mysql
+                   else
+                           MYSQL_LIBDIR=/usr/lib
+                   fi
+                   MYSQL_BINDIR=/usr/bin
+           elif test -f /usr/include/mysql.h; then
+                   MYSQL_INCDIR=/usr/include
+                   if test -f /usr/lib64/libmysqlclient_r.a \
+                        -o -f /usr/lib64/libmysqlclient_r.so; then
+                           MYSQL_LIBDIR=/usr/lib64
+                   else
+                           MYSQL_LIBDIR=/usr/lib
+                   fi
+                   MYSQL_BINDIR=/usr/bin
+           elif test -f /usr/local/include/mysql/mysql.h; then
+                   MYSQL_INCDIR=/usr/local/include/mysql
+                   if test -f /usr/local/lib64/mysql/libmysqlclient_r.a \
+                        -o -f /usr/local/lib64/mysql/libmysqlclient_r.so; then
+                           MYSQL_LIBDIR=/usr/local/lib64/mysql
+                   else
+                           MYSQL_LIBDIR=/usr/local/lib/mysql
+                   fi
+                   MYSQL_BINDIR=/usr/local/bin
+           elif test -f /usr/local/include/mysql.h; then
+                   MYSQL_INCDIR=/usr/local/include
+                   if test -f /usr/local/lib64/libmysqlclient_r.a \
+                        -o -f /usr/local/lib64/libmysqlclient_r.so; then
+                           MYSQL_LIBDIR=/usr/local/lib64
+                   else
+                           MYSQL_LIBDIR=/usr/local/lib
+                   fi
+                   MYSQL_BINDIR=/usr/local/bin
+           else
+              AC_MSG_RESULT(no)
+              AC_MSG_ERROR(Unable to find mysql.h in standard locations)
+           fi
+        else
+           if test -f $withval/include/mysql/mysql.h; then
+              MYSQL_INCDIR=$withval/include/mysql
+              if test -f $withval/lib64/mysql/libmysqlclient_r.a \
+                   -o -f $withval/lib64/mysql/libmysqlclient_r.so; then
+                 MYSQL_LIBDIR=$withval/lib64/mysql
+              else
+                 MYSQL_LIBDIR=$withval/lib/mysql
+                 # Solaris ...
+                 if test -f $withval/lib/libmysqlclient_r.so; then
+                    MYSQL_LIBDIR=$withval/lib
+                 fi
+              fi
+              MYSQL_BINDIR=$withval/bin
+           elif test -f $withval/include/mysql.h; then
+              MYSQL_INCDIR=$withval/include
+              if test -f $withval/lib64/libmysqlclient_r.a \
+                   -o -f $withval/lib64/libmysqlclient_r.so; then
+                 MYSQL_LIBDIR=$withval/lib64
+              else
+                 MYSQL_LIBDIR=$withval/lib
+              fi
+              MYSQL_BINDIR=$withval/bin
+           else
+              AC_MSG_RESULT(no)
+              AC_MSG_ERROR(Invalid MySQL directory $withval - unable to find mysql.h under $withval)
+           fi
+        fi
+    SQL_INCLUDE=-I$MYSQL_INCDIR
+    if test -f $MYSQL_LIBDIR/libmysqlclient_r.a \
+         -o -f $MYSQL_LIBDIR/libmysqlclient_r.so; then
+       SQL_LFLAGS="-L$MYSQL_LIBDIR -lmysqlclient_r -lz"
+       AC_DEFINE(HAVE_THREAD_SAFE_MYSQL)
+    fi
+    SQL_BINDIR=$MYSQL_BINDIR
+    SQL_LIB=$MYSQL_LIBDIR/libmysqlclient_r.a
+
+    AC_DEFINE(HAVE_MYSQL)
+    AC_MSG_RESULT(yes)
+    db_found=yes
+    support_mysql=yes
+    db_type=MySQL
+    DB_TYPE=mysql
+
+  else
+        AC_MSG_RESULT(no)
+  fi
+]
+)
+
+AC_ARG_WITH(embedded-mysql,
+[
+  --with-embedded-mysql@<:@=DIR@:>@ Include MySQL support.  DIR is the MySQL base
+                          install directory, default is to search through
+                          a number of common places for the MySQL files.],
+[
+  if test "$withval" != "no"; then
+        if test "$withval" = "yes"; then
+                if test -f /usr/local/mysql/include/mysql/mysql.h; then
+                        MYSQL_INCDIR=/usr/local/mysql/include/mysql
+                        if test -d /usr/local/mysql/lib64/mysql; then
+                                MYSQL_LIBDIR=/usr/local/mysql/lib64/mysql
+                        else
+                                MYSQL_LIBDIR=/usr/local/mysql/lib/mysql
+                        fi
+                        MYSQL_BINDIR=/usr/local/mysql/bin
+                elif test -f /usr/include/mysql/mysql.h; then
+                        MYSQL_INCDIR=/usr/include/mysql
+                        if test -d /usr/lib64/mysql; then
+                                MYSQL_LIBDIR=/usr/lib64/mysql
+                        else
+                                MYSQL_LIBDIR=/usr/lib/mysql
+                        fi
+                        MYSQL_BINDIR=/usr/bin
+                elif test -f /usr/include/mysql.h; then
+                        MYSQL_INCDIR=/usr/include
+                        if test -d /usr/lib64; then
+                                MYSQL_LIBDIR=/usr/lib64
+                        else
+                                MYSQL_LIBDIR=/usr/lib
+                        fi
+                        MYSQL_BINDIR=/usr/bin
+                elif test -f /usr/local/include/mysql/mysql.h; then
+                        MYSQL_INCDIR=/usr/local/include/mysql
+                        if test -d /usr/local/lib64/mysql; then
+                                MYSQL_LIBDIR=/usr/local/lib64/mysql
+                        else
+                                MYSQL_LIBDIR=/usr/local/lib/mysql
+                        fi
+                        MYSQL_BINDIR=/usr/local/bin
+                elif test -f /usr/local/include/mysql.h; then
+                        MYSQL_INCDIR=/usr/local/include
+                        if test -d /usr/local/lib64; then
+                                MYSQL_LIBDIR=/usr/local/lib64
+                        else
+                                MYSQL_LIBDIR=/usr/local/lib
+                        fi
+                        MYSQL_BINDIR=/usr/local/bin
+                else
+                   AC_MSG_RESULT(no)
+                   AC_MSG_ERROR(Unable to find mysql.h in standard locations)
+                fi
+        else
+                if test -f $withval/include/mysql/mysql.h; then
+                        MYSQL_INCDIR=$withval/include/mysql
+                        if test -d $withval/lib64/mysql; then
+                                MYSQL_LIBDIR=$withval/lib64/mysql
+                        else
+                                MYSQL_LIBDIR=$withval/lib/mysql
+                        fi
+                        MYSQL_BINDIR=$withval/bin
+                elif test -f $withval/include/mysql.h; then
+                        MYSQL_INCDIR=$withval/include
+                        if test -d $withval/lib64; then
+                                MYSQL_LIBDIR=$withval/lib64
+                        else
+                                MYSQL_LIBDIR=$withval/lib
+                        fi
+                        MYSQL_BINDIR=$withval/bin
+                else
+                   AC_MSG_RESULT(no)
+                   AC_MSG_ERROR(Invalid MySQL directory $withval - unable to find mysql.h under $withval)
+                fi
+        fi
+    SQL_INCLUDE=-I$MYSQL_INCDIR
+    SQL_LFLAGS="-L$MYSQL_LIBDIR -lmysqld -lz -lm -lcrypt"
+    SQL_BINDIR=$MYSQL_BINDIR
+    SQL_LIB=$MYSQL_LIBDIR/libmysqld.a
+
+    AC_DEFINE(HAVE_MYSQL)
+    AC_DEFINE(HAVE_EMBEDDED_MYSQL)
+    AC_MSG_RESULT(yes)
+    db_found=yes
+    support_mysql=yes
+    db_type=MySQL
+    DB_TYPE=mysql
+
+  else
+        AC_MSG_RESULT(no)
+  fi
+]
+)
+
+
+AC_SUBST(SQL_LFLAGS)
+AC_SUBST(SQL_INCLUDE)
+AC_SUBST(SQL_BINDIR)
+  
+])
+
+
+AC_DEFUN([BA_CHECK_SQLITE_DB],
+[
+db_found=no
+AC_MSG_CHECKING(for SQLite support)
+AC_ARG_WITH(sqlite,
+[
+  --with-sqlite@<:@=DIR@:>@     Include SQLite support.  DIR is the SQLite base
+                          install directory, default is to search through
+                          a number of common places for the SQLite files.],
+[
+  if test "$withval" != "no"; then
+     if test "$withval" = "yes"; then
+        if test -f /usr/local/include/sqlite.h; then
+           SQLITE_INCDIR=/usr/local/include
+           if test -d /usr/local/lib64; then
+              SQLITE_LIBDIR=/usr/local/lib64
+           else
+              SQLITE_LIBDIR=/usr/local/lib
+           fi
+           SQLITE_BINDIR=/usr/local/bin
+        elif test -f /usr/include/sqlite.h; then
+           SQLITE_INCDIR=/usr/include
+           if test -d /usr/lib64; then
+              SQLITE_LIBDIR=/usr/lib64
+           else
+              SQLITE_LIBDIR=/usr/lib
+           fi
+           SQLITE_BINDIR=/usr/bin      
+        elif test -f $prefix/include/sqlite.h; then
+           SQLITE_INCDIR=$prefix/include
+           if test -d $prefix/lib64; then
+              SQLITE_LIBDIR=$prefix/lib64
+           else
+              SQLITE_LIBDIR=$prefix/lib
+           fi
+           SQLITE_BINDIR=$prefix/bin      
+        else
+           AC_MSG_RESULT(no)
+           AC_MSG_ERROR(Unable to find sqlite.h in standard locations)
+        fi
+     else
+        if test -f $withval/sqlite.h; then
+           SQLITE_INCDIR=$withval
+           SQLITE_LIBDIR=$withval
+           SQLITE_BINDIR=$withval
+        elif test -f $withval/include/sqlite.h; then
+           SQLITE_INCDIR=$withval/include
+           if test -d $withval/lib64; then
+              SQLITE_LIBDIR=$withval/lib64
+           else
+              SQLITE_LIBDIR=$withval/lib
+           fi
+           SQLITE_BINDIR=$withval/bin
+        else
+           AC_MSG_RESULT(no)
+           AC_MSG_ERROR(Invalid SQLite directory $withval - unable to find sqlite.h under $withval)
+        fi
+     fi
+     SQL_INCLUDE=-I$SQLITE_INCDIR
+     SQL_LFLAGS="-L$SQLITE_LIBDIR -lsqlite"
+     SQL_BINDIR=$SQLITE_BINDIR
+     SQL_LIB=$SQLITE_LIBDIR/libsqlite.a
+
+     AC_DEFINE(HAVE_SQLITE)
+     AC_MSG_RESULT(yes)
+     db_found=yes
+     support_sqlite=yes
+     db_type=SQLite
+     DB_TYPE=sqlite
+
+  else
+     AC_MSG_RESULT(no)
+  fi
+],[
+  AC_MSG_RESULT(no)
+])
+AC_SUBST(SQL_LFLAGS)
+AC_SUBST(SQL_INCLUDE)
+AC_SUBST(SQL_BINDIR)
+  
+])
+
+AC_DEFUN([BA_CHECK_SQLITE3_DB],
+[
+db_found=no
+AC_MSG_CHECKING(for SQLite3 support)
+AC_ARG_WITH(sqlite3,
+[
+  --with-sqlite3@<:@=DIR@:>@    Include SQLite3 support.  DIR is the SQLite3 base
+                          install directory, default is to search through
+                          a number of common places for the SQLite3 files.],
+[
+  if test "$withval" != "no"; then
+     if test "$withval" = "yes"; then
+        if test -f /usr/local/include/sqlite3.h; then
+           SQLITE_INCDIR=/usr/local/include
+           if test -d /usr/local/lib64; then
+              SQLITE_LIBDIR=/usr/local/lib64
+           else
+              SQLITE_LIBDIR=/usr/local/lib
+           fi
+           SQLITE_BINDIR=/usr/local/bin
+        elif test -f /usr/include/sqlite3.h; then
+           SQLITE_INCDIR=/usr/include
+           if test -d /usr/lib64; then
+              SQLITE_LIBDIR=/usr/lib64
+           else
+              SQLITE_LIBDIR=/usr/lib
+           fi
+           SQLITE_BINDIR=/usr/bin      
+        elif test -f $prefix/include/sqlite3.h; then
+           SQLITE_INCDIR=$prefix/include
+           if test -d $prefix/lib64; then
+              SQLITE_LIBDIR=$prefix/lib64
+           else
+              SQLITE_LIBDIR=$prefix/lib
+           fi
+           SQLITE_BINDIR=$prefix/bin      
+        else
+           AC_MSG_RESULT(no)
+           AC_MSG_ERROR(Unable to find sqlite3.h in standard locations)
+        fi
+     else
+        if test -f $withval/sqlite3.h; then
+           SQLITE_INCDIR=$withval
+           SQLITE_LIBDIR=$withval
+           SQLITE_BINDIR=$withval
+        elif test -f $withval/include/sqlite3.h; then
+           SQLITE_INCDIR=$withval/include
+           if test -d $withval/lib64; then
+              SQLITE_LIBDIR=$withval/lib64
+           else
+              SQLITE_LIBDIR=$withval/lib
+           fi
+           SQLITE_BINDIR=$withval/bin
+        else
+           AC_MSG_RESULT(no)
+           AC_MSG_ERROR(Invalid SQLite3 directory $withval - unable to find sqlite3.h under $withval)
+        fi
+     fi
+     SQL_INCLUDE=-I$SQLITE_INCDIR
+     SQL_LFLAGS="-L$SQLITE_LIBDIR -lsqlite3"
+     SQL_BINDIR=$SQLITE_BINDIR
+     SQL_LIB=$SQLITE_LIBDIR/libsqlite3.a
+
+     AC_DEFINE(HAVE_SQLITE3)
+     AC_MSG_RESULT(yes)
+     db_found=yes
+     support_sqlite3=yes
+     db_type=SQLite3
+     DB_TYPE=sqlite3
+
+  else
+     AC_MSG_RESULT(no)
+  fi
+],[
+  AC_MSG_RESULT(no)
+])
+AC_SUBST(SQL_LFLAGS)
+AC_SUBST(SQL_INCLUDE)
+AC_SUBST(SQL_BINDIR)
+  
+])
+
+
+
+AC_DEFUN([BA_CHECK_POSTGRESQL_DB],
+[
+db_found=no
+AC_MSG_CHECKING(for PostgreSQL support)
+AC_ARG_WITH(postgresql,
+[  --with-postgresql@<:@=DIR@:>@      Include PostgreSQL support.  DIR is the PostgreSQL
+                          base install directory, defaults to /usr/local/pgsql],
+[
+  if test "$withval" != "no"; then
+      if test "$db_found" = "yes"; then
+          AC_MSG_RESULT(error)
+          AC_MSG_ERROR("You can configure for only one database.");
+      fi
+      if test "$withval" = "yes"; then
+          PG_CONFIG=`which pg_config`
+          if test -n "$PG_CONFIG";then
+              POSTGRESQL_INCDIR=`"$PG_CONFIG" --includedir`
+              POSTGRESQL_LIBDIR=`"$PG_CONFIG" --libdir`
+              POSTGRESQL_BINDIR=`"$PG_CONFIG" --bindir`
+          elif test -f /usr/local/include/libpq-fe.h; then
+              POSTGRESQL_INCDIR=/usr/local/include
+              if test -d /usr/local/lib64; then
+                 POSTGRESQL_LIBDIR=/usr/local/lib64
+              else
+                 POSTGRESQL_LIBDIR=/usr/local/lib
+              fi
+              POSTGRESQL_BINDIR=/usr/local/bin
+          elif test -f /usr/include/libpq-fe.h; then
+              POSTGRESQL_INCDIR=/usr/include
+              if test -d /usr/lib64; then
+                 POSTGRESQL_LIBDIR=/usr/lib64
+              else
+                 POSTGRESQL_LIBDIR=/usr/lib
+              fi
+              POSTGRESQL_BINDIR=/usr/bin
+          elif test -f /usr/include/pgsql/libpq-fe.h; then
+              POSTGRESQL_INCDIR=/usr/include/pgsql
+              if test -d /usr/lib64/pgsql; then
+                 POSTGRESQL_LIBDIR=/usr/lib64/pgsql
+              else
+                 POSTGRESQL_LIBDIR=/usr/lib/pgsql
+              fi
+              POSTGRESQL_BINDIR=/usr/bin
+          elif test -f /usr/include/postgresql/libpq-fe.h; then
+              POSTGRESQL_INCDIR=/usr/include/postgresql
+              if test -d /usr/lib64/postgresql; then
+                 POSTGRESQL_LIBDIR=/usr/lib64/postgresql
+              else
+                 POSTGRESQL_LIBDIR=/usr/lib/postgresql
+              fi
+              POSTGRESQL_BINDIR=/usr/bin
+          else
+              AC_MSG_RESULT(no)
+              AC_MSG_ERROR(Unable to find libpq-fe.h in standard locations)
+          fi
+      elif test -f $withval/include/libpq-fe.h; then
+          POSTGRESQL_INCDIR=$withval/include
+          POSTGRESQL_LIBDIR=$withval/lib
+          POSTGRESQL_BINDIR=$withval/bin
+      elif test -f $withval/include/postgresql/libpq-fe.h; then
+          POSTGRESQL_INCDIR=$withval/include/postgresql
+     if test -d $withval/lib64; then
+         POSTGRESQL_LIBDIR=$withval/lib64
+     else
+         POSTGRESQL_LIBDIR=$withval/lib
+     fi
+          POSTGRESQL_BINDIR=$withval/bin
+      else
+          AC_MSG_RESULT(no)
+          AC_MSG_ERROR(Invalid PostgreSQL directory $withval - unable to find libpq-fe.h under $withval)
+      fi
+      POSTGRESQL_LFLAGS="-L$POSTGRESQL_LIBDIR -lpq"
+      AC_CHECK_FUNC(crypt, , AC_CHECK_LIB(crypt, crypt, [POSTGRESQL_LFLAGS="$POSTGRESQL_LFLAGS -lcrypt"]))
+      SQL_INCLUDE=-I$POSTGRESQL_INCDIR
+      SQL_LFLAGS=$POSTGRESQL_LFLAGS
+      SQL_BINDIR=$POSTGRESQL_BINDIR
+      SQL_LIB=$POSTGRESQL_LIBDIR/libpq.a
+
+      AC_DEFINE(HAVE_POSTGRESQL)
+      AC_MSG_RESULT(yes)
+      db_found=yes
+      support_postgresql=yes
+      db_type=PostgreSQL
+      DB_TYPE=postgresql
+  else
+      AC_MSG_RESULT(no)
+  fi
+],[
+  AC_MSG_RESULT(no)
+])
+AC_SUBST(SQL_LFLAGS)
+AC_SUBST(SQL_INCLUDE)
+AC_SUBST(SQL_BINDIR)
+
+])
+
+
+
+AC_DEFUN([BA_CHECK_SQL_DB], 
+[AC_MSG_CHECKING(Checking for various databases)
+dnl# --------------------------------------------------------------------------
+dnl# CHECKING FOR VARIOUS DATABASES (thanks to UdmSearch team)
+dnl# --------------------------------------------------------------------------
+dnl Check for some DBMS backend
+dnl NOTE: we can use only one backend at a time
+db_found=no
+DB_TYPE=none
+
+if test x$support_mysql = xyes; then
+   cats=cats
+fi
+
+AC_MSG_CHECKING(for Berkeley DB support)
+AC_ARG_WITH(berkeleydb,
+[
+  --with-berkeleydb@<:@=DIR@:>@ Include Berkeley DB support.  DIR is the Berkeley DB base
+                          install directory, default is to search through
+                          a number of common places for the DB files.],
+[
+  if test "$withval" != "no"; then
+        if test "$withval" = "yes"; then
+                if test -f /usr/include/db.h; then
+                        BERKELEYDB_INCDIR=/usr/include
+                        if test -d /usr/lib64; then
+                                BERKELEYDB_LIBDIR=/usr/lib64
+                        else
+                                BERKELEYDB_LIBDIR=/usr/lib
+                        fi
+                else
+                AC_MSG_RESULT(no)
+                AC_MSG_ERROR(Invalid Berkeley DB directory - unable to find db.h)
+                fi
+        else
+                if test -f $withval/include/db.h; then
+                        BERKELEYDB_INCDIR=$withval/include
+                        if test -d $withval/lib64; then
+                                BERKELEYDB_LIBDIR=$withval/lib64
+                        else
+                                BERKELEYDB_LIBDIR=$withval/lib
+                        fi
+                else
+                AC_MSG_RESULT(no)
+                AC_MSG_ERROR(Invalid Berkeley DB directory - unable to find db.h under $withval)
+                fi
+        fi
+    SQL_INCLUDE=-I$BERKELEYDB_INCDIR
+    SQL_LFLAGS="-L$BERKELEYDB_LIBDIR -ldb"
+
+    AC_DEFINE(HAVE_BERKELEY_DB)
+    AC_MSG_RESULT(yes)
+    have_db=yes
+    support_mysql=yes
+    DB_TYPE=BerkelyDB
+
+  else
+        AC_MSG_RESULT(no)
+  fi
+],[
+  AC_MSG_RESULT(no)
+])
+AC_SUBST(SQL_LFLAGS)
+AC_SUBST(SQL_INCLUDE)
+
+if test x$support_berkleydb = xyes; then
+   cats=cats
+fi
+
+
+
+
+AC_MSG_CHECKING(for mSQL support)
+AC_ARG_WITH(msql,
+[  --with-msql@<:@=DIR@:>       Include mSQL support.  DIR is the mSQL base
+                          install directory, defaults to /usr/local/Hughes.],
+[
+  if test "$withval" != "no"; then
+    if test "$have_db" = "yes"; then
+        AC_MSG_RESULT(error)
+        AC_MSG_ERROR("You can configure for only one database.");
+    fi
+
+    if test "$withval" = "yes"; then
+        MSQL_INCDIR=/usr/local/Hughes/include
+        if test -d /usr/local/Hughes/lib64; then
+            MSQL_LIBDIR=/usr/local/Hughes/lib64
+        else
+            MSQL_LIBDIR=/usr/local/Hughes/lib
+        fi
+    else
+        MSQL_INCDIR=$withval/include
+        if test -d $withval/lib64; then
+            MSQL_LIBDIR=$withval/lib64
+        else
+            MSQL_LIBDIR=$withval/lib
+        fi
+    fi
+    MSQL_INCLUDE=-I$MSQL_INCDIR
+    MSQL_LFLAGS="-L$MSQL_LIBDIR -lmsql"
+
+    AC_DEFINE(HAVE_MSQL)
+    AC_MSG_RESULT(yes)
+    have_db=yes
+  else
+        AC_MSG_RESULT(no)
+  fi
+],[
+  AC_MSG_RESULT(no)
+])
+AC_SUBST(MSQL_LFLAGS)
+AC_SUBST(MSQL_INCLUDE)
+
+
+AC_MSG_CHECKING(for iODBC support)
+AC_ARG_WITH(iodbc,
+[  --with-iodbc@<:@=DIR@:>      Include iODBC support.  DIR is the iODBC base
+                          install directory, defaults to /usr/local.],
+[
+        if test "$withval" != "no"; then
+            if test "$have_db" = "yes"; then
+                AC_MSG_RESULT(error)
+                AC_MSG_ERROR("You can configure for only one database.");
+            fi
+        fi
+        
+        if test "$withval" = "yes"; then
+                withval=/usr/local
+        fi
+
+        if test "$withval" != "no"; then
+                if test -f $withval/include/isql.h; then
+                        IODBC_INCDIR=$withval/include
+                        if test -d $withval/lib64; then
+                                IODBC_LIBDIR=$withval/lib64
+                        else
+                                IODBC_LIBDIR=$withval/lib
+                        fi
+                else
+                        AC_MSG_RESULT(no)
+                        AC_MSG_ERROR(Invalid iODBC directory - unable to find isql.h)
+                fi
+                IODBC_LFLAGS="-L$IODBC_LIBDIR -liodbc"
+                IODBC_INCLUDE=-I$IODBC_INCDIR
+                AC_DEFINE(HAVE_IODBC)
+                AC_MSG_RESULT(yes)
+                have_db=yes
+        fi
+],[
+        AC_MSG_RESULT(no)
+])
+AC_SUBST(IODBC_LFLAGS)
+AC_SUBST(IODBC_INCLUDE)
+
+
+AC_MSG_CHECKING(for unixODBC support)
+AC_ARG_WITH(unixODBC,
+[  --with-unixODBC@<:@=DIR@:>   Include unixODBC support.  DIR is the unixODBC base
+                          install directory, defaults to /usr/local.],
+[
+        if test "$withval" != "no"; then
+            if test "$have_db" = "yes"; then
+                AC_MSG_RESULT(error)
+                AC_MSG_ERROR("You can configure for only one database.");
+            fi
+        fi
+        
+        if test "$withval" = "yes"; then
+                withval=/usr/local
+        fi
+
+        if test "$withval" != "no"; then
+                if test -f $withval/include/sql.h; then
+                        UNIXODBC_INCDIR=$withval/include
+                        if test -d $withval/lib64; then
+                                UNIXODBC_LIBDIR=$withval/lib64
+                        else
+                                UNIXODBC_LIBDIR=$withval/lib
+                        fi
+                else
+                        AC_MSG_RESULT(no)
+                        AC_MSG_ERROR(Invalid unixODBC directory - unable to find sql.h)
+                fi
+                UNIXODBC_LFLAGS="-L$UNIXODBC_LIBDIR -lodbc"
+                UNIXODBC_INCLUDE=-I$UNIXODBC_INCDIR
+                AC_DEFINE(HAVE_UNIXODBC)
+                AC_MSG_RESULT(yes)
+                have_db=yes
+        fi
+],[
+        AC_MSG_RESULT(no)
+])
+AC_SUBST(UNIXODBC_LFLAGS)
+AC_SUBST(UNIXODBC_INCLUDE)
+
+
+AC_MSG_CHECKING(for Solid support)
+AC_ARG_WITH(solid,
+[  --with-solid@<:@=DIR@:>      Include Solid support.  DIR is the Solid base
+                          install directory, defaults to /usr/local.],
+[
+        if test "$withval" != "no"; then
+            if test "$have_db" = "yes"; then
+                AC_MSG_RESULT(error)
+                AC_MSG_ERROR("You can configure for only one database.");
+            fi
+        fi
+
+        if test "$withval" = "yes"; then
+                withval=/usr/local
+        fi
+
+        if test "$withval" != "no"; then
+                if test -f $withval/include/cli0cli.h; then
+                        SOLID_INCDIR=$withval/include
+                        if test -d $withval/lib64; then
+                                SOLID_LIBDIR=$withval/lib64
+                        else
+                                SOLID_LIBDIR=$withval/lib
+                        fi
+                else
+                        AC_MSG_RESULT(no)
+                        AC_MSG_ERROR(Invalid Solid directory - unable to find cli0cli.h)
+                fi
+                SOLID_LFLAGS="-L$SOLID_LIBDIR -lsolcli"
+                SOLID_INCLUDE="-I$SOLID_INCDIR"
+                AC_DEFINE(HAVE_SOLID)
+                AC_MSG_RESULT(yes)
+                have_db=yes
+        fi
+],[
+        AC_MSG_RESULT(no)
+])
+AC_SUBST(SOLID_LFLAGS)
+AC_SUBST(SOLID_INCLUDE)
+
+AC_MSG_CHECKING(for OpenLink ODBC support)
+AC_ARG_WITH(openlink,
+[  --with-openlink@<:@=DIR@:>   Include OpenLink ODBC support. 
+                          DIR is the base OpenLink ODBC install directory],
+[
+  if test "$withval" != "no"; then
+        if test "$withval" = "yes"; then
+
+                if test "$have_db" = "yes"; then
+                        AC_MSG_RESULT(error)
+                        AC_MSG_ERROR("You can configure for only one database.");
+                fi
+
+                if test -f /usr/local/virtuoso-ent/odbcsdk/include/isql.h; then
+                        VIRT_INCDIR=/usr/local/virtuoso-ent/odbcsdk/include/
+                        if test -d /usr/local/virtuoso-ent/odbcsdk/lib64/; then
+                                VIRT_LIBDIR=/usr/local/virtuoso-ent/odbcsdk/lib64/
+                        else
+                                VIRT_LIBDIR=/usr/local/virtuoso-ent/odbcsdk/lib/
+                        fi
+                elif test -f /usr/local/virtuoso-lite/odbcsdk/include/isql.h; then
+                        VIRT_INCDIR=/usr/local/virtuoso-lite/odbcsdk/include/
+                        if test -d /usr/local/virtuoso-lite/odbcsdk/lib64/; then
+                                VIRT_LIBDIR=/usr/local/virtuoso-lite/odbcsdk/lib64/
+                        else
+                                VIRT_LIBDIR=/usr/local/virtuoso-lite/odbcsdk/lib/
+                        fi
+                elif test -f /usr/local/virtuoso/odbcsdk/include/isql.h; then
+                        VIRT_INCDIR=/usr/local/virtuoso/odbcsdk/include/
+                        if test -d /usr/local/virtuoso/odbcsdk/lib64/; then
+                                VIRT_LIBDIR=/usr/local/virtuoso/odbcsdk/lib64/
+                        else
+                                VIRT_LIBDIR=/usr/local/virtuoso/odbcsdk/lib/
+                        fi
+                else
+                AC_MSG_RESULT(no)
+                AC_MSG_ERROR(Invalid OpenLink ODBC directory - unable to find isql.h)
+                fi
+        else
+                if test -f $withval/odbcsdk/include/isql.h; then
+                        VIRT_INCDIR=$withval/odbcsdk/include/
+                        if test -d $withval/odbcsdk/lib64/; then
+                                VIRT_LIBDIR=$withval/odbcsdk/lib64/
+                        else
+                                VIRT_LIBDIR=$withval/odbcsdk/lib/
+                        fi
+                elif test -f $withval/include/isql.h; then
+                        VIRT_INCDIR=$withval/include/
+                        if test -d $withval/lib64/; then
+                                VIRT_LIBDIR=$withval/lib64/
+                        else
+                                VIRT_LIBDIR=$withval/lib/
+                        fi
+                else
+                AC_MSG_RESULT(no)
+                AC_MSG_ERROR(Invalid OpenLink ODBC directory - unable to find isql.h under $withval)
+                fi
+        fi
+    VIRT_INCLUDE=-I$VIRT_INCDIR
+    VIRT_LFLAGS="-L$VIRT_LIBDIR -liodbc"
+
+    AC_DEFINE(HAVE_VIRT)
+    AC_MSG_RESULT(yes)
+    have_db=yes
+
+  else
+        AC_MSG_RESULT(no)
+  fi
+],[
+  AC_MSG_RESULT(no)
+])
+AC_SUBST(VIRT_LFLAGS)
+AC_SUBST(VIRT_INCLUDE)
+
+
+AC_MSG_CHECKING(for EasySoft ODBC support)
+AC_ARG_WITH(easysoft,
+[  --with-easysoft@<:@=DIR@:>   Include EasySoft ODBC support. 
+                          DIR is the base EasySoft ODBC install directory],
+[
+  if test "$withval" != "no"; then
+        if test "$withval" = "yes"; then
+
+                if test "$have_db" = "yes"; then
+                        AC_MSG_RESULT(error)
+                        AC_MSG_ERROR("You can configure for only one database.");
+                fi
+
+                if test -f /usr/local/easysoft/oob/client/include/sql.h; then
+                        EASYSOFT_INCDIR=/usr/local/easysoft/oob/client/include/
+                        if test -d /usr/local/easysoft/oob/client/lib64/; then
+                                EASYSOFT_LFLAGS="-L/usr/local/easysoft/oob/client/lib64/ -L/usr/local/easysoft/lib64"
+                        else
+                                EASYSOFT_LFLAGS="-L/usr/local/easysoft/oob/client/lib/ -L/usr/local/easysoft/lib"
+                        fi
+                else
+                AC_MSG_RESULT(no)
+                AC_MSG_ERROR(Invalid EasySoft ODBC directory - unable to find sql.h)
+                fi
+        else
+                if test -f $withval/easysoft/oob/client/include/sql.h; then
+                        EASYSOFT_INCDIR=$withval/easysoft/oob/client/include/
+                        if test -d $withval/easysoft/oob/client/lib64/; then
+                                EASYSOFT_LFLAGS="-L$withval/easysoft/oob/client/lib64/ -L$withval/easysoft/lib64"
+                        else
+                                EASYSOFT_LFLAGS="-L$withval/easysoft/oob/client/lib/ -L$withval/easysoft/lib"
+                        fi
+                else
+                AC_MSG_RESULT(no)
+                AC_MSG_ERROR(Invalid EasySoft ODBC directory - unable to find sql.h under $withval)
+                fi
+        fi
+    EASYSOFT_INCLUDE=-I$EASYSOFT_INCDIR
+    EASYSOFT_LFLAGS="$EASYSOFT_LFLAGS -lesoobclient -lesrpc -lsupport -lextra"
+
+    AC_DEFINE(HAVE_EASYSOFT)
+    AC_MSG_RESULT(yes)
+    have_db=yes
+
+  else
+        AC_MSG_RESULT(no)
+  fi
+],[
+  AC_MSG_RESULT(no)
+])
+AC_SUBST(EASYSOFT_LFLAGS)
+AC_SUBST(EASYSOFT_INCLUDE)
+
+
+
+AC_MSG_CHECKING(for InterBase support)
+AC_ARG_WITH(ibase,
+[  --with-ibase@<:@=DIR@:>      Include InterBase support.  DIR is the InterBase
+                          install directory, defaults to /usr/interbase.],
+[
+        if test "$withval" != "no"; then
+            if test "$have_db" = "yes"; then
+                AC_MSG_RESULT(error)
+                AC_MSG_ERROR("You can configure for only one database.");
+            fi
+        fi
+        
+        if test "$withval" = "yes"; then
+                withval=/usr/interbase
+        fi
+
+        if test "$withval" != "no"; then
+                if test -f $withval/include/ibase.h; then
+                        IBASE_INCDIR=$withval/include
+                        if test -d $withval/lib64; then
+                                IBASE_LIBDIR=$withval/lib64
+                        else
+                                IBASE_LIBDIR=$withval/lib
+                        fi
+                else
+                        AC_MSG_RESULT(no)
+                        AC_MSG_ERROR(Invalid InterBase directory - unable to find ibase.h)
+                fi
+                IBASE_LFLAGS="-L$IBASE_LIBDIR -lgds"
+                IBASE_INCLUDE=-I$IBASE_INCDIR
+                AC_DEFINE(HAVE_IBASE)
+                AC_MSG_RESULT(yes)
+                have_db=yes
+        fi
+],[
+        AC_MSG_RESULT(no)
+])
+AC_SUBST(IBASE_LFLAGS)
+AC_SUBST(IBASE_INCLUDE)
+
+AC_MSG_CHECKING(for Oracle8 support)
+AC_ARG_WITH(oracle8,
+[  --with-oracle8@<:@=DIR@:>    Include Oracle8 support.  DIR is the Oracle
+                          home directory, defaults to $ORACLE_HOME or
+                          /oracle8/app/oracle/product/8.0.5.],
+[
+        if test "$withval" != "no"; then
+            if test "$have_db" = "yes"; then
+                AC_MSG_RESULT(error)
+                AC_MSG_ERROR("You can configure for only one database.");
+            fi
+        fi
+
+        if test "$withval" = "yes"; then
+                withval="$ORACLE_HOME"
+                if test "$withval" = ""; then
+                        withval=/oracle8/app/oracle/product/8.0.5
+                fi
+        fi
+
+        if test "$withval" != "no"; then
+                if test -f $withval/rdbms/demo/oci.h; then
+                        ORACLE8_INCDIR1=$withval/rdbms/demo/
+                        ORACLE8_INCDIR2=$withval/rdbms/public/:
+                        ORACLE8_INCDIR3=$withval/network/public/
+                        ORACLE8_INCDIR4=$withval/plsql/public/
+                        if test -d $withval/lib64; then
+                                ORACLE8_LIBDIR1=$withval/lib64
+                        else
+                                ORACLE8_LIBDIR1=$withval/lib
+                        fi
+                        if test -d $withval/rdbms/lib64; then
+                               ORACLE8_LIBDIR2=$withval/rdbms/lib64
+                        else
+                                ORACLE8_LIBDIR2=$withval/rdbms/lib
+                        fi
+                else
+                        AC_MSG_RESULT(no)
+                        AC_MSG_ERROR(Invalid ORACLE directory - unable to find oci.h)
+                fi
+                if test -f $withval/lib64/libclntsh.so; then
+                        ORACLE8_LFLAGS="-L$ORACLE8_LIBDIR1 -L$ORACLE8_LIBDIR2 $withval/lib64/libclntsh.so -lmm -lepc -lclient -lvsn -lcommon -lgeneric -lcore4 -lnlsrtl3 -lnsl -lm -ldl -lnetv2 -lnttcp -lnetwork -lncr -lsql"
+                else
+                        ORACLE8_LFLAGS="-L$ORACLE8_LIBDIR1 -L$ORACLE8_LIBDIR2 $withval/lib/libclntsh.so -lmm -lepc -lclient -lvsn -lcommon -lgeneric -lcore4 -lnlsrtl3 -lnsl -lm -ldl -lnetv2 -lnttcp -lnetwork -lncr -lsql"
+                fi
+                ORACLE8_INCLUDE="-I$ORACLE8_INCDIR1 -I$ORACLE8_INCDIR2 -I$ORACLE8_INCDIR3 -I$ORACLE8_INCDIR4"
+                AC_DEFINE(HAVE_ORACLE8)
+                AC_MSG_RESULT(yes)
+                have_db=yes
+        fi
+],[
+        AC_MSG_RESULT(no)
+])
+AC_SUBST(ORACLE8_LFLAGS)
+AC_SUBST(ORACLE8_INCLUDE)
+
+
+AC_MSG_CHECKING(for Oracle7 support)
+AC_ARG_WITH(oracle7,
+[  --with-oracle7@<:@=DIR@:>    Include Oracle 7.3 support.  DIR is the Oracle
+                          home directory, defaults to 
+                          ORACLE_HOME [$ORACLE_HOME]],
+[
+        if test "$withval" != "no"; then
+            if test "$have_db" = "yes"; then
+                AC_MSG_RESULT(error)
+                AC_MSG_ERROR("You can configure for only one database.");
+            fi
+        fi
+
+        if test "$withval" = "yes"; then
+                withval="$ORACLE_HOME"
+        fi
+
+        if test "$withval" != "no"; then
+                if test -f $withval/rdbms/demo/ocidfn.h; then
+                        ORACLE7_INCDIR=$withval/rdbms/demo/
+                        if test -d $withval/lib64; then
+                                ORACLE7_LIBDIR1=$withval/lib64
+                        else
+                                ORACLE7_LIBDIR1=$withval/lib
+                        fi
+                        if test -d $withval/rdbms/lib64; then
+                                ORACLE7_LIBDIR2=$withval/rdbms/lib64
+                        else
+                                ORACLE7_LIBDIR2=$withval/rdbms/lib
+                        fi
+                else
+                        AC_MSG_RESULT(no)
+                        AC_MSG_ERROR(Invalid ORACLE directory - unable to find ocidfn.h)
+                fi
+
+        ORACLEINST_TOP=$withval
+        if test -f "$ORACLEINST_TOP/rdbms/lib/sysliblist"
+        then
+          ORA_SYSLIB="`cat $ORACLEINST_TOP/rdbms/lib/sysliblist`"
+        elif test -f "$ORACLEINST_TOP/rdbms/lib64/sysliblist"
+        then
+          ORA_SYSLIB="`cat $ORACLEINST_TOP/rdbms/lib64/sysliblist`"
+        elif test -f "$ORACLEINST_TOP/lib/sysliblist"
+            then
+          ORA_SYSLIB="`cat $ORACLEINST_TOP/lib/sysliblist`"
+        elif test -f "$ORACLEINST_TOP/lib64/sysliblist"
+            then
+          ORA_SYSLIB="`cat $ORACLEINST_TOP/lib64/sysliblist`"
+        else
+          ORA_SYSLIB="-lm"
+        fi
+          
+                ORACLE7_LFLAGS="-L$ORACLE7_LIBDIR1 -L$ORACLE7_LIBDIR2 \
+            -lclient -lsqlnet -lncr -lsqlnet -lclient -lcommon \
+            -lgeneric -lsqlnet -lncr -lsqlnet -lclient -lcommon -lgeneric \
+            -lepc -lnlsrtl3 -lc3v6 -lcore3 -lnlsrtl3 -lcore3 -lnlsrtl3 \
+            $ORA_SYSLIB -lcore3 $ORA_SYSLIB"
+                ORACLE7_INCLUDE="-I$ORACLE7_INCDIR "
+                AC_DEFINE(HAVE_ORACLE7)
+                AC_MSG_RESULT(yes)
+                have_db=yes
+        fi
+],[
+        AC_MSG_RESULT(no)
+])
+AC_SUBST(ORACLE7_LFLAGS)
+AC_SUBST(ORACLE7_INCLUDE)
+])
+  
+
+AC_DEFUN([AM_CONDITIONAL],
+[AC_SUBST($1_TRUE)
+AC_SUBST($1_FALSE)
+if $2; then
+  $1_TRUE=
+  $1_FALSE='#'
+else
+  $1_TRUE='#'
+  $1_FALSE=
+fi])
index 57ab373d82252a464c52794dc75270eba2f3d412..4a2830bf1dc574da267945c441b86cc4e2463cdb 100755 (executable)
@@ -833,9 +833,15 @@ sd_group
 fd_user
 fd_group
 SBINPERM
+SQL_LFLAGS
+SQL_INCLUDE
+SQL_BINDIR
+DBI_DBD_DRIVERDIR
+uncomment_dbi
+DB_PROG
+DB_PROG_LIB
 cats
 DB_TYPE
-uncomment_dbi
 GETCONF
 XMKMF
 X_CFLAGS
@@ -1521,6 +1527,32 @@ Optional Packages:
   --with-fd-user=USER           specify user for File daemon
   --with-fd-group=GROUP                 specify group for File daemon
   --with-sbin-perm=MODE                 specify permissions for sbin binaries (0754)
+  --with-postgresql[=DIR]      Include PostgreSQL support.  DIR is the PostgreSQL
+                          base install directory, defaults to /usr/local/pgsql
+
+  --with-mysql[=DIR]      Include MySQL support.  DIR is the MySQL base
+                          install directory, default is to search through
+                          a number of common places for the MySQL files.
+
+  --with-embedded-mysql[=DIR] Include MySQL support.  DIR is the MySQL base
+                          install directory, default is to search through
+                          a number of common places for the MySQL files.
+
+  --with-sqlite3[=DIR]    Include SQLite3 support.  DIR is the SQLite3 base
+                          install directory, default is to search through
+                          a number of common places for the SQLite3 files.
+
+  --with-sqlite[=DIR]     Include SQLite support.  DIR is the SQLite base
+                          install directory, default is to search through
+                          a number of common places for the SQLite files.
+
+  --with-dbi[=DIR]     Include DBI support.  DIR is the DBD base
+                          install directory, default is to search through
+                          a number of common places for the DBI files.
+
+  --with-dbi-driver[=DRIVER]     Suport for DBI driver.  DRIVER is
+                          the one DBI driver like Mysql, Postgresql, others.
+                          Default is to not configure any driver.
   --with-x                use the X Window System
 
 Some influential environment variables:
@@ -5592,7 +5624,6 @@ else
   HAVE_DARWIN_OS_TRUE='#'
   HAVE_DARWIN_OS_FALSE=
 fi
-
     cat >>confdefs.h <<\_ACEOF
 #define HAVE_DARWIN_OS 1
 _ACEOF
@@ -5607,7 +5638,6 @@ else
   HAVE_DARWIN_OS_TRUE='#'
   HAVE_DARWIN_OS_FALSE=
 fi
-
 fi
 
 
 # Bacula check for various SQL database engines
 # ------------------------------------------------
 SQL_LIB=
-BA_CHECK_POSTGRESQL_DB
 
-BA_CHECK_MYSQL_DB
+db_found=no
+{ echo "$as_me:$LINENO: checking for PostgreSQL support" >&5
+echo $ECHO_N "checking for PostgreSQL support... $ECHO_C" >&6; }
+
+# Check whether --with-postgresql was given.
+if test "${with_postgresql+set}" = set; then
+  withval=$with_postgresql;
+  if test "$withval" != "no"; then
+      if test "$db_found" = "yes"; then
+          { echo "$as_me:$LINENO: result: error" >&5
+echo "${ECHO_T}error" >&6; }
+          { { echo "$as_me:$LINENO: error: \"You can configure for only one database.\"" >&5
+echo "$as_me: error: \"You can configure for only one database.\"" >&2;}
+   { (exit 1); exit 1; }; };
+      fi
+      if test "$withval" = "yes"; then
+          PG_CONFIG=`which pg_config`
+          if test -n "$PG_CONFIG";then
+              POSTGRESQL_INCDIR=`"$PG_CONFIG" --includedir`
+              POSTGRESQL_LIBDIR=`"$PG_CONFIG" --libdir`
+              POSTGRESQL_BINDIR=`"$PG_CONFIG" --bindir`
+          elif test -f /usr/local/include/libpq-fe.h; then
+              POSTGRESQL_INCDIR=/usr/local/include
+              if test -d /usr/local/lib64; then
+                 POSTGRESQL_LIBDIR=/usr/local/lib64
+              else
+                 POSTGRESQL_LIBDIR=/usr/local/lib
+              fi
+              POSTGRESQL_BINDIR=/usr/local/bin
+          elif test -f /usr/include/libpq-fe.h; then
+              POSTGRESQL_INCDIR=/usr/include
+              if test -d /usr/lib64; then
+                 POSTGRESQL_LIBDIR=/usr/lib64
+              else
+                 POSTGRESQL_LIBDIR=/usr/lib
+              fi
+              POSTGRESQL_BINDIR=/usr/bin
+          elif test -f /usr/include/pgsql/libpq-fe.h; then
+              POSTGRESQL_INCDIR=/usr/include/pgsql
+              if test -d /usr/lib64/pgsql; then
+                 POSTGRESQL_LIBDIR=/usr/lib64/pgsql
+              else
+                 POSTGRESQL_LIBDIR=/usr/lib/pgsql
+              fi
+              POSTGRESQL_BINDIR=/usr/bin
+          elif test -f /usr/include/postgresql/libpq-fe.h; then
+              POSTGRESQL_INCDIR=/usr/include/postgresql
+              if test -d /usr/lib64/postgresql; then
+                 POSTGRESQL_LIBDIR=/usr/lib64/postgresql
+              else
+                 POSTGRESQL_LIBDIR=/usr/lib/postgresql
+              fi
+              POSTGRESQL_BINDIR=/usr/bin
+          else
+              { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+              { { echo "$as_me:$LINENO: error: Unable to find libpq-fe.h in standard locations" >&5
+echo "$as_me: error: Unable to find libpq-fe.h in standard locations" >&2;}
+   { (exit 1); exit 1; }; }
+          fi
+      elif test -f $withval/include/libpq-fe.h; then
+          POSTGRESQL_INCDIR=$withval/include
+          POSTGRESQL_LIBDIR=$withval/lib
+          POSTGRESQL_BINDIR=$withval/bin
+      elif test -f $withval/include/postgresql/libpq-fe.h; then
+          POSTGRESQL_INCDIR=$withval/include/postgresql
+     if test -d $withval/lib64; then
+         POSTGRESQL_LIBDIR=$withval/lib64
+     else
+         POSTGRESQL_LIBDIR=$withval/lib
+     fi
+          POSTGRESQL_BINDIR=$withval/bin
+      else
+          { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+          { { echo "$as_me:$LINENO: error: Invalid PostgreSQL directory $withval - unable to find libpq-fe.h under $withval" >&5
+echo "$as_me: error: Invalid PostgreSQL directory $withval - unable to find libpq-fe.h under $withval" >&2;}
+   { (exit 1); exit 1; }; }
+      fi
+      POSTGRESQL_LFLAGS="-L$POSTGRESQL_LIBDIR -lpq"
+      { echo "$as_me:$LINENO: checking for crypt" >&5
+echo $ECHO_N "checking for crypt... $ECHO_C" >&6; }
+if test "${ac_cv_func_crypt+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define crypt to an innocuous variant, in case <limits.h> declares crypt.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define crypt innocuous_crypt
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char crypt (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef crypt
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char crypt ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_crypt || defined __stub___crypt
+choke me
+#endif
+
+int
+main ()
+{
+return crypt ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_crypt=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_func_crypt=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_crypt" >&5
+echo "${ECHO_T}$ac_cv_func_crypt" >&6; }
+if test $ac_cv_func_crypt = yes; then
+  :
+else
+  { echo "$as_me:$LINENO: checking for crypt in -lcrypt" >&5
+echo $ECHO_N "checking for crypt in -lcrypt... $ECHO_C" >&6; }
+if test "${ac_cv_lib_crypt_crypt+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcrypt  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char crypt ();
+int
+main ()
+{
+return crypt ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_crypt_crypt=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_crypt_crypt=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_crypt_crypt" >&5
+echo "${ECHO_T}$ac_cv_lib_crypt_crypt" >&6; }
+if test $ac_cv_lib_crypt_crypt = yes; then
+  POSTGRESQL_LFLAGS="$POSTGRESQL_LFLAGS -lcrypt"
+fi
+
+fi
+
+      SQL_INCLUDE=-I$POSTGRESQL_INCDIR
+      SQL_LFLAGS=$POSTGRESQL_LFLAGS
+      SQL_BINDIR=$POSTGRESQL_BINDIR
+      SQL_LIB=$POSTGRESQL_LIBDIR/libpq.a
+
+      cat >>confdefs.h <<\_ACEOF
+#define HAVE_POSTGRESQL 1
+_ACEOF
+
+      { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+      db_found=yes
+      support_postgresql=yes
+      db_type=PostgreSQL
+      DB_TYPE=postgresql
+  else
+      { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+  fi
+
+else
+
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+
+fi
+
+
+
+
+
+
+
+
+db_found=no
+{ echo "$as_me:$LINENO: checking for MySQL support" >&5
+echo $ECHO_N "checking for MySQL support... $ECHO_C" >&6; }
+
+# Check whether --with-mysql was given.
+if test "${with_mysql+set}" = set; then
+  withval=$with_mysql;
+  if test "$withval" != "no"; then
+        if test "$withval" = "yes"; then
+           if test -f /usr/local/mysql/include/mysql/mysql.h; then
+                   MYSQL_INCDIR=/usr/local/mysql/include/mysql
+                   if test -f /usr/local/mysql/lib64/mysql/libmysqlclient_r.a \
+                        -o -f /usr/local/mysql/lib64/mysql/libmysqlclient_r.so; then
+                           MYSQL_LIBDIR=/usr/local/mysql/lib64/mysql
+                   else
+                           MYSQL_LIBDIR=/usr/local/mysql/lib/mysql
+                   fi
+                   MYSQL_BINDIR=/usr/local/mysql/bin
+           elif test -f /usr/include/mysql/mysql.h; then
+                   MYSQL_INCDIR=/usr/include/mysql
+                   if test -f /usr/lib64/mysql/libmysqlclient_r.a \
+                        -o -f /usr/lib64/mysql/libmysqlclient_r.so; then
+                           MYSQL_LIBDIR=/usr/lib64/mysql
+                   elif test -f /usr/lib/mysql/libmysqlclient_r.a \
+                          -o -f /usr/lib/mysql/libmysqlclient_r.so; then
+                           MYSQL_LIBDIR=/usr/lib/mysql
+                   else
+                           MYSQL_LIBDIR=/usr/lib
+                   fi
+                   MYSQL_BINDIR=/usr/bin
+           elif test -f /usr/include/mysql.h; then
+                   MYSQL_INCDIR=/usr/include
+                   if test -f /usr/lib64/libmysqlclient_r.a \
+                        -o -f /usr/lib64/libmysqlclient_r.so; then
+                           MYSQL_LIBDIR=/usr/lib64
+                   else
+                           MYSQL_LIBDIR=/usr/lib
+                   fi
+                   MYSQL_BINDIR=/usr/bin
+           elif test -f /usr/local/include/mysql/mysql.h; then
+                   MYSQL_INCDIR=/usr/local/include/mysql
+                   if test -f /usr/local/lib64/mysql/libmysqlclient_r.a \
+                        -o -f /usr/local/lib64/mysql/libmysqlclient_r.so; then
+                           MYSQL_LIBDIR=/usr/local/lib64/mysql
+                   else
+                           MYSQL_LIBDIR=/usr/local/lib/mysql
+                   fi
+                   MYSQL_BINDIR=/usr/local/bin
+           elif test -f /usr/local/include/mysql.h; then
+                   MYSQL_INCDIR=/usr/local/include
+                   if test -f /usr/local/lib64/libmysqlclient_r.a \
+                        -o -f /usr/local/lib64/libmysqlclient_r.so; then
+                           MYSQL_LIBDIR=/usr/local/lib64
+                   else
+                           MYSQL_LIBDIR=/usr/local/lib
+                   fi
+                   MYSQL_BINDIR=/usr/local/bin
+           else
+              { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+              { { echo "$as_me:$LINENO: error: Unable to find mysql.h in standard locations" >&5
+echo "$as_me: error: Unable to find mysql.h in standard locations" >&2;}
+   { (exit 1); exit 1; }; }
+           fi
+        else
+           if test -f $withval/include/mysql/mysql.h; then
+              MYSQL_INCDIR=$withval/include/mysql
+              if test -f $withval/lib64/mysql/libmysqlclient_r.a \
+                   -o -f $withval/lib64/mysql/libmysqlclient_r.so; then
+                 MYSQL_LIBDIR=$withval/lib64/mysql
+              else
+                 MYSQL_LIBDIR=$withval/lib/mysql
+                 # Solaris ...
+                 if test -f $withval/lib/libmysqlclient_r.so; then
+                    MYSQL_LIBDIR=$withval/lib
+                 fi
+              fi
+              MYSQL_BINDIR=$withval/bin
+           elif test -f $withval/include/mysql.h; then
+              MYSQL_INCDIR=$withval/include
+              if test -f $withval/lib64/libmysqlclient_r.a \
+                   -o -f $withval/lib64/libmysqlclient_r.so; then
+                 MYSQL_LIBDIR=$withval/lib64
+              else
+                 MYSQL_LIBDIR=$withval/lib
+              fi
+              MYSQL_BINDIR=$withval/bin
+           else
+              { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+              { { echo "$as_me:$LINENO: error: Invalid MySQL directory $withval - unable to find mysql.h under $withval" >&5
+echo "$as_me: error: Invalid MySQL directory $withval - unable to find mysql.h under $withval" >&2;}
+   { (exit 1); exit 1; }; }
+           fi
+        fi
+    SQL_INCLUDE=-I$MYSQL_INCDIR
+    if test -f $MYSQL_LIBDIR/libmysqlclient_r.a \
+         -o -f $MYSQL_LIBDIR/libmysqlclient_r.so; then
+       SQL_LFLAGS="-L$MYSQL_LIBDIR -lmysqlclient_r -lz"
+       cat >>confdefs.h <<\_ACEOF
+#define HAVE_THREAD_SAFE_MYSQL 1
+_ACEOF
+
+    fi
+    SQL_BINDIR=$MYSQL_BINDIR
+    SQL_LIB=$MYSQL_LIBDIR/libmysqlclient_r.a
+
+    cat >>confdefs.h <<\_ACEOF
+#define HAVE_MYSQL 1
+_ACEOF
+
+    { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+    db_found=yes
+    support_mysql=yes
+    db_type=MySQL
+    DB_TYPE=mysql
+
+  else
+        { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+  fi
+
+
+fi
+
+
+
+# Check whether --with-embedded-mysql was given.
+if test "${with_embedded_mysql+set}" = set; then
+  withval=$with_embedded_mysql;
+  if test "$withval" != "no"; then
+        if test "$withval" = "yes"; then
+                if test -f /usr/local/mysql/include/mysql/mysql.h; then
+                        MYSQL_INCDIR=/usr/local/mysql/include/mysql
+                        if test -d /usr/local/mysql/lib64/mysql; then
+                                MYSQL_LIBDIR=/usr/local/mysql/lib64/mysql
+                        else
+                                MYSQL_LIBDIR=/usr/local/mysql/lib/mysql
+                        fi
+                        MYSQL_BINDIR=/usr/local/mysql/bin
+                elif test -f /usr/include/mysql/mysql.h; then
+                        MYSQL_INCDIR=/usr/include/mysql
+                        if test -d /usr/lib64/mysql; then
+                                MYSQL_LIBDIR=/usr/lib64/mysql
+                        else
+                                MYSQL_LIBDIR=/usr/lib/mysql
+                        fi
+                        MYSQL_BINDIR=/usr/bin
+                elif test -f /usr/include/mysql.h; then
+                        MYSQL_INCDIR=/usr/include
+                        if test -d /usr/lib64; then
+                                MYSQL_LIBDIR=/usr/lib64
+                        else
+                                MYSQL_LIBDIR=/usr/lib
+                        fi
+                        MYSQL_BINDIR=/usr/bin
+                elif test -f /usr/local/include/mysql/mysql.h; then
+                        MYSQL_INCDIR=/usr/local/include/mysql
+                        if test -d /usr/local/lib64/mysql; then
+                                MYSQL_LIBDIR=/usr/local/lib64/mysql
+                        else
+                                MYSQL_LIBDIR=/usr/local/lib/mysql
+                        fi
+                        MYSQL_BINDIR=/usr/local/bin
+                elif test -f /usr/local/include/mysql.h; then
+                        MYSQL_INCDIR=/usr/local/include
+                        if test -d /usr/local/lib64; then
+                                MYSQL_LIBDIR=/usr/local/lib64
+                        else
+                                MYSQL_LIBDIR=/usr/local/lib
+                        fi
+                        MYSQL_BINDIR=/usr/local/bin
+                else
+                   { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+                   { { echo "$as_me:$LINENO: error: Unable to find mysql.h in standard locations" >&5
+echo "$as_me: error: Unable to find mysql.h in standard locations" >&2;}
+   { (exit 1); exit 1; }; }
+                fi
+        else
+                if test -f $withval/include/mysql/mysql.h; then
+                        MYSQL_INCDIR=$withval/include/mysql
+                        if test -d $withval/lib64/mysql; then
+                                MYSQL_LIBDIR=$withval/lib64/mysql
+                        else
+                                MYSQL_LIBDIR=$withval/lib/mysql
+                        fi
+                        MYSQL_BINDIR=$withval/bin
+                elif test -f $withval/include/mysql.h; then
+                        MYSQL_INCDIR=$withval/include
+                        if test -d $withval/lib64; then
+                                MYSQL_LIBDIR=$withval/lib64
+                        else
+                                MYSQL_LIBDIR=$withval/lib
+                        fi
+                        MYSQL_BINDIR=$withval/bin
+                else
+                   { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+                   { { echo "$as_me:$LINENO: error: Invalid MySQL directory $withval - unable to find mysql.h under $withval" >&5
+echo "$as_me: error: Invalid MySQL directory $withval - unable to find mysql.h under $withval" >&2;}
+   { (exit 1); exit 1; }; }
+                fi
+        fi
+    SQL_INCLUDE=-I$MYSQL_INCDIR
+    SQL_LFLAGS="-L$MYSQL_LIBDIR -lmysqld -lz -lm -lcrypt"
+    SQL_BINDIR=$MYSQL_BINDIR
+    SQL_LIB=$MYSQL_LIBDIR/libmysqld.a
+
+    cat >>confdefs.h <<\_ACEOF
+#define HAVE_MYSQL 1
+_ACEOF
+
+    cat >>confdefs.h <<\_ACEOF
+#define HAVE_EMBEDDED_MYSQL 1
+_ACEOF
+
+    { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+    db_found=yes
+    support_mysql=yes
+    db_type=MySQL
+    DB_TYPE=mysql
+
+  else
+        { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+  fi
+
+
+fi
+
+
+
+
+
+
+
+
+
+
+db_found=no
+{ echo "$as_me:$LINENO: checking for SQLite3 support" >&5
+echo $ECHO_N "checking for SQLite3 support... $ECHO_C" >&6; }
+
+# Check whether --with-sqlite3 was given.
+if test "${with_sqlite3+set}" = set; then
+  withval=$with_sqlite3;
+  if test "$withval" != "no"; then
+     if test "$withval" = "yes"; then
+        if test -f /usr/local/include/sqlite3.h; then
+           SQLITE_INCDIR=/usr/local/include
+           if test -d /usr/local/lib64; then
+              SQLITE_LIBDIR=/usr/local/lib64
+           else
+              SQLITE_LIBDIR=/usr/local/lib
+           fi
+           SQLITE_BINDIR=/usr/local/bin
+        elif test -f /usr/include/sqlite3.h; then
+           SQLITE_INCDIR=/usr/include
+           if test -d /usr/lib64; then
+              SQLITE_LIBDIR=/usr/lib64
+           else
+              SQLITE_LIBDIR=/usr/lib
+           fi
+           SQLITE_BINDIR=/usr/bin
+        elif test -f $prefix/include/sqlite3.h; then
+           SQLITE_INCDIR=$prefix/include
+           if test -d $prefix/lib64; then
+              SQLITE_LIBDIR=$prefix/lib64
+           else
+              SQLITE_LIBDIR=$prefix/lib
+           fi
+           SQLITE_BINDIR=$prefix/bin
+        else
+           { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+           { { echo "$as_me:$LINENO: error: Unable to find sqlite3.h in standard locations" >&5
+echo "$as_me: error: Unable to find sqlite3.h in standard locations" >&2;}
+   { (exit 1); exit 1; }; }
+        fi
+     else
+        if test -f $withval/sqlite3.h; then
+           SQLITE_INCDIR=$withval
+           SQLITE_LIBDIR=$withval
+           SQLITE_BINDIR=$withval
+        elif test -f $withval/include/sqlite3.h; then
+           SQLITE_INCDIR=$withval/include
+           if test -d $withval/lib64; then
+              SQLITE_LIBDIR=$withval/lib64
+           else
+              SQLITE_LIBDIR=$withval/lib
+           fi
+           SQLITE_BINDIR=$withval/bin
+        else
+           { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+           { { echo "$as_me:$LINENO: error: Invalid SQLite3 directory $withval - unable to find sqlite3.h under $withval" >&5
+echo "$as_me: error: Invalid SQLite3 directory $withval - unable to find sqlite3.h under $withval" >&2;}
+   { (exit 1); exit 1; }; }
+        fi
+     fi
+     SQL_INCLUDE=-I$SQLITE_INCDIR
+     SQL_LFLAGS="-L$SQLITE_LIBDIR -lsqlite3"
+     SQL_BINDIR=$SQLITE_BINDIR
+     SQL_LIB=$SQLITE_LIBDIR/libsqlite3.a
+
+     cat >>confdefs.h <<\_ACEOF
+#define HAVE_SQLITE3 1
+_ACEOF
+
+     { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+     db_found=yes
+     support_sqlite3=yes
+     db_type=SQLite3
+     DB_TYPE=sqlite3
+
+  else
+     { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+  fi
+
+else
+
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+
+fi
+
+
+
+
+
+
+
+
+db_found=no
+{ echo "$as_me:$LINENO: checking for SQLite support" >&5
+echo $ECHO_N "checking for SQLite support... $ECHO_C" >&6; }
+
+# Check whether --with-sqlite was given.
+if test "${with_sqlite+set}" = set; then
+  withval=$with_sqlite;
+  if test "$withval" != "no"; then
+     if test "$withval" = "yes"; then
+        if test -f /usr/local/include/sqlite.h; then
+           SQLITE_INCDIR=/usr/local/include
+           if test -d /usr/local/lib64; then
+              SQLITE_LIBDIR=/usr/local/lib64
+           else
+              SQLITE_LIBDIR=/usr/local/lib
+           fi
+           SQLITE_BINDIR=/usr/local/bin
+        elif test -f /usr/include/sqlite.h; then
+           SQLITE_INCDIR=/usr/include
+           if test -d /usr/lib64; then
+              SQLITE_LIBDIR=/usr/lib64
+           else
+              SQLITE_LIBDIR=/usr/lib
+           fi
+           SQLITE_BINDIR=/usr/bin
+        elif test -f $prefix/include/sqlite.h; then
+           SQLITE_INCDIR=$prefix/include
+           if test -d $prefix/lib64; then
+              SQLITE_LIBDIR=$prefix/lib64
+           else
+              SQLITE_LIBDIR=$prefix/lib
+           fi
+           SQLITE_BINDIR=$prefix/bin
+        else
+           { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+           { { echo "$as_me:$LINENO: error: Unable to find sqlite.h in standard locations" >&5
+echo "$as_me: error: Unable to find sqlite.h in standard locations" >&2;}
+   { (exit 1); exit 1; }; }
+        fi
+     else
+        if test -f $withval/sqlite.h; then
+           SQLITE_INCDIR=$withval
+           SQLITE_LIBDIR=$withval
+           SQLITE_BINDIR=$withval
+        elif test -f $withval/include/sqlite.h; then
+           SQLITE_INCDIR=$withval/include
+           if test -d $withval/lib64; then
+              SQLITE_LIBDIR=$withval/lib64
+           else
+              SQLITE_LIBDIR=$withval/lib
+           fi
+           SQLITE_BINDIR=$withval/bin
+        else
+           { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+           { { echo "$as_me:$LINENO: error: Invalid SQLite directory $withval - unable to find sqlite.h under $withval" >&5
+echo "$as_me: error: Invalid SQLite directory $withval - unable to find sqlite.h under $withval" >&2;}
+   { (exit 1); exit 1; }; }
+        fi
+     fi
+     SQL_INCLUDE=-I$SQLITE_INCDIR
+     SQL_LFLAGS="-L$SQLITE_LIBDIR -lsqlite"
+     SQL_BINDIR=$SQLITE_BINDIR
+     SQL_LIB=$SQLITE_LIBDIR/libsqlite.a
+
+     cat >>confdefs.h <<\_ACEOF
+#define HAVE_SQLITE 1
+_ACEOF
+
+     { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+     db_found=yes
+     support_sqlite=yes
+     db_type=SQLite
+     DB_TYPE=sqlite
+
+  else
+     { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+  fi
+
+else
+
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+
+fi
+
+
+
+
+
+
+
+
+db_found=no
+{ echo "$as_me:$LINENO: checking for DBI support" >&5
+echo $ECHO_N "checking for DBI support... $ECHO_C" >&6; }
+
+# Check whether --with-dbi was given.
+if test "${with_dbi+set}" = set; then
+  withval=$with_dbi;
+  if test "$withval" != "no"; then
+     if test "$withval" = "yes"; then
+        if test -f /usr/local/include/dbi/dbi.h; then
+           DBI_INCDIR=/usr/local/dbi/include
+           if test -d /usr/local/lib64; then
+              DBI_LIBDIR=/usr/local/lib64
+           else
+              DBI_LIBDIR=/usr/local/lib
+           fi
+           DBI_BINDIR=/usr/local/bin
+        elif test -f /usr/include/dbi/dbi.h; then
+           DBI_INCDIR=/usr/include
+           if test -d /usr/lib64; then
+              DBI_LIBDIR=/usr/lib64
+           else
+              DBI_LIBDIR=/usr/lib
+           fi
+           DBI_BINDIR=/usr/bin
+        elif test -f $prefix/include/dbi/dbi.h; then
+           DBI_INCDIR=$prefix/include
+           if test -d $prefix/lib64; then
+              DBI_LIBDIR=$prefix/lib64
+           else
+              DBI_LIBDIR=$prefix/lib
+           fi
+           DBI_BINDIR=$prefix/bin
+        else
+           { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+           { { echo "$as_me:$LINENO: error: Unable to find dbi.h in standard locations" >&5
+echo "$as_me: error: Unable to find dbi.h in standard locations" >&2;}
+   { (exit 1); exit 1; }; }
+        fi
+        if test -d /usr/local/lib/dbd; then
+           DRIVERDIR=/usr/local/lib/dbd
+           if test -d /usr/local/lib64/dbd; then
+              DRIVERDIR=/usr/local/lib64/dbd
+           else
+              DRIVERDIR=/usr/local/lib/dbd
+           fi
+        elif test -d /usr/lib/dbd; then
+           DRIVERDIR=/usr/lib/dbd
+           if test -d /usr/lib64/dbd; then
+              DRIVERDIR=/usr/lib64/dbd
+           else
+              DRIVERDIR=/usr/lib/dbd
+           fi
+        elif test -d $prefix/lib/dbd; then
+           if test -d $prefix/lib64/dbd; then
+              DRIVERDIR=$prefix/lib64/dbd
+           else
+              DRIVERDIR=$prefix/lib/dbd
+           fi
+        else
+           { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+           { { echo "$as_me:$LINENO: error: Unable to find DBD drivers in standard locations" >&5
+echo "$as_me: error: Unable to find DBD drivers in standard locations" >&2;}
+   { (exit 1); exit 1; }; }
+        fi
+     else
+        if test -f $withval/dbi.h; then
+           DBI_INCDIR=$withval
+           DBI_LIBDIR=$withval
+           DBI_BINDIR=$withval
+        elif test -f $withval/include/dbi/dbi.h; then
+           DBI_INCDIR=$withval/include
+           if test -d $withval/lib64; then
+              DBI_LIBDIR=$withval/lib64
+           else
+              DBI_LIBDIR=$withval/lib
+           fi
+           DBI_BINDIR=$withval/bin
+        else
+           { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+           { { echo "$as_me:$LINENO: error: Invalid DBI directory $withval - unable to find dbi.h under $withval" >&5
+echo "$as_me: error: Invalid DBI directory $withval - unable to find dbi.h under $withval" >&2;}
+   { (exit 1); exit 1; }; }
+        fi
+        if test -d $withval/dbd; then
+           DRIVERDIR=$withval/dbd
+        elif test -d $withval/lib/; then
+           if test -d $withval/lib64/dbd; then
+              DRIVERDIR=$withval/lib64/dbd
+           else
+              DRIVERDIR=$withval/lib/dbd
+           fi
+        else
+           { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+           { { echo "$as_me:$LINENO: error: Invalid DBD driver directory $withval - unable to find DBD drivers under $withval" >&5
+echo "$as_me: error: Invalid DBD driver directory $withval - unable to find DBD drivers under $withval" >&2;}
+   { (exit 1); exit 1; }; }
+        fi
+     fi
+     SQL_INCLUDE=-I$DBI_INCDIR
+     SQL_LFLAGS="-L$DBI_LIBDIR -ldbi"
+     SQL_BINDIR=$DBI_BINDIR
+     SQL_LIB=$DBI_LIBDIR/libdbi.a
+     DBI_DBD_DRIVERDIR="-D DBI_DRIVER_DIR=\\\"$DRIVERDIR\\\""
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_DBI 1
+_ACEOF
+
+     { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+     db_found=yes
+     support_dbi=yes
+     db_type=DBI
+     DB_TYPE=dbi
+     uncomment_dbi=" "
+
+  else
+     { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+  fi
+
+else
+
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+
+fi
+
+
+
+
+
+
+
+
+
+
+db_found=no
+db_prog=no
+{ echo "$as_me:$LINENO: checking for DBI drivers support" >&5
+echo $ECHO_N "checking for DBI drivers support... $ECHO_C" >&6; }
+
+# Check whether --with-dbi-driver was given.
+if test "${with_dbi_driver+set}" = set; then
+  withval=$with_dbi_driver;
+  if test "$withval" != "no"; then
+     case $withval in
+        "mysql")
+           db_prog="mysql"
+           if test -f /usr/local/mysql/bin/mysql; then
+              SQL_BINDIR=/usr/local/mysql/bin
+              if test -f /usr/local/mysql/lib64/mysql/libmysqlclient_r.a \
+                 -o -f /usr/local/mysql/lib64/mysql/libmysqlclient_r.so; then
+                 SQL_LIBDIR=/usr/local/mysql/lib64/mysql
+              else
+                 SQL_LIBDIR=/usr/local/mysql/lib/mysql
+              fi
+           elif test -f /usr/bin/mysql; then
+              SQL_BINDIR=/usr/bin
+              if test -f /usr/lib64/mysql/libmysqlclient_r.a \
+                  -o -f /usr/lib64/mysql/libmysqlclient_r.so; then
+                  SQL_LIBDIR=/usr/lib64/mysql
+              elif test -f /usr/lib/mysql/libmysqlclient_r.a \
+                  -o -f /usr/lib/mysql/libmysqlclient_r.so; then
+                  SQL_LIBDIR=/usr/lib/mysql
+              else
+                  SQL_LIBDIR=/usr/lib
+              fi
+           elif test -f /usr/local/bin/mysql; then
+              SQL_BINDIR=/usr/local/bin
+              if test -f /usr/local/lib64/mysql/libmysqlclient_r.a \
+                  -o -f /usr/local/lib64/mysql/libmysqlclient_r.so; then
+                  SQL_LIBDIR=/usr/local/lib64/mysql
+              elif test -f /usr/local/lib/mysql/libmysqlclient_r.a \
+                  -o -f /usr/local/lib/mysql/libmysqlclient_r.so; then
+                  SQL_LIBDIR=/usr/local/lib/mysql
+              else
+                  SQL_LIBDIR=/usr/local/lib
+              fi
+           elif test -f $withval/bin/mysql; then
+              SQL_BINDIR=$withval/bin
+              if test -f $withval/lib64/mysql/libmysqlclient_r.a \
+                  -o -f $withval/lib64/mysql/libmysqlclient_r.so; then
+                  SQL_LIBDIR=$withval/lib64/mysql
+              elif test -f $withval/lib64/libmysqlclient_r.a \
+                  -o -f $withval/lib64/libmysqlclient_r.so; then
+                  SQL_LIBDIR=$withval/lib64
+              elif test -f $withval/lib/libmysqlclient_r.a \
+                  -o -f $withval/lib/libmysqlclient_r.so; then
+                  SQL_LIBDIR=$withval/lib/
+              else
+                  SQL_LIBDIR=$withval/lib/mysql
+              fi
+           else
+              { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+              { { echo "$as_me:$LINENO: error: Unable to find mysql in standard locations" >&5
+echo "$as_me: error: Unable to find mysql in standard locations" >&2;}
+   { (exit 1); exit 1; }; }
+           fi
+           DB_PROG_LIB=$SQL_LIBDIR/libmysqlclient_r.a
+        ;;
+        "postgresql")
+           db_prog="postgresql"
+           PG_CONFIG=`which pg_config`
+           if test -n "$PG_CONFIG"; then
+              SQL_BINDIR=`"$PG_CONFIG" --bindir`
+              SQL_LIBDIR=`"$PG_CONFIG" --libdir`
+           elif test -f /usr/local/bin/psql; then
+              SQL_BINDIR=/usr/local/bin
+              if test -d /usr/local/lib64; then
+                 SQL_LIBDIR=/usr/local/lib64
+              else
+                 SQL_LIBDIR=/usr/local/lib
+              fi
+           elif test -f /usr/bin/psql; then
+              SQL_BINDIR=/usr/local/bin
+              if test -d /usr/lib64/postgresql; then
+                 SQL_LIBDIR=/usr/lib64/postgresql
+              elif test -d /usr/lib/postgresql; then
+                 SQL_LIBDIR=/usr/lib/postgresql
+              elif test -d /usr/lib64; then
+                 SQL_LIBDIR=/usr/lib64
+              else
+                 SQL_LIBDIR=/usr/lib
+              fi
+           elif test -f $withval/bin/psql; then
+              SQL_BINDIR=$withval/bin
+              if test -d $withval/lib64; then
+                 SQL_LIBDIR=$withval/lib64
+              else
+                 SQL_LIBDIR=$withval/lib
+              fi
+           else
+              { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+              { { echo "$as_me:$LINENO: error: Unable to find psql in standard locations" >&5
+echo "$as_me: error: Unable to find psql in standard locations" >&2;}
+   { (exit 1); exit 1; }; }
+           fi
+           DB_PROG_LIB=$SQL_LIBDIR/libpq.a
+        ;;
+        "sqlite")
+           db_prog="sqlite"
+           if test -f /usr/local/bin/sqlite; then
+              SQL_BINDIR=/usr/local/bin
+              if test -d /usr/local/lib64; then
+                 SQL_LIBDIR=/usr/local/lib64
+              else
+                 SQL_LIBDIR=/usr/local/lib
+              fi
+           elif test -f /usr/bin/sqlite; then
+              SQL_BINDIR=/usr/bin
+              if test -d /usr/lib64; then
+                 SQL_LIBDIR=/usr/lib64
+              else
+                 SQL_LIBDIR=/usr/lib
+              fi
+           elif test -f $withval/bin/sqlite; then
+              SQL_BINDIR=$withval/bin
+              if test -d $withval/lib64; then
+                 SQL_LIBDIR=$withval/lib64
+              else
+                 SQL_LIBDIR=$withval/lib
+              fi
+           else
+              { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+              { { echo "$as_me:$LINENO: error: Unable to find sqlite in standard locations" >&5
+echo "$as_me: error: Unable to find sqlite in standard locations" >&2;}
+   { (exit 1); exit 1; }; }
+           fi
+           DB_PROG_LIB=$SQL_LIBDIR/libsqlite.a
+        ;;
+        "sqlite3")
+           db_prog="sqlite3"
+           if test -f /usr/local/bin/sqlite3; then
+              SQL_BINDIR=/usr/local/bin
+              if test -d /usr/local/lib64; then
+                 SQL_LIBDIR=/usr/local/lib64
+              else
+                 SQL_LIBDIR=/usr/local/lib
+              fi
+           elif test -f /usr/bin/sqlite3; then
+              SQL_BINDIR=/usr/bin
+              if test -d /usr/lib64; then
+                 SQL_LIBDIR=/usr/lib64
+              else
+                 SQL_LIBDIR=/usr/lib
+              fi
+           elif test -f $withval/bin/sqlite3; then
+              SQL_BINDIR=$withval/bin
+              if test -d $withval/lib64; then
+                 SQL_LIBDIR=$withval/lib64
+              else
+                 SQL_LIBDIR=$withval/lib
+              fi
+           else
+              { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+              { { echo "$as_me:$LINENO: error: Unable to find sqlite in standard locations" >&5
+echo "$as_me: error: Unable to find sqlite in standard locations" >&2;}
+   { (exit 1); exit 1; }; }
+           fi
+           DB_PROG_LIB=$SQL_LIBDIR/libsqlite3.a
+        ;;
+        *)
+           { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+           { { echo "$as_me:$LINENO: error: Unable to set DBI driver. $withval is not supported" >&5
+echo "$as_me: error: Unable to set DBI driver. $withval is not supported" >&2;}
+   { (exit 1); exit 1; }; }
+        ;;
+     esac
+
+     { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+     DB_PROG=$db_prog
+  else
+     { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+  fi
+
+else
+
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+
+fi
+
+
 
-BA_CHECK_SQLITE3_DB
 
-BA_CHECK_SQLITE_DB
 
-BA_CHECK_DBI_DB
 
-BA_CHECK_DBI_DRIVER
 
 
 
@@ -29681,20 +30741,6 @@ LIBOBJS=$ac_libobjs
 LTLIBOBJS=$ac_ltlibobjs
 
 
-if test -z "${HAVE_DARWIN_OS_TRUE}" && test -z "${HAVE_DARWIN_OS_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"HAVE_DARWIN_OS\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"HAVE_DARWIN_OS\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-if test -z "${HAVE_DARWIN_OS_TRUE}" && test -z "${HAVE_DARWIN_OS_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"HAVE_DARWIN_OS\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"HAVE_DARWIN_OS\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
 
 : ${CONFIG_STATUS=./config.status}
 ac_clean_files_save=$ac_clean_files
@@ -30651,9 +31697,15 @@ sd_group!$sd_group$ac_delim
 fd_user!$fd_user$ac_delim
 fd_group!$fd_group$ac_delim
 SBINPERM!$SBINPERM$ac_delim
+SQL_LFLAGS!$SQL_LFLAGS$ac_delim
+SQL_INCLUDE!$SQL_INCLUDE$ac_delim
+SQL_BINDIR!$SQL_BINDIR$ac_delim
+DBI_DBD_DRIVERDIR!$DBI_DBD_DRIVERDIR$ac_delim
+uncomment_dbi!$uncomment_dbi$ac_delim
+DB_PROG!$DB_PROG$ac_delim
+DB_PROG_LIB!$DB_PROG_LIB$ac_delim
 cats!$cats$ac_delim
 DB_TYPE!$DB_TYPE$ac_delim
-uncomment_dbi!$uncomment_dbi$ac_delim
 GETCONF!$GETCONF$ac_delim
 XMKMF!$XMKMF$ac_delim
 X_CFLAGS!$X_CFLAGS$ac_delim
@@ -30680,7 +31732,7 @@ DISTVER!$DISTVER$ac_delim
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 56; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 62; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5