From: Jeff Layton <jlayton@redhat.com>
To: bfields@fieldses.org, steved@redhat.com
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH v3 03/10] nfsdcld: add autoconf goop for sqlite
Date: Wed, 21 Dec 2011 15:35:15 -0500 [thread overview]
Message-ID: <1324499722-10363-4-git-send-email-jlayton@redhat.com> (raw)
In-Reply-To: <1324499722-10363-1-git-send-email-jlayton@redhat.com>
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>
---
aclocal/libsqlite3.m4 | 33 +++++++++++++++++++++++++++++++++
configure.ac | 7 +++++++
2 files changed, 40 insertions(+), 0 deletions(-)
create mode 100644 aclocal/libsqlite3.m4
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
diff --git a/configure.ac b/configure.ac
index eb071ef..e43ec3e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -265,9 +265,16 @@ if test "$enable_nfsv4" = yes; then
dnl check for the keyutils libraries and headers
AC_KEYUTILS
+ dnl Check for sqlite3
+ AC_SQLITE3_VERS
+
if test "$enable_nfsdcld" = "yes"; then
AC_CHECK_HEADERS([linux/nfsd/cld.h], ,
AC_MSG_ERROR([Cannot find header needed for nfsdcld]))
+
+ if test "$libsqlite3_cv_is_recent" != "yes" ; then
+ AC_MSG_ERROR([nfsdcld requires sqlite3])
+ fi
fi
AM_CONDITIONAL(CONFIG_NFSDCLD, [test "$enable_nfsdcld" = "yes" ])
--
1.7.1
next prev parent reply other threads:[~2011-12-21 20:35 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-21 20:35 [PATCH v3 00/10] nfsdcld: add a daemon to track NFSv4 client names on stable storage Jeff Layton
2011-12-21 20:35 ` [PATCH v3 01/10] autoconf: fix up libevent autoconf test Jeff Layton
2011-12-21 20:35 ` [PATCH v3 02/10] nfsdcld: add client tracking daemon stub Jeff Layton
2011-12-21 20:35 ` Jeff Layton [this message]
2011-12-21 20:35 ` [PATCH v3 04/10] nfsdcld: add routines for a sqlite backend database Jeff Layton
2011-12-21 20:35 ` [PATCH v3 05/10] nfsdcld: add remove functionality Jeff Layton
2011-12-21 20:35 ` [PATCH v3 06/10] nfsdcld: add check/update functionality Jeff Layton
2011-12-21 20:35 ` [PATCH v3 07/10] nfsdcld: add function to remove unreclaimed client records Jeff Layton
2011-12-21 20:35 ` [PATCH v3 08/10] nfsdcld: allow daemon to wait for pipe to show up Jeff Layton
2011-12-21 20:35 ` [PATCH v3 09/10] nfsdcld: add a manpage for nfsdcld Jeff Layton
2011-12-21 20:35 ` [PATCH v3 10/10] nfsdcld: update the README Jeff Layton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1324499722-10363-4-git-send-email-jlayton@redhat.com \
--to=jlayton@redhat.com \
--cc=bfields@fieldses.org \
--cc=linux-nfs@vger.kernel.org \
--cc=steved@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).