aboutsummaryrefslogtreecommitdiff
path: root/m4/libsqlite.m4
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-03-18 15:30:06 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-03-18 15:30:06 +0200
commit41c7293bf991e4449c41224e812634b414ec5b83 (patch)
treecf956be48694bf8c1ea08e9250486e2191c7f799 /m4/libsqlite.m4
parent62e7abd564f6f9c7a3ab9e7e469853c93bd0e4c9 (diff)
Autotools and VC++ build systems setup
Diffstat (limited to 'm4/libsqlite.m4')
-rw-r--r--m4/libsqlite.m447
1 files changed, 47 insertions, 0 deletions
diff --git a/m4/libsqlite.m4 b/m4/libsqlite.m4
new file mode 100644
index 0000000..2ad9eb1
--- /dev/null
+++ b/m4/libsqlite.m4
@@ -0,0 +1,47 @@
+dnl file : m4/libsqlite.m4
+dnl author : Boris Kolpackov <boris@codesynthesis.com>
+dnl copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC
+dnl license : GNU GPL v2; see accompanying LICENSE file
+dnl
+dnl LIBSQLITE([ACTION-IF-FOUND[,ACTION-IF-NOT-FOUND]])
+dnl
+dnl
+AC_DEFUN([LIBSQLITE], [
+libsqlite_found=no
+
+AC_MSG_CHECKING([for libsqlite3])
+
+save_LIBS="$LIBS"
+LIBS="-lsqlite3 $LIBS"
+
+CXX_LIBTOOL_LINK_IFELSE(
+AC_LANG_SOURCE([[
+#include <sqlite3.h>
+
+int
+main ()
+{
+ sqlite3* handle;
+ sqlite3_open_v2 ("", &handle, 0, 0);
+ sqlite3_stmt* stmt;
+ sqlite3_prepare_v2 (handle, "", 0, &stmt, 0);
+ sqlite3_finalize (stmt);
+ sqlite3_close (handle);
+}
+]]),
+[
+libsqlite_found=yes
+])
+
+if test x"$libsqlite_found" = xno; then
+ LIBS="$save_LIBS"
+fi
+
+if test x"$libsqlite_found" = xyes; then
+ AC_MSG_RESULT([yes])
+ $1
+else
+ AC_MSG_RESULT([no])
+ $2
+fi
+])dnl