mountd: cache.c no longer needs #include xmalloc.h
[nfs-utils.git] / aclocal / libsqlite3.m4
1 dnl Checks for matching sqlite3 header and library, and
2 dnl sufficient sqlite3 version.
3 dnl
4 AC_DEFUN([AC_SQLITE3_VERS], [
5   AC_CHECK_HEADERS([sqlite3.h], ,)
6
7   dnl look for the library; do not add to LIBS if found
8   AC_CHECK_LIB([sqlite3], [sqlite3_libversion_number], [LIBSQLITE=-lsqlite3], ,)
9   AC_SUBST(LIBSQLITE)
10
11   AC_MSG_CHECKING(for suitable sqlite3 version)
12
13   AC_CACHE_VAL([libsqlite3_cv_is_recent],
14    [
15     saved_LIBS="$LIBS"
16     LIBS=-lsqlite3
17     AC_TRY_RUN([
18         #include <stdio.h>
19         #include <sqlite3.h>
20         int main()
21         {
22                 int vers = sqlite3_libversion_number();
23
24                 return vers != SQLITE_VERSION_NUMBER ||
25                         vers < 3003000;
26         }
27        ], [libsqlite3_cv_is_recent=yes], [libsqlite3_cv_is_recent=no],
28        [libsqlite3_cv_is_recent=unknown])
29     LIBS="$saved_LIBS"])
30
31   AC_MSG_RESULT($libsqlite3_cv_is_recent)
32 ])dnl