[Pkg-ocaml-maint-commits] [ocaml-sqlite3] 09/19: Imported Upstream version 4.0.3

Stéphane Glondu glondu at moszumanska.debian.org
Wed Aug 3 13:55:24 UTC 2016


This is an automated email from the git hooks/post-receive script.

glondu pushed a commit to branch master
in repository ocaml-sqlite3.

commit caf779a31c5611f14777b3b8b8c33ea1c3191505
Author: Stephane Glondu <steph at glondu.net>
Date:   Wed Aug 3 15:37:22 2016 +0200

    Imported Upstream version 4.0.3
---
 README.md           | 24 ++++++++++-----------
 _oasis              | 12 ++++++++---
 lib/META            |  4 ++--
 lib/sqlite3_stubs.c | 27 ++++++++++++------------
 myocamlbuild.ml     | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++---
 setup.ml            | 51 ++++++++++++++++++++++++++++++++++++++------
 6 files changed, 139 insertions(+), 40 deletions(-)

diff --git a/README.md b/README.md
index af2ed1a..8bcb058 100644
--- a/README.md
+++ b/README.md
@@ -33,10 +33,10 @@ for testing various features of this library.
 SQLite3-OCaml depends on `pkg-config` to locate and compile against an
 [SQLite3](http://www.sqlite.org) library.
 
-If the SQLite3 version is larger than or equal to 3.3.7, it is assumed that it
+If the SQLite3 version is greater than or equal to 3.3.7, it is assumed that it
 supports [Run-Time Loadable Extensions](http://www.sqlite.org/loadext.html).
-If this feature has been explicitly disabled in the library, the build will
-fail with:
+If this feature has been explicitly disabled in the library, building
+applications will fail with:
 
 ```
 Undefined symbols for architecture ...:
@@ -54,6 +54,11 @@ Undefined symbols for architecture ...:
     environment variable; this will instruct the build to see if a _brewed_
     version of SQLite is installed and route `pkg-config` appropriately.
 
+  * You can explicitly disable run-time loadable extensions by calling
+    `configure` with the flag `--disable-loadable-extensions` or by setting
+    the environment variable `SQLITE3_DISABLE_LOADABLE_EXTENSIONS` if linking
+    problems persist.
+
 Credits
 -------
 
@@ -74,15 +79,10 @@ Credits
 Contact Information and Contributing
 ------------------------------------
 
-In the case of bugs, feature requests, contributions and similar, please
-contact the maintainers:
-
-  * Markus Mottl <markus.mottl at gmail.com>
-  * Christian Szegedy <csdontspam at metamatix.com>
-
-Up-to-date information should be available at:
-<http://mmottl.github.io/sqlite3-ocaml>
+In the case of bugs, feature requests, contributions and similar,
+please communicate with the maintainers using the [GitHub project
+page](https://github.com/mmottl/sqlite3-ocaml).
 
 Enjoy!
 
-Markus Mottl on February 9, 2015
+Markus Mottl on January 5, 2015
diff --git a/_oasis b/_oasis
index afb39a8..e7d0607 100644
--- a/_oasis
+++ b/_oasis
@@ -1,6 +1,6 @@
 OASISFormat:      0.4
 Name:             sqlite3
-Version:          4.0.2
+Version:          4.0.3
 Synopsis:         sqlite3-ocaml - SQLite3 bindings
 Description:      sqlite3-ocaml is an OCaml library with bindings to the
                   SQLite3 client API.  Sqlite3 is a self-contained, serverless,
@@ -12,7 +12,7 @@ Description:      sqlite3-ocaml is an OCaml library with bindings to the
 Authors:          Markus Mottl <markus.mottl at gmail.com>,
                   Christian Szegedy <csdontspam at metamatix.com>
 Copyrights:       (C) 2007-2010 Jane Street Holding LLC <opensource at janestreet.com>,
-                  (C) 2010-2015 Markus Mottl <markus.mottl at gmail.com>,
+                  (C) 2010-2016 Markus Mottl <markus.mottl at gmail.com>,
                   (C) 2005-2012 Christian Szegedy <csdontspam at metamatix.com>
 Maintainers:      Markus Mottl <markus.mottl at gmail.com>,
                   Christian Szegedy <csdontspam at metamatix.com>
@@ -37,6 +37,10 @@ Flag brewcheck
   Description:    Try to check against a homebrewed sqlite3
   Default:        false
 
+Flag loadable_extensions
+  Description:    Enable loadable extensions
+  Default:        true
+
 Library sqlite3
   Path:           lib
   FindlibName:    sqlite3
@@ -44,7 +48,9 @@ Library sqlite3
   CSources:       sqlite3_stubs.c
   CCOpt:          -g -O2 -fPIC -DPIC
   if flag(strict) && ccomp_type(cc)
-    CCOpt+:       -Wall -pedantic -Wextra -Wunused -Wno-long-long
+    CCOpt+:       -Wall -pedantic -Wextra -Wunused -Wno-long-long -Wno-keyword-macro
+  if !flag(loadable_extensions)
+    CCOpt+:       -DSQLITE3_DISABLE_LOADABLE_EXTENSIONS
   CCLib:          -lsqlite3 -lpthread
 
 
diff --git a/lib/META b/lib/META
index 094762b..25c98ad 100644
--- a/lib/META
+++ b/lib/META
@@ -1,6 +1,6 @@
 # OASIS_START
-# DO NOT EDIT (digest: 5524efdf2a9ea85569fd9184ad5804ae)
-version = "4.0.2"
+# DO NOT EDIT (digest: fa8ee36501416c86cd1e145c553d9aae)
+version = "4.0.3"
 description = "sqlite3-ocaml - SQLite3 bindings"
 archive(byte) = "sqlite3.cma"
 archive(byte, plugin) = "sqlite3.cma"
diff --git a/lib/sqlite3_stubs.c b/lib/sqlite3_stubs.c
index f34d90d..91d112d 100644
--- a/lib/sqlite3_stubs.c
+++ b/lib/sqlite3_stubs.c
@@ -49,7 +49,7 @@
 # define inline
 #endif
 
-#if SQLITE_VERSION_NUMBER >= 3003007
+#if SQLITE_VERSION_NUMBER >= 3003007 && !SQLITE3_DISABLE_LOADABLE_EXTENSIONS
 # define SQLITE_HAS_ENABLE_LOAD_EXTENSION
 #endif
 
@@ -125,7 +125,7 @@ static inline void destroy_user_exception(void *user_exc_)
 {
   user_exception *user_exn = user_exc_;
   caml_remove_global_root(&user_exn->exn);
-  free(user_exn);
+  caml_stat_free(user_exn);
 }
 
 static inline void maybe_raise_user_exception(int rc)
@@ -343,11 +343,11 @@ static inline void ref_count_finalize_dbw(db_wrap *dbw)
     user_function *link;
     for (link = dbw->user_functions; link != NULL; link = link->next) {
       caml_remove_generational_global_root(&link->v_fun);
-      free(link);
+      caml_stat_free(link);
     }
     dbw->user_functions = NULL;
     sqlite3_close(dbw->db);
-    free(dbw);
+    caml_stat_free(dbw);
   }
 }
 
@@ -419,11 +419,11 @@ CAMLprim value caml_sqlite3_open(
   caml_enter_blocking_section();
 #ifdef SQLITE_HAS_OPEN_V2
     res = sqlite3_open_v2(file, &db, flags, vfs);
-    free(vfs);
+    caml_stat_free(vfs);
 #else
     res = sqlite3_open(file, &db);
 #endif
-    free(file);
+    caml_stat_free(file);
   caml_leave_blocking_section();
 
   if (res) {
@@ -559,7 +559,7 @@ CAMLprim value caml_sqlite3_exec(value v_db, value v_maybe_cb, value v_sql)
 
   caml_enter_blocking_section();
     rc = sqlite3_exec(dbw->db, sql, cb, (void *) &cbx, NULL);
-    free(sql);
+    caml_stat_free(sql);
   caml_leave_blocking_section();
 
   if (rc == SQLITE_ABORT) caml_raise(*cbx.exn);
@@ -609,7 +609,7 @@ CAMLprim value caml_sqlite3_exec_no_headers(value v_db, value v_cb, value v_sql)
   caml_enter_blocking_section();
     rc =
       sqlite3_exec(dbw->db, sql, exec_callback_no_headers, (void *) &cbx, NULL);
-    free(sql);
+    caml_stat_free(sql);
   caml_leave_blocking_section();
 
   if (rc == SQLITE_ABORT) caml_raise(*cbx.exn);
@@ -670,7 +670,7 @@ CAMLprim value caml_sqlite3_exec_not_null(value v_db, value v_cb, value v_sql)
   caml_enter_blocking_section();
     rc =
       sqlite3_exec(dbw->db, sql, exec_not_null_callback, (void *) &cbx, NULL);
-    free(sql);
+    caml_stat_free(sql);
   caml_leave_blocking_section();
 
   if (rc == SQLITE_ABORT) {
@@ -731,7 +731,7 @@ CAMLprim value caml_sqlite3_exec_not_null_no_headers(
     rc =
       sqlite3_exec(
         dbw->db, sql, exec_not_null_no_headers_callback, (void *) &cbx, NULL);
-    free(sql);
+    caml_stat_free(sql);
   caml_leave_blocking_section();
 
   if (rc == SQLITE_ABORT) {
@@ -751,9 +751,9 @@ static inline void finalize_stmt_gc(value v_stmt)
   stmt_wrap *stmtw = Sqlite3_stmtw_val(v_stmt);
   sqlite3_stmt *stmt = stmtw->stmt;
   if (stmt) sqlite3_finalize(stmt);
-  if (stmtw->sql) free(stmtw->sql);
+  if (stmtw->sql) caml_stat_free(stmtw->sql);
   ref_count_finalize_dbw(stmtw->db_wrap);
-  free(stmtw);
+  caml_stat_free(stmtw);
 }
 
 CAMLprim value caml_sqlite3_stmt_finalize(value v_stmt)
@@ -1137,7 +1137,7 @@ static inline void unregister_user_function(db_wrap *db_data, value v_name)
       if (prev == NULL) db_data->user_functions = link->next;
       else prev->next = link->next;
       caml_remove_generational_global_root(&link->v_fun);
-      free(link);
+      caml_stat_free(link);
       break;
     }
     prev = link;
@@ -1257,4 +1257,3 @@ CAMLprim value caml_sqlite3_changes(value v_db)
   check_db(dbw, "changes");
   return Val_int(sqlite3_changes(dbw->db));
 }
-
diff --git a/myocamlbuild.ml b/myocamlbuild.ml
index bb41a99..4934ba0 100644
--- a/myocamlbuild.ml
+++ b/myocamlbuild.ml
@@ -1,5 +1,5 @@
 (* OASIS_START *)
-(* DO NOT EDIT (digest: 1308fb3d48472c2edc4cc51c862b6705) *)
+(* DO NOT EDIT (digest: ef3f6bb7de5d2441c8248057cdf28ea3) *)
 module OASISGettext = struct
 (* # 22 "src/oasis/OASISGettext.ml" *)
 
@@ -625,6 +625,20 @@ let package_default =
                       A "-ccopt";
                       A "-DPIC"
                    ]);
+               (OASISExpr.ENot (OASISExpr.EFlag "loadable_extensions"),
+                 S
+                   [
+                      A "-ccopt";
+                      A "-g";
+                      A "-ccopt";
+                      A "-O2";
+                      A "-ccopt";
+                      A "-fPIC";
+                      A "-ccopt";
+                      A "-DPIC";
+                      A "-ccopt";
+                      A "-DSQLITE3_DISABLE_LOADABLE_EXTENSIONS"
+                   ]);
                (OASISExpr.EAnd
                   (OASISExpr.EFlag "strict",
                     OASISExpr.ETest ("ccomp_type", "cc")),
@@ -647,7 +661,39 @@ let package_default =
                       A "-ccopt";
                       A "-Wunused";
                       A "-ccopt";
-                      A "-Wno-long-long"
+                      A "-Wno-long-long";
+                      A "-ccopt";
+                      A "-Wno-keyword-macro"
+                   ]);
+               (OASISExpr.EAnd
+                  (OASISExpr.EAnd
+                     (OASISExpr.EFlag "strict",
+                       OASISExpr.ETest ("ccomp_type", "cc")),
+                    OASISExpr.ENot (OASISExpr.EFlag "loadable_extensions")),
+                 S
+                   [
+                      A "-ccopt";
+                      A "-g";
+                      A "-ccopt";
+                      A "-O2";
+                      A "-ccopt";
+                      A "-fPIC";
+                      A "-ccopt";
+                      A "-DPIC";
+                      A "-ccopt";
+                      A "-Wall";
+                      A "-ccopt";
+                      A "-pedantic";
+                      A "-ccopt";
+                      A "-Wextra";
+                      A "-ccopt";
+                      A "-Wunused";
+                      A "-ccopt";
+                      A "-Wno-long-long";
+                      A "-ccopt";
+                      A "-Wno-keyword-macro";
+                      A "-ccopt";
+                      A "-DSQLITE3_DISABLE_LOADABLE_EXTENSIONS"
                    ])
             ]);
           (["oasis_library_sqlite3_cclib"; "link"],
@@ -666,7 +712,7 @@ let conf = {MyOCamlbuildFindlib.no_automatic_syntax = false}
 
 let dispatch_default = MyOCamlbuildBase.dispatch_default conf package_default;;
 
-# 670 "myocamlbuild.ml"
+# 716 "myocamlbuild.ml"
 (* OASIS_STOP *)
 
 let read_lines_from_cmd ~max_lines cmd =
@@ -755,6 +801,15 @@ let () =
           | [cflags] -> S (ocamlify ~ocaml_flag:"-ccopt" cflags)
           | _ -> failwith "pkg-config failed for cflags"
         in
+        let osqlite3_cflags =
+          try
+            ignore (Sys.getenv "SQLITE3_DISABLE_LOADABLE_EXTENSIONS");
+            S [
+              A "-ccopt"; A "-DSQLITE3_DISABLE_LOADABLE_EXTENSIONS";
+              osqlite3_cflags
+            ]
+          with _ -> osqlite3_cflags
+        in
         let sqlite3_clibs, osqlite3_clibs =
           let cmd = pkg_export ^ " pkg-config --libs sqlite3" in
           match read_lines_from_cmd ~max_lines:1 cmd with
diff --git a/setup.ml b/setup.ml
index cbe1390..104d674 100644
--- a/setup.ml
+++ b/setup.ml
@@ -1,7 +1,7 @@
 (* setup.ml generated for the first time by OASIS v0.3.0 *)
 
 (* OASIS_START *)
-(* DO NOT EDIT (digest: 4f2751487ce181081e99de1028e4c41a) *)
+(* DO NOT EDIT (digest: 34b827fa7f40294929d50e745345a17a) *)
 (*
    Regenerated by OASIS v0.4.5
    Visit http://oasis.forge.ocamlcore.org for more information and
@@ -6981,7 +6981,7 @@ let setup_t =
           alpha_features = [];
           beta_features = [];
           name = "sqlite3";
-          version = "4.0.2";
+          version = "4.0.3";
           license =
             OASISLicense.DEP5License
               (OASISLicense.DEP5Unit
@@ -6994,7 +6994,7 @@ let setup_t =
           copyrights =
             [
                "(C) 2007-2010 Jane Street Holding LLC <opensource at janestreet.com>";
-               "(C) 2010-2015 Markus Mottl <markus.mottl at gmail.com>";
+               "(C) 2010-2016 Markus Mottl <markus.mottl at gmail.com>";
                "(C) 2005-2012 Christian Szegedy <csdontspam at metamatix.com>"
             ];
           maintainers =
@@ -7073,6 +7073,16 @@ let setup_t =
                         Some "Try to check against a homebrewed sqlite3";
                       flag_default = [(OASISExpr.EBool true, false)]
                    });
+               Flag
+                 ({
+                     cs_name = "loadable_extensions";
+                     cs_data = PropList.Data.create ();
+                     cs_plugin_data = []
+                  },
+                   {
+                      flag_description = Some "Enable loadable extensions";
+                      flag_default = [(OASISExpr.EBool true, true)]
+                   });
                Library
                  ({
                      cs_name = "sqlite3";
@@ -7093,6 +7103,15 @@ let setup_t =
                         [
                            (OASISExpr.EBool true,
                              ["-g"; "-O2"; "-fPIC"; "-DPIC"]);
+                           (OASISExpr.ENot
+                              (OASISExpr.EFlag "loadable_extensions"),
+                             [
+                                "-g";
+                                "-O2";
+                                "-fPIC";
+                                "-DPIC";
+                                "-DSQLITE3_DISABLE_LOADABLE_EXTENSIONS"
+                             ]);
                            (OASISExpr.EAnd
                               (OASISExpr.EFlag "strict",
                                 OASISExpr.ETest ("ccomp_type", "cc")),
@@ -7105,7 +7124,27 @@ let setup_t =
                                 "-pedantic";
                                 "-Wextra";
                                 "-Wunused";
-                                "-Wno-long-long"
+                                "-Wno-long-long";
+                                "-Wno-keyword-macro"
+                             ]);
+                           (OASISExpr.EAnd
+                              (OASISExpr.EAnd
+                                 (OASISExpr.EFlag "strict",
+                                   OASISExpr.ETest ("ccomp_type", "cc")),
+                                OASISExpr.ENot
+                                  (OASISExpr.EFlag "loadable_extensions")),
+                             [
+                                "-g";
+                                "-O2";
+                                "-fPIC";
+                                "-DPIC";
+                                "-Wall";
+                                "-pedantic";
+                                "-Wextra";
+                                "-Wunused";
+                                "-Wno-long-long";
+                                "-Wno-keyword-macro";
+                                "-DSQLITE3_DISABLE_LOADABLE_EXTENSIONS"
                              ])
                         ];
                       bs_cclib =
@@ -7523,7 +7562,7 @@ let setup_t =
        };
      oasis_fn = Some "_oasis";
      oasis_version = "0.4.5";
-     oasis_digest = Some "\t��%�~;��\t=��\\¶";
+     oasis_digest = Some "\026�2=��-\007\130B�\026�\151٠";
      oasis_exec = None;
      oasis_setup_args = [];
      setup_update = false
@@ -7531,6 +7570,6 @@ let setup_t =
 
 let setup () = BaseSetup.setup setup_t;;
 
-# 7535 "setup.ml"
+# 7574 "setup.ml"
 (* OASIS_STOP *)
 let () = setup ();;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ocaml-maint/packages/ocaml-sqlite3.git



More information about the Pkg-ocaml-maint-commits mailing list