]> git.sur5r.net Git - bacula/bacula/commitdiff
Add check for sqlite3_threadsafe() in configure
authorEric Bollengier <eric@eb.homelinux.org>
Sun, 14 Feb 2010 17:12:41 +0000 (18:12 +0100)
committerEric Bollengier <eric@eb.homelinux.org>
Mon, 2 Aug 2010 14:49:30 +0000 (16:49 +0200)
bacula/autoconf/config.h.in
bacula/autoconf/configure.in
bacula/src/cats/sqlite.c

index 15e4ea5086d1351ea6ea38709392eac6213539f0..1c1791cc357e2c648b89e584b7580a020ce51e5b 100644 (file)
 /* Set if have PQputCopyData */
 #undef HAVE_PQ_COPY
 
+/* Set if have sqlite3_threadsafe */
+#undef HAVE_SQLITE3_THREADSAFE
+
 /* Define to 1 if you have the `prctl' function. */
 #undef HAVE_PRCTL
 
index b85a63eccec5a133f7d65d1daa8228944fb54af3..c1baf6c2e0dde516b8f2e6c6a7f2b990ebe307c5 100644 (file)
@@ -1789,6 +1789,7 @@ if test x$DB_TYPE = xdbi; then
    if test $DB_PROG = sqlite3; then
       A=`test -f $SQL_LIB && nm $DB_PROG_LIB | grep pthread_mutex_lock`
       pkg=$?
+      AC_CHECK_LIB(sqlite3, sqlite3_threadsafe, AC_DEFINE(HAVE_SQLITE3_THREADSAFE, 1, [Set if have sqlite3_threadsafe]))
    fi
 
    if test $pkg = 0; then
index 22680e2f4a4d23353133b0d7a82a8cbebe3880dd..79d586864f4f6aca843403536b61c7017160e5fd 100644 (file)
@@ -274,10 +274,12 @@ db_close_database(JCR *jcr, B_DB *mdb)
 void db_check_backend_thread_safe()
 {
 #ifdef HAVE_BATCH_FILE_INSERT
+# ifdef HAVE_SQLITE3_THREADSAFE
    if (!sqlite3_threadsafe()) {
       Emsg0(M_ABORT, 0, _("SQLite3 client library must be thread-safe "
                           "when using BatchMode.\n"));
    }
+# endif
 #endif
 }