sqlite3.m4 876 B

1234567891011121314151617181920212223242526272829303132
  1. AC_DEFUN([AM_PATH_SQLITE3],
  2. [
  3. AC_ARG_WITH([sqlite3-prefix],
  4. [ --with-sqlite3-prefix=PREFIX Prefix where SQLite3 installed (optional)],
  5. [sqlite3_prefix=$withval],
  6. [sqlite3_prefix=""])
  7. if test "x$sqlite3_prefix" = "x"; then
  8. sqlite3_prefix="/usr"
  9. fi
  10. sqlite3_prefix_lib=$sqlite3_prefix/lib
  11. sqlite3_prefix_include=$sqlite3_prefix/include
  12. LIBS_save=$LIBS
  13. CPPFLAGS_save=$CPPFLAGS
  14. LIBS="-L$sqlite3_prefix_lib $LIBS"
  15. CPPFLAGS="-I$sqlite3_prefix_include $CPPFLAGS"
  16. AC_CHECK_LIB([sqlite3], [sqlite3_open], [have_sqlite3=yes])
  17. if test "x$have_sqlite3" = "xyes"; then
  18. AC_DEFINE([HAVE_SQLITE3], [1], [Define to 1 if you have sqlite3.])
  19. SQLITE3_LIBS="-L$sqlite3_prefix_lib -lsqlite3"
  20. SQLITE3_CPPFLAGS="-I$sqlite3_prefix_include"
  21. AC_SUBST(SQLITE3_LIBS)
  22. AC_SUBST(SQLITE3_CPPFLAGS)
  23. fi
  24. LIBS=$LIBS_save
  25. CPPFLAGS=$CPPFLAGS_save
  26. ])