-AC_DEFUN(BA_CHECK_MYSQL_DB,
+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)
+ AC_MSG_RESULT(yes)
+ db_found=yes
+ support_dbi=yes
+ db_type=DBI
+ DB_TYPE=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_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
+ --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" = "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.a; then
+ 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
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.a; then
+ if test -f /usr/lib64/mysql/libmysqlclient_r.a \
+ -o -f /usr/lib64/mysql/libmysqlclient_r.so; then
MYSQL_LIBDIR=/usr/lib64/mysql
- else
+ 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.a; then
+ 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
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.a; then
+ 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
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.a; then
+ 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
else
if test -f $withval/include/mysql/mysql.h; then
MYSQL_INCDIR=$withval/include/mysql
- if test -f $withval/lib64/mysql/libmysqlclient.a; then
+ 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.so; then
+ 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.a"; then
+ 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
fi
SQL_INCLUDE=-I$MYSQL_INCDIR
- if test -f "$MYSQL_LIBDIR/libmysqlclient_r.a"; then
+ 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)
- else
- SQL_LFLAGS="-L$MYSQL_LIBDIR -lmysqlclient -lz"
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_name=MySQL
- DB_NAME=mysql
+ db_type=MySQL
+ DB_TYPE=mysql
else
AC_MSG_RESULT(no)
AC_ARG_WITH(embedded-mysql,
[
- --with-embedded-mysql[=DIR] Include MySQL support. DIR is the MySQL base
+ --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.],
[
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_name=MySQL
- DB_NAME=mysql
+ db_type=MySQL
+ DB_TYPE=mysql
else
AC_MSG_RESULT(no)
])
-AC_DEFUN(BA_CHECK_SQLITE_DB,
+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
+ --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.],
[
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_name=SQLite
- DB_NAME=sqlite
+ db_type=SQLite
+ DB_TYPE=sqlite
else
AC_MSG_RESULT(no)
])
-AC_DEFUN(BA_CHECK_SQLITE3_DB,
+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
+ --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.],
[
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_name=SQLite3
- DB_NAME=sqlite3
+ db_type=SQLite3
+ DB_TYPE=sqlite3
else
AC_MSG_RESULT(no)
-AC_DEFUN(BA_CHECK_POSTGRESQL_DB,
+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
+[ --with-postgresql@<:@=DIR@:>@ Include PostgreSQL support. DIR is the PostgreSQL
base install directory, defaults to /usr/local/pgsql],
[
if test "$withval" != "no"; then
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_name=PostgreSQL
- DB_NAME=postgresql
+ db_type=PostgreSQL
+ DB_TYPE=postgresql
else
AC_MSG_RESULT(no)
fi
-AC_DEFUN(BA_CHECK_SQL_DB,
+AC_DEFUN([BA_CHECK_SQL_DB],
[AC_MSG_CHECKING(Checking for various databases)
dnl# --------------------------------------------------------------------------
dnl# CHECKING FOR VARIOUS DATABASES (thanks to UdmSearch team)
dnl Check for some DBMS backend
dnl NOTE: we can use only one backend at a time
db_found=no
-db_name=none
+DB_TYPE=none
if test x$support_mysql = xyes; then
cats=cats
AC_MSG_CHECKING(for Berkeley DB support)
AC_ARG_WITH(berkeleydb,
[
- --with-berkeleydb[=DIR] Include Berkeley DB support. DIR is the Berkeley DB base
+ --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.],
[
AC_MSG_RESULT(yes)
have_db=yes
support_mysql=yes
- db_name=BerkelyDB
+ DB_TYPE=BerkelyDB
else
AC_MSG_RESULT(no)
AC_MSG_CHECKING(for mSQL support)
AC_ARG_WITH(msql,
-[ --with-msql[=DIR] Include mSQL support. DIR is the mSQL base
+[ --with-msql@<:@=DIR@:> Include mSQL support. DIR is the mSQL base
install directory, defaults to /usr/local/Hughes.],
[
if test "$withval" != "no"; then
AC_MSG_CHECKING(for iODBC support)
AC_ARG_WITH(iodbc,
-[ --with-iodbc[=DIR] Include iODBC support. DIR is the iODBC base
+[ --with-iodbc@<:@=DIR@:> Include iODBC support. DIR is the iODBC base
install directory, defaults to /usr/local.],
[
if test "$withval" != "no"; then
AC_MSG_CHECKING(for unixODBC support)
AC_ARG_WITH(unixODBC,
-[ --with-unixODBC[=DIR] Include unixODBC support. DIR is the unixODBC base
+[ --with-unixODBC@<:@=DIR@:> Include unixODBC support. DIR is the unixODBC base
install directory, defaults to /usr/local.],
[
if test "$withval" != "no"; then
AC_MSG_CHECKING(for Solid support)
AC_ARG_WITH(solid,
-[ --with-solid[=DIR] Include Solid support. DIR is the Solid base
+[ --with-solid@<:@=DIR@:> Include Solid support. DIR is the Solid base
install directory, defaults to /usr/local.],
[
if test "$withval" != "no"; then
AC_MSG_CHECKING(for OpenLink ODBC support)
AC_ARG_WITH(openlink,
-[ --with-openlink[=DIR] Include OpenLink ODBC support.
+[ --with-openlink@<:@=DIR@:> Include OpenLink ODBC support.
DIR is the base OpenLink ODBC install directory],
[
if test "$withval" != "no"; then
AC_MSG_CHECKING(for EasySoft ODBC support)
AC_ARG_WITH(easysoft,
-[ --with-easysoft[=DIR] Include EasySoft ODBC support.
+[ --with-easysoft@<:@=DIR@:> Include EasySoft ODBC support.
DIR is the base EasySoft ODBC install directory],
[
if test "$withval" != "no"; then
AC_MSG_CHECKING(for InterBase support)
AC_ARG_WITH(ibase,
-[ --with-ibase[=DIR] Include InterBase support. DIR is the InterBase
+[ --with-ibase@<:@=DIR@:> Include InterBase support. DIR is the InterBase
install directory, defaults to /usr/interbase.],
[
if test "$withval" != "no"; then
AC_MSG_CHECKING(for Oracle8 support)
AC_ARG_WITH(oracle8,
-[ --with-oracle8[=DIR] Include Oracle8 support. DIR is the Oracle
+[ --with-oracle8@<:@=DIR@:> Include Oracle8 support. DIR is the Oracle
home directory, defaults to $ORACLE_HOME or
/oracle8/app/oracle/product/8.0.5.],
[
AC_MSG_CHECKING(for Oracle7 support)
AC_ARG_WITH(oracle7,
-[ --with-oracle7[=DIR] Include Oracle 7.3 support. DIR is the Oracle
+[ --with-oracle7@<:@=DIR@:> Include Oracle 7.3 support. DIR is the Oracle
home directory, defaults to
ORACLE_HOME [$ORACLE_HOME]],
[
])
-AC_DEFUN(AM_CONDITIONAL,
+AC_DEFUN([AM_CONDITIONAL],
[AC_SUBST($1_TRUE)
AC_SUBST($1_FALSE)
if $2; then