summaryrefslogtreecommitdiffstats
path: root/patches/sqlite-autoconf-3280000/0001-configure-make-disable-threadsafe-work.patch
blob: 1e3a641a72b6b487cc95c3825f49354812b5f452 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From: Roland Hieber <rhi@pengutronix.de>
Date: Tue, 9 Jul 2019 12:18:52 +0200
Subject: [PATCH] configure: make --disable-threadsafe work

SQLITE_THREADSAFE can be 0, 1 or 2, and if it is not defined, it
is defined to 1 by default in sqlite3.c.

_REENTRANT only needs to be defined or undefined according to
https://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html#Feature-Test-Macros

Forwarded: https://www.mail-archive.com/sqlite-users@mailinglists.sqlite.org/msg115812.html
Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
 configure.ac | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configure.ac b/configure.ac
index f0b70b96428c..3044077e93f6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -91,6 +91,8 @@ if test x"$enable_threadsafe" != "xno"; then
   BUILD_CFLAGS="$BUILD_CFLAGS -D_REENTRANT=1 -DSQLITE_THREADSAFE=1"
   AC_SEARCH_LIBS(pthread_create, pthread)
   AC_SEARCH_LIBS(pthread_mutexattr_init, pthread)
+else
+  BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_THREADSAFE=0"
 fi
 #-----------------------------------------------------------------------