2005-06-05 01:20:56 +04:00
########################################################
# Compile with SQLITE3 support?
SQLITE3_LIBS=""
2005-06-06 17:36:02 +04:00
with_sqlite3_support=no
2005-06-05 01:20:56 +04:00
AC_MSG_CHECKING([for SQLITE3 support])
AC_ARG_WITH(sqlite3,
2006-01-26 19:37:37 +03:00
AS_HELP_STRING([--with-sqlite3],[SQLITE3 backend support (default=no)]),
2005-06-05 01:20:56 +04:00
[ case "$withval" in
2005-06-06 17:36:02 +04:00
yes|no|auto)
2005-06-05 01:20:56 +04:00
with_sqlite3_support=$withval
;;
esac ])
AC_MSG_RESULT($with_sqlite3_support)
2005-06-06 17:36:02 +04:00
if test x"$with_sqlite3_support" != x"no"; then
2005-06-05 01:20:56 +04:00
##################################################################
# first test for sqlite3.h
AC_CHECK_HEADERS(sqlite3.h)
if test x"$ac_cv_header_sqlite3_h" != x"yes"; then
if test x"$with_sqlite3_support" = x"yes"; then
AC_MSG_ERROR(sqlite3.h is needed for SQLITE3 support)
else
AC_MSG_WARN(sqlite3.h is needed for SQLITE3 support)
fi
with_sqlite3_support=no
fi
fi
if test x"$with_sqlite3_support" != x"no"; then
ac_save_LIBS=$LIBS
########################################################
# now see if we can find the sqlite3 libs in standard paths
AC_CHECK_LIB_EXT(sqlite3, SQLITE3_LIBS, sqlite3_open)
2005-06-05 08:18:57 +04:00
if test x"$ac_cv_lib_ext_sqlite3_sqlite3_open" = x"yes"; then
AC_DEFINE(HAVE_SQLITE3,1,[Whether sqlite3 is available])
2006-09-25 20:59:00 +04:00
AC_DEFINE(HAVE_LDB_SQLITE3,1,[Whether ldb_sqlite3 is available])
2005-06-05 08:18:57 +04:00
AC_MSG_CHECKING(whether SQLITE3 support is used)
AC_MSG_RESULT(yes)
with_sqlite3_support=yes
2006-04-26 16:22:54 +04:00
SMB_ENABLE(SQLITE3,YES)
2005-06-05 08:18:57 +04:00
else
if test x"$with_sqlite3_support" = x"yes"; then
AC_MSG_ERROR(libsqlite3 is needed for SQLITE3 support)
else
AC_MSG_WARN(libsqlite3 is needed for SQLITE3 support)
fi
SQLITE3_LIBS=""
with_sqlite3_support=no
fi
LIBS=$ac_save_LIBS;
2005-06-05 01:20:56 +04:00
fi
SMB_EXT_LIB(SQLITE3,[${SQLITE3_LIBS}],[${SQLITE3_CFLAGS}],[${SQLITE3_CPPFLAGS}],[${SQLITE3_LDFLAGS}])