summaryrefslogtreecommitdiff
blob: dd529da7a7c674ced87f585343ced71d71f55ada (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
From 58aa0e8547a29e147f3d9d1792117d96bc00ffda Mon Sep 17 00:00:00 2001
From: Lars Wendler <polynomial-c@gentoo.org>
Date: Thu, 8 Apr 2021 11:05:36 +0200
Subject: [PATCH] gnupg: configure.ac: Fix sqlite3 detection

or else --disable-sqlite has no effect and linking later fails with:

  keyboxd-backend-sqlite.o: in function `show_sqlstmt.part.0':
  backend-sqlite.c:(.text+0x42): undefined reference to `sqlite3_expanded_sql'

Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
---
 configure.ac | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/configure.ac b/configure.ac
index 9cf0c6a7f..d46469cbb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -969,18 +969,20 @@ AC_ARG_ENABLE(sqlite,
                                [disable the use of SQLITE]),
               try_sqlite=$enableval, try_sqlite=yes)
 
-if test x"$use_tofu" = xyes ; then
-  if test x"$try_sqlite" = xyes ; then
+AS_IF([test x"$try_sqlite" = xyes], [
     PKG_CHECK_MODULES([SQLITE3], [sqlite3 >= $NEED_SQLITE_VERSION],
                                  [have_sqlite=yes],
                                  [have_sqlite=no])
-  fi
-  if test "$have_sqlite" = "yes"; then
-    :
-    AC_SUBST([SQLITE3_CFLAGS])
-    AC_SUBST([SQLITE3_LIBS])
-  else
-    use_tofu=no
+    AS_IF([test "$have_sqlite" = "yes"], [
+        AC_SUBST([SQLITE3_CFLAGS])
+        AC_SUBST([SQLITE3_LIBS])
+    ])
+    ])
+
+AS_IF([test "$have_sqlite" != "yes"], [
+    AS_IF([test x"$use_tofu" = xyes], [
+	use_tofu=no
+    ])
     build_keyboxd=no
     tmp=$(echo "$SQLITE3_PKG_ERRORS" | tr '\n' '\v' | sed 's/\v/\n*** /g')
     AC_MSG_WARN([[
@@ -988,8 +990,7 @@ if test x"$use_tofu" = xyes ; then
 *** Building without SQLite support - TOFU and Keyboxd disabled
 ***
 *** $tmp]])
-  fi
-fi
+])
 
 AM_CONDITIONAL(SQLITE3, test "$have_sqlite" = "yes")
 
-- 
2.31.1