AC_INIT(Makefile.am)
AM_INIT_AUTOMAKE(sqlxx,2.3.2)
AC_PROG_CXX
AC_LANG_CPLUSPLUS
AM_PROG_LIBTOOL
AC_PROG_INSTALL
AC_CHECK_EXTRA
AC_FEATURE_MYSQL
AC_FEATURE_POSTGRES
AC_FEATURE_IODBC
AC_FEATURE_DEBUG
AC_CHECK_HEADERS(strutilsxx.h,,echo "ERROR: strutilsxx.h not found"; exit 1;)
if test "x$enable_odbc" = "xyes"
then
  AC_CHECK_LIB(iodbc,SQLError,,echo "ERROR: iodbc library not found"; exit 1;)
  AC_CHECK_HEADERS(isql.h,,echo "ERROR: isql.h not found"; exit 1;)
  AC_CHECK_HEADERS(isqlext.h,,echo "ERROR: isqlext.h not found"; exit 1;)
fi
if test "x$enable_mysql" = "xyes"
then
  AC_CHECK_LIB(mysqlclient,mysql_debug,,echo "ERROR: mysql library not fond"; exit 1;)
  AC_CHECK_HEADERS(mysql.h,,echo "ERROR: mysql.h not found"; exit 1;)
fi
if test "x$enable_postgres" = "xyes"
then
  AC_CHECK_LIB(pq,PQconnectdb,,echo "ERROR: postgres library not found"; exit 1;)
  AC_CHECK_HEADERS(libpq-fe.h,,echo "ERROR: libpq-fe.h not found"; exit 1;)
fi
AC_OUTPUT(Makefile src/Makefile)
