summaryrefslogtreecommitdiffstats
path: root/aclocal
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2012-04-26 11:29:22 -0400
committerSteve Dickson <steved@redhat.com>2012-04-26 13:25:03 -0400
commitdfebe7f4f25a12b615195f339192fa8837d9b5c9 (patch)
tree8b4ffc7a5c267b44949f5e23f589ef5c117ba237 /aclocal
parentaff33d2e1fd7b4c8d91ff0cc5ea6ec4da125e1e0 (diff)
downloadnfs-utils-dfebe7f4f25a12b615195f339192fa8837d9b5c9.tar.gz
nfs-utils-dfebe7f4f25a12b615195f339192fa8837d9b5c9.tar.xz
nfs-utils-dfebe7f4f25a12b615195f339192fa8837d9b5c9.zip
nfsdcld: add autoconf goop for sqlite
Mostly cribbed from Chuck Lever's new-statd rewrite a few years ago... This adds an autoconf test for the sqlite3 library and includes. If they're not working properly and nfsdcld was enabled, then configure will error out. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'aclocal')
-rw-r--r--aclocal/libsqlite3.m433
1 files changed, 33 insertions, 0 deletions
diff --git a/aclocal/libsqlite3.m4 b/aclocal/libsqlite3.m4
new file mode 100644
index 0000000..73d1e46
--- /dev/null
+++ b/aclocal/libsqlite3.m4
@@ -0,0 +1,33 @@
+dnl Checks for matching sqlite3 header and library, and
+dnl sufficient sqlite3 version.
+dnl
+AC_DEFUN([AC_SQLITE3_VERS], [
+ AC_CHECK_HEADERS([sqlite3.h], ,)
+
+ dnl look for the library; do not add to LIBS if found
+ AC_CHECK_LIB([sqlite3], [sqlite3_libversion_number], [LIBSQLITE=-lsqlite3], ,)
+ AC_SUBST(LIBSQLITE)
+
+ AC_MSG_CHECKING(for suitable sqlite3 version)
+
+ AC_CACHE_VAL([libsqlite3_cv_is_recent],
+ [
+ saved_LIBS="$LIBS"
+ LIBS=-lsqlite3
+ AC_TRY_RUN([
+ #include <stdio.h>
+ #include <sqlite3.h>
+ int main()
+ {
+ int vers = sqlite3_libversion_number();
+
+ return vers != SQLITE_VERSION_NUMBER ||
+ vers < 3003000;
+ }
+ ], [libsqlite3_cv_is_recent=yes], [libsqlite3_cv_is_recent=no],
+ [libsqlite3_cv_is_recent=unknown])
+ LIBS="$saved_LIBS"])
+
+ AC_MSG_RESULT($libsqlite3_cv_is_recent)
+ AM_CONDITIONAL(CONFIG_SQLITE3, [test "$libsqlite3_cv_is_recent" = "yes"])
+])dnl