2008-08-17 10:44:12 +00:00
|
|
|
AC_DEFUN([AM_PATH_SQLITE3],
|
|
|
|
[
|
|
|
|
AC_ARG_WITH([sqlite3-prefix],
|
|
|
|
[ --with-sqlite3-prefix=PREFIX Prefix where SQLite3 installed (optional)],
|
|
|
|
[sqlite3_prefix=$withval],
|
|
|
|
[sqlite3_prefix=""])
|
|
|
|
if test "x$sqlite3_prefix" = "x"; then
|
|
|
|
sqlite3_prefix="/usr"
|
|
|
|
fi
|
|
|
|
|
|
|
|
LIBS_save=$LIBS
|
|
|
|
CPPFLAGS_save=$CPPFLAGS
|
|
|
|
|
2009-05-23 06:20:29 +00:00
|
|
|
PKG_CHECK_MODULES([SQLITE3],[sqlite3],[have_sqlite3=yes],[have_sqlite3=no])
|
|
|
|
|
2008-09-09 12:49:11 +00:00
|
|
|
if test "x$have_sqlite3" != "xyes"; then
|
2009-05-23 06:20:29 +00:00
|
|
|
AC_MSG_WARN([$SQLITE3_PKG_ERRORS])
|
|
|
|
|
2008-09-09 12:49:11 +00:00
|
|
|
sqlite3_prefix_lib=$sqlite3_prefix/lib
|
|
|
|
sqlite3_prefix_include=$sqlite3_prefix/include
|
|
|
|
|
|
|
|
LIBS="-L$sqlite3_prefix_lib $LIBS"
|
|
|
|
CPPFLAGS="-I$sqlite3_prefix_include $CPPFLAGS"
|
|
|
|
|
|
|
|
AC_CHECK_LIB([sqlite3], [sqlite3_open], [have_sqlite3=yes])
|
|
|
|
if test "x$have_sqlite3" = "xyes"; then
|
2008-08-17 10:44:12 +00:00
|
|
|
SQLITE3_LIBS="-L$sqlite3_prefix_lib -lsqlite3"
|
2009-05-23 06:20:29 +00:00
|
|
|
SQLITE3_CFLAGS="-I$sqlite3_prefix_include"
|
2008-09-09 12:49:11 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if test "x$have_sqlite3" = "xyes"; then
|
2009-08-09 06:56:28 +00:00
|
|
|
LIBS="$SQLITE3_LIBS $LIBS"
|
|
|
|
CPPFLAGS="$SQLITE3_CFLAGS $CPPFLAGS"
|
2008-10-04 03:02:35 +00:00
|
|
|
AC_CHECK_FUNCS([sqlite3_open_v2])
|
2008-09-09 12:49:11 +00:00
|
|
|
AC_DEFINE([HAVE_SQLITE3], [1], [Define to 1 if you have sqlite3.])
|
2008-08-17 10:44:12 +00:00
|
|
|
AC_SUBST(SQLITE3_LIBS)
|
2009-05-23 06:20:29 +00:00
|
|
|
AC_SUBST(SQLITE3_CFLAGS)
|
2008-08-17 10:44:12 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
LIBS=$LIBS_save
|
|
|
|
CPPFLAGS=$CPPFLAGS_save
|
|
|
|
|
|
|
|
])
|