--- configure.in.orig Wed Mar 10 01:54:13 2004 +++ configure.in Thu Mar 18 02:45:26 2004 @@ -696,7 +696,59 @@ case "$with_pgsql" in esac AC_SUBST(LIB_PGSQL) -if test "$sql" = yes -a "$with_pgsql" = no -a "$with_mysql" = no; then +dnl SQLite +AC_ARG_WITH(sqlite, [ --with-sqlite=PATH use SQLite from PATH ], + with_sqlite=$withval, + with_sqlite=$sql) + +# find location of library +# presuing if one given then correct +if test "${with_sqlite}" = "yes"; then + with_sqlite=notfound + for sqliteloc in lib + do + if test -f ${prefix}/${sqliteloc}/libsqlite.a; then + with_sqlite="${prefix}" + break + elif test -f /usr/local/${sqliteloc}/libsqlite.a; then + with_sqlite="/usr/local" + break + elif test -f /usr/${sqliteloc}/libsqlite.a; then + with_sqlite="/usr" + break + fi + done +fi + +LIB_SQLITE="" + +case "$with_sqlite" in + no) true;; + notfound) AC_WARN([SQLite Library not found]); true;; + *) + if test -d ${with_sqlite}/lib; then + LIB_SQLITE="-L${with_sqlite}/lib -R${with_sqlite}/lib" + else + LIB_SQLITE="-L${with_sqlite} -R${with_sqlite}" + fi + + LIB_SQLITE_DIR=$LIB_SQLITE + LIB_SQLITE="$LIB_SQLITE -lsqlite" + + if test -d ${with_sqlite}/include; then + CPPFLAGS="${CPPFLAGS} -I${with_sqlite}/include" + else + CPPFLAGS="${CPPFLAGS} -I${with_sqlite}" + fi + AC_CHECK_LIB(sqlite, sqlite_open, AC_DEFINE(HAVE_SQLITE,[], + [Do we have SQLite support?]), + [AC_WARN([SQLite Library sqlite does not work]) + with_sqlite=no], $LIB_SQLITE_DIR);; + +esac +AC_SUBST(LIB_SQLITE) + +if test "$sql" = yes -a "$with_pgsql" = no -a "$with_mysql" = no -a "$with_sqlite" = no; then AC_ERROR([--enable-sql chosen but neither Postgres nor MySQL found]) fi