diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-01-27 18:34:18 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-01-27 18:34:18 +0200 |
commit | 8c41d647fab4dfbd0a9979514f95431dfc19e00b (patch) | |
tree | 55a1634b0ccaf337ee12dc54d5b11f6c4bb4f391 /m4/libsqlite.m4 | |
parent | 4e31e3dcf3efcc20ca3aee6f888fe3ec56ba78e3 (diff) |
Detect if column metadata functions are available
For example, system-default build of SQLite doesn't have
SQLITE_ENABLE_COLUMN_METADATA.
Diffstat (limited to 'm4/libsqlite.m4')
-rw-r--r-- | m4/libsqlite.m4 | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/m4/libsqlite.m4 b/m4/libsqlite.m4 index a8fe4f7..36f92f8 100644 --- a/m4/libsqlite.m4 +++ b/m4/libsqlite.m4 @@ -7,9 +7,13 @@ dnl dnl Also sets libsqlite_unlock_notify to yes if sqlite3_unlock_notify() dnl functionality is available. dnl +dnl Also sets libsqlite_column_metadata to yes if sqlite3_column_*() +dnl functions are available. +dnl AC_DEFUN([LIBSQLITE], [ libsqlite_found=no libsqlite_unlock_notify=no +libsqlite_column_metadata=no AC_MSG_CHECKING([for libsqlite3]) @@ -58,6 +62,27 @@ libsqlite_unlock_notify=yes ]) fi +# Check for column_metadata. +# +if test x"$libsqlite_found" = xyes; then +CXX_LIBTOOL_LINK_IFELSE([ +AC_LANG_SOURCE([ +#include <sqlite3.h> + +int +main () +{ + sqlite3_stmt* stmt (0); + sqlite3_column_database_name (stmt, 0); + sqlite3_column_table_name (stmt, 0); + sqlite3_column_origin_name (stmt, 0); +} +])], +[ +libsqlite_column_metadata=yes +]) +fi + if test x"$libsqlite_found" = xyes; then AC_MSG_RESULT([yes]) $1 |