dnl -*- mode: Autoconf; -*-
dnl Invoke autogen.sh to produce a configure script.

dnl check for sqlite
PKG_CHECK_MODULES(SQLITE, sqlite3, SQLITEFOUND=yes, [SQLITEFOUND=no])
AC_SUBST(SQLITE_CFLAGS)
AC_SUBST(SQLITE_LIBS)
BACKEND_CPPFLAGS="$BACKEND_CPPFLAGS $SQLITE_CFLAGS"

SE_ARG_ENABLE_BACKEND(sqlite, sqlite,
                      [AS_HELP_STRING([--enable-sqlite],
                                      [enable access to PIM data stored in SQLite files (experimental, default off)])],
                      [enable_sqlite="$enableval"], [enable_sqlite="no"]
                     )

if test "$enable_sqlite" = "yes"; then
        test "x${SQLITEFOUND}" = "xyes" || AC_MSG_ERROR([--enable-sqlite requires pkg-config information for sqlite3, which was not found])
        AC_DEFINE(ENABLE_SQLITE, 1, [sqlite available])
else
        # avoid linking against it if not needed
        SQLITE_CFLAGS=
        SQLITE_LIBS=
fi
