[libgda] sqlite: upgraded to 3.22.0 minimum version



commit c6a42c8883a0b7b79d0e1e22b754f6eee4ffb83e
Author: Daniel Espinosa <esodan gmail com>
Date:   Fri Oct 26 11:57:07 2018 -0500

    sqlite: upgraded to 3.22.0 minimum version

 configure.ac                                |  2 +-
 libgda/sqlite/gda-symbols-util.c            |  2 ++
 libgda/sqlite/gda-symbols-util.h            |  1 +
 libgda/sqlite/virtual/gda-vconnection-hub.c |  2 +-
 meson.build                                 | 14 ++++++--------
 providers/sqlite/meson.build                |  1 +
 6 files changed, 12 insertions(+), 10 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 79d2736dd..086db2076 100644
--- a/configure.ac
+++ b/configure.ac
@@ -731,7 +731,7 @@ else
                [use_syst_sqlite=$enableval], [use_syst_sqlite="yes"])
 
        if test "x$use_syst_sqlite" = "xyes"; then
-               SQLITE_MODULES="sqlite3 >= 3.6.11"
+               SQLITE_MODULES="sqlite3 >= 3.22.0"
                PKG_CHECK_MODULES(SQLITE, $SQLITE_MODULES, have_sqlite=yes, have_sqlite=no)
                if test x"$have_sqlite" = "xyes"
                then
diff --git a/libgda/sqlite/gda-symbols-util.c b/libgda/sqlite/gda-symbols-util.c
index ee76ae39a..ff879bf85 100644
--- a/libgda/sqlite/gda-symbols-util.c
+++ b/libgda/sqlite/gda-symbols-util.c
@@ -238,6 +238,8 @@ load_symbols (GModule *module)
                goto onerror;
        if (! g_module_symbol (module, "sqlite3_open", (gpointer*) &(s3r->sqlite3_open)))
                goto onerror;
+       if (! g_module_symbol (module, "sqlite3_open_v2", (gpointer*) &(s3r->sqlite3_open_v2)))
+               goto onerror;
        if (! g_module_symbol (module, "sqlite3_prepare", (gpointer*) &(s3r->sqlite3_prepare)))
                goto onerror;
        if (! g_module_symbol (module, "sqlite3_prepare_v2", (gpointer*) &(s3r->sqlite3_prepare_v2)))
diff --git a/libgda/sqlite/gda-symbols-util.h b/libgda/sqlite/gda-symbols-util.h
index f27e17194..f49b3fc03 100644
--- a/libgda/sqlite/gda-symbols-util.h
+++ b/libgda/sqlite/gda-symbols-util.h
@@ -83,6 +83,7 @@ typedef struct {
        void *(*sqlite3_malloc)(int);
        char * (*sqlite3_mprintf)(const char*,...);
        int  (*sqlite3_open)(const char*,sqlite3**);
+       int  (*sqlite3_open_v2)(const char *filename, sqlite3 **ppDb, int flags, const char *zVfs);
        int  (*sqlite3_prepare)(sqlite3*,const char*,int,sqlite3_stmt**,const char**);
        int (*sqlite3_prepare_v2)(sqlite3*,const char*,int,sqlite3_stmt**,const char**);
 
diff --git a/libgda/sqlite/virtual/gda-vconnection-hub.c b/libgda/sqlite/virtual/gda-vconnection-hub.c
index 48d264cca..e7e09914a 100644
--- a/libgda/sqlite/virtual/gda-vconnection-hub.c
+++ b/libgda/sqlite/virtual/gda-vconnection-hub.c
@@ -89,7 +89,7 @@ gda_vconnection_hub_dispose (GObject *object)
        if (cnc->priv) {
                gda_connection_close ((GdaConnection *) cnc, NULL);
                if (cnc->priv->hub_connections) {
-                       g_slist_free_full (cnc->priv->hub_connections, hub_connection_free);
+                       g_slist_free_full (cnc->priv->hub_connections, (GDestroyNotify) hub_connection_free);
                        cnc->priv->hub_connections = NULL;
                }
                if (cnc->priv->internal_parser)
diff --git a/meson.build b/meson.build
index db86d3dbd..61db044ab 100644
--- a/meson.build
+++ b/meson.build
@@ -89,11 +89,11 @@ lbdb_cargs = []
 #      endif
 # endforeach
 
-sqlite_dep = dependency ('sqlite3', version: '>= 3.6.11', required: false)
+sqlite_dep = dependency ('sqlite3', version: '>= 3.22.0', required: false)
 sqlite_internal = true
 if sqlite_dep.found()
-       sqlite3_table_column_metadata = compiler.find_library('sqlite3_table_column_metadata', required: 
false)
-       if sqlite3_table_column_metadata.found()
+       sqlite3_table_column_metadata = compiler.has_function('sqlite3_table_column_metadata', required: 
false)
+       if not sqlite3_table_column_metadata
                sqlite_internal = false
        endif
 endif
@@ -102,15 +102,13 @@ endif
 sqlcipher_dep = dependency ('sqlcipher', version: '>= 3.4.1', required: false)
 sqlcipher_internal = true
 if sqlcipher_dep.found() and get_option('system-sqlcipher')
-       sqlcipher_table_column_metadata = compiler.find_library('sqlcipher_table_column_metadata', required: 
false)
-       if sqlcipher_table_column_metadata.found()
+       sqlcipher_table_column_metadata = compiler.find_function('sqlcipher_table_column_metadata', required: 
false)
+       if sqlcipher_table_column_metadata
                sqlcipher_internal = false
        endif
 endif
 
-if sqlite_internal
-       ldl = compiler.find_library('dl')
-endif
+ldl = compiler.find_library('dl', required: false)
 
 sed = find_program('sed')
 compile_resources = find_program('glib-compile-resources')
diff --git a/providers/sqlite/meson.build b/providers/sqlite/meson.build
index 5839de482..d74761815 100644
--- a/providers/sqlite/meson.build
+++ b/providers/sqlite/meson.build
@@ -73,6 +73,7 @@ libgda_sqlite_provider = library ('gda-sqlite-'+project_api_version,
        c_args: [
                '-include',
                meson.build_root() + '/config.h',
+               '-I'+join_paths(get_option ('prefix'), get_option('includedir'))
                ],
        link_with: libgda,
        install: true,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]