blob: 6f39ae26634cd2577df2b8b362a9dd041da3916c [file] [log] [blame]
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05001From ede5db83e38cc8ad8c9be291cd8985f7ad99f291 Mon Sep 17 00:00:00 2001
2From: Andre McCurdy <armccurdy@gmail.com>
3Date: Tue, 16 Feb 2016 14:00:00 -0800
4Subject: [PATCH] fix --disable-static-shell
5
6Upstream sqlite seems to be moving further and further away from
7allowing the sqlite3 command line tool to be dynamically linked with
8sqlite.
9
10The --disable-static-shell configure option added in 3.10.0 no longer
11has any effect in 3.11.0. For now patch things up and make it work.
12
13Upstream-Status: Pending
14
15Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
16---
17 Makefile.am | 13 +++++++++++--
18 configure.ac | 2 +-
19 2 files changed, 12 insertions(+), 3 deletions(-)
20
21diff --git a/Makefile.am b/Makefile.am
22index 0e09cfc..608c0fd 100644
23--- a/Makefile.am
24+++ b/Makefile.am
25@@ -6,9 +6,18 @@ libsqlite3_la_SOURCES = sqlite3.c
26 libsqlite3_la_LDFLAGS = -no-undefined -version-info 8:6:8
27
28 bin_PROGRAMS = sqlite3
29-sqlite3_SOURCES = shell.c sqlite3.c sqlite3.h
30-sqlite3_LDADD = @READLINE_LIBS@
31+sqlite3_SOURCES = shell.c sqlite3.h
32+EXTRA_sqlite3_SOURCES = sqlite3.c
33+sqlite3_LDADD = @EXTRA_SHELL_OBJ@ @READLINE_LIBS@
34 sqlite3_DEPENDENCIES = @EXTRA_SHELL_OBJ@
35+
36+# Warning: Adding SQLITE_ENABLE_EXPLAIN_COMMENTS to sqlite3_CFLAGS doesn't
37+# actually have any effect if we link the sqlite3 command line tool with the
38+# libsqlite3.so shared library (which will contain a version of sqlite3.c
39+# compiled with the default AM_CFLAGS above). If SQLITE_ENABLE_EXPLAIN_COMMENTS
40+# debug is required, then sqlite3 must not be configured with
41+# --disable-static-shell
42+
43 sqlite3_CFLAGS = $(AM_CFLAGS) -DSQLITE_ENABLE_EXPLAIN_COMMENTS
44
45 include_HEADERS = sqlite3.h sqlite3ext.h
46diff --git a/configure.ac b/configure.ac
47index 8e7fd69..ada559e 100644
48--- a/configure.ac
49+++ b/configure.ac
50@@ -130,7 +130,7 @@ AC_ARG_ENABLE(static-shell, [AS_HELP_STRING(
51 [statically link libsqlite3 into shell tool [default=yes]])],
52 [], [enable_static_shell=yes])
53 if test x"$enable_static_shell" == "xyes"; then
54- EXTRA_SHELL_OBJ=sqlite3.$OBJEXT
55+ EXTRA_SHELL_OBJ=sqlite3-sqlite3.$OBJEXT
56 else
57 EXTRA_SHELL_OBJ=libsqlite3.la
58 fi
59--
601.9.1
61