Skip to content

Commit ca310fa

Browse files
committed
Snapshot of upstream SQLite 3.49.2
1 parent 43631c6 commit ca310fa

27 files changed

Lines changed: 996 additions & 433 deletions

Makefile.in

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ libdir = @libdir@
7979

8080
INSTALL = @BIN_INSTALL@
8181
AR = @AR@
82-
AR.flags = cr # TODO? Add a configure test to determine this?
82+
AR.flags = cr
8383
CC = @CC@
8484
B.cc = @CC_FOR_BUILD@ @BUILD_CFLAGS@
8585
T.cc = $(CC)
@@ -122,13 +122,21 @@ LDFLAGS.rt = @LDFLAGS_RT@
122122
CFLAGS.icu = @CFLAGS_ICU@
123123
LDFLAGS.libsqlite3.soname = @LDFLAGS_LIBSQLITE3_SONAME@
124124
# soname: see https://sqlite.org/src/forumpost/5a3b44f510df8ded
125-
LDFLAGS.libsqlite3.os-specific = @LDFLAGS_MAC_CVERSION@ @LDFLAGS_OUT_IMPLIB@
125+
LDFLAGS.libsqlite3.os-specific = \
126+
@LDFLAGS_MAC_CVERSION@ @LDFLAGS_MAC_INSTALL_NAME@ @LDFLAGS_OUT_IMPLIB@
126127
# os-specific: see
127128
# - https://sqlite.org/forum/forumpost/9dfd5b8fd525a5d7
128129
# - https://sqlite.org/forum/forumpost/0c7fc097b2
129-
ENABLE_SHARED = @ENABLE_SHARED@
130-
ENABLE_STATIC = @ENABLE_STATIC@
130+
# - https://sqlite.org/forum/forumpost/5651662b8875ec0a
131+
132+
libsqlite3.DLL.basename = @SQLITE_DLL_BASENAME@
133+
# DLL.basename: see https://sqlite.org/forum/forumpost/828fdfe904
134+
libsqlite3.out.implib = @SQLITE_OUT_IMPLIB@
135+
# libsqlite3.out.implib => the output filename part of LDFLAGS_OUT_IMPLIB.
136+
ENABLE_LIB_SHARED = @ENABLE_LIB_SHARED@
137+
ENABLE_LIB_STATIC = @ENABLE_LIB_STATIC@
131138
HAVE_WASI_SDK = @HAVE_WASI_SDK@
139+
libsqlite3.DLL.install-rules = @SQLITE_DLL_INSTALL_RULES@
132140

133141
T.cc.sqlite = $(T.cc) @TARGET_DEBUG@
134142

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.49.1
1+
3.49.2

auto.def

Lines changed: 35 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -4,70 +4,44 @@
44
# This is the main autosetup-compatible configure script for the
55
# SQLite project.
66
#
7-
# This script should be kept compatible with JimTCL, a copy of which
8-
# is included in this source tree as ./autosetup/jimsh0.c. The number
9-
# of incompatibilities between canonical TCL and JimTCL is very low
10-
# and alternative formulations of incompatible constructs have, so
11-
# far, been easy to find.
7+
# This script and all of its dependencies must be kept compatible with
8+
# JimTCL, a copy of which is included in this source tree as
9+
# ./autosetup/jimsh0.c. The number of incompatibilities between
10+
# canonical TCL and JimTCL is very low and alternative formulations of
11+
# incompatible constructs have, so far, been easy to find.
1212
#
1313
# JimTCL: https://jim.tcl.tk
1414
#
1515

1616
use sqlite-config
17-
sqlite-config-bootstrap canonical
18-
sqlite-setup-default-cflags
19-
proj-if-opt-truthy dev {
20-
# --enable-dev needs to come early so that the downstream tests
21-
# which check for the following flags use their updated state.
22-
proj-opt-set all 1
23-
proj-opt-set debug 1
24-
proj-opt-set amalgamation 0
25-
define CFLAGS [get-env CFLAGS {-O0 -g}]
26-
# -------------^^^^^^^ intentionally using [get-env] instead of
27-
# [proj-get-env] here because [sqlite-setup-default-cflags] uses
28-
# [proj-get-env] and we want this to supercede that.
17+
sqlite-configure canonical {
18+
proj-if-opt-truthy dev {
19+
# --enable-dev needs to come early so that the downstream tests
20+
# which check for the following flags use their updated state.
21+
proj-opt-set all 1
22+
proj-opt-set debug 1
23+
proj-opt-set amalgamation 0
24+
define CFLAGS [get-env CFLAGS {-O0 -g}]
25+
# -------------^^^^^^^ intentionally using [get-env] instead of
26+
# [proj-get-env] here because [sqlite-setup-default-cflags] uses
27+
# [proj-get-env] and we want this to supercede that.
28+
}
29+
sqlite-check-common-bins ;# must come before [sqlite-handle-wasi-sdk]
30+
sqlite-handle-wasi-sdk ;# must run relatively early, as it changes the environment
31+
sqlite-check-common-system-deps
32+
33+
proj-define-for-opt amalgamation USE_AMALGAMATION "Use amalgamation for builds?"
34+
35+
proj-define-for-opt gcov USE_GCOV "Use gcov?"
36+
37+
proj-define-for-opt test-status TSTRNNR_OPTS \
38+
"test-runner flags:" {--status} {}
39+
40+
proj-define-for-opt linemacros AMALGAMATION_LINE_MACROS \
41+
"Use #line macros in the amalgamation:"
42+
43+
define LINK_TOOLS_DYNAMICALLY [proj-opt-was-provided dynlink-tools]
44+
45+
sqlite-handle-tcl
46+
sqlite-handle-emsdk
2947
}
30-
31-
sqlite-check-common-bins ;# must come before [sqlite-handle-wasi-sdk]
32-
sqlite-handle-wasi-sdk ;# must run relatively early, as it changes the environment
33-
sqlite-check-common-system-deps
34-
35-
#
36-
# Enable large file support (if special flags are necessary)
37-
#
38-
define HAVE_LFS 0
39-
if {[opt-bool largefile]} {
40-
cc-check-lfs
41-
}
42-
43-
proj-define-for-opt shared ENABLE_SHARED "Build shared library?"
44-
45-
if {![proj-define-for-opt static ENABLE_STATIC \
46-
"Build static library?"]} {
47-
proj-warn "Static lib build may be implicitly re-activated by other components, e.g. some test apps."
48-
}
49-
50-
proj-define-for-opt amalgamation USE_AMALGAMATION "Use amalgamation for builds?"
51-
52-
proj-define-for-opt gcov USE_GCOV "Use gcov?"
53-
54-
proj-define-for-opt test-status TSTRNNR_OPTS \
55-
"test-runner flags:" {--status} {}
56-
57-
proj-define-for-opt linemacros AMALGAMATION_LINE_MACROS \
58-
"Use #line macros in the amalgamation:"
59-
60-
define LINK_TOOLS_DYNAMICALLY [proj-opt-was-provided dynlink-tools]
61-
62-
proj-check-rpath
63-
sqlite-handle-soname
64-
sqlite-handle-debug
65-
sqlite-handle-tcl
66-
sqlite-handle-threadsafe
67-
sqlite-handle-tempstore
68-
sqlite-handle-line-editing
69-
sqlite-handle-load-extension
70-
sqlite-handle-math
71-
sqlite-handle-icu
72-
sqlite-handle-emsdk
73-
sqlite-config-finalize

autoconf/Makefile.in

Lines changed: 63 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,8 @@ OPT_FEATURE_FLAGS = @OPT_FEATURE_FLAGS@
127127

128128
LDFLAGS.libsqlite3.soname = @LDFLAGS_LIBSQLITE3_SONAME@
129129
# soname: see https://sqlite.org/src/forumpost/5a3b44f510df8ded
130-
LDFLAGS.libsqlite3.os-specific = @LDFLAGS_MAC_CVERSION@ @LDFLAGS_OUT_IMPLIB@
131-
# os-specific: see
132-
# - https://sqlite.org/forum/forumpost/9dfd5b8fd525a5d7
133-
# - https://sqlite.org/forum/forumpost/0c7fc097b2
130+
LDFLAGS.libsqlite3.os-specific = \
131+
@LDFLAGS_MAC_CVERSION@ @LDFLAGS_MAC_INSTALL_NAME@ @LDFLAGS_OUT_IMPLIB@
134132

135133
LDFLAGS.libsqlite3 = \
136134
$(LDFLAGS.rpath) $(LDFLAGS.pthread) \
@@ -143,57 +141,76 @@ sqlite3.o: $(TOP)/sqlite3.h $(TOP)/sqlite3.c
143141
$(CC) -c $(TOP)/sqlite3.c -o $@ $(CFLAGS) $(CFLAGS.libsqlite3)
144142

145143
libsqlite3.LIB = libsqlite3$(T.lib)
146-
libsqlite3.SO = libsqlite3$(T.dll)
144+
libsqlite3.DLL.basename = @SQLITE_DLL_BASENAME@
145+
libsqlite3.out.implib = @SQLITE_OUT_IMPLIB@
146+
libsqlite3.DLL = $(libsqlite3.DLL.basename)$(T.dll)
147+
libsqlite3.DLL.install-rules = @SQLITE_DLL_INSTALL_RULES@
147148

148-
$(libsqlite3.SO): sqlite3.o
149+
$(libsqlite3.DLL): sqlite3.o
149150
$(CC) -o $@ sqlite3.o $(LDFLAGS.shlib) \
150151
$(LDFLAGS) $(LDFLAGS.libsqlite3) \
151152
$(LDFLAGS.libsqlite3.os-specific) $(LDFLAGS.libsqlite3.soname)
152-
all: $(libsqlite3.SO)
153+
$(libsqlite3.DLL)-1: $(libsqlite3.DLL)
154+
$(libsqlite3.DLL)-0:
155+
all: $(libsqlite3.DLL)-$(ENABLE_LIB_SHARED)
153156

154157
$(libsqlite3.LIB): sqlite3.o
155158
$(AR) $(AR.flags) $@ sqlite3.o
156-
all: $(libsqlite3.LIB)
159+
$(libsqlite3.LIB)-1: $(libsqlite3.LIB)
160+
$(libsqlite3.LIB)-0:
161+
all: $(libsqlite3.LIB)-$(ENABLE_LIB_STATIC)
157162

158-
install-so-1: $(install-dir.lib) $(libsqlite3.SO)
159-
$(INSTALL) $(libsqlite3.SO) "$(install-dir.lib)"
160-
@if [ -f $(libsqlite3.SO).a ]; then \
161-
$(INSTALL) $(libsqlite3.SO).a "$(install-dir.lib)"; \
163+
#
164+
# Maintenance reminder: the install-dll-... rules must be kept in sync
165+
# with the main copies rom /main.mk.
166+
#
167+
install-dll-out-implib: $(install-dir.lib) $(libsqlite3.DLL)
168+
if [ x != "x$(libsqlite3.out.implib)" ] && [ -f "$(libsqlite3.out.implib)" ]; then \
169+
$(INSTALL) $(libsqlite3.out.implib) "$(install-dir.lib)"; \
162170
fi
163-
@echo "Setting up $(libsqlite3.SO) version symlinks..."; \
164-
if [ x.dll = x$(T.dll) ]; then \
165-
echo "No library symlinks needed on this platform"; \
166-
elif [ x.dylib = x$(T.dll) ]; then \
167-
cd "$(install-dir.lib)" || exit $$?; \
168-
rm -f libsqlite3.0$(T.dll) libsqlite3.$(PACKAGE_VERSION)$(T.dll) || exit $$?; \
169-
dllname=libsqlite3.$(PACKAGE_VERSION)$(T.dll); \
170-
mv $(libsqlite3.SO) $$dllname || exit $$?; \
171-
ln -s $$dllname $(libsqlite3.SO) || exit $$?; \
172-
ln -s $$dllname libsqlite3.0$(T.dll) || exit $$?; \
173-
ls -la $$dllname $(libsqlite3.SO) libsqlite3.0$(T.dll); \
174-
else \
175-
cd "$(install-dir.lib)" || exit $$?; \
176-
rm -f $(libsqlite3.SO).0 $(libsqlite3.SO).$(PACKAGE_VERSION) || exit $$?; \
177-
mv $(libsqlite3.SO) $(libsqlite3.SO).$(PACKAGE_VERSION) || exit $$?; \
178-
ln -s $(libsqlite3.SO).$(PACKAGE_VERSION) $(libsqlite3.SO) || exit $$?; \
179-
ln -s $(libsqlite3.SO).$(PACKAGE_VERSION) $(libsqlite3.SO).0 || exit $$?; \
180-
ls -la $(libsqlite3.SO) $(libsqlite3.SO).[a03]*; \
181-
if [ -e $(libsqlite3.SO).0.8.6 ]; then \
182-
echo "ACHTUNG: legacy libtool-compatible install found. Re-linking it..."; \
183-
rm -f libsqlite3.la $(libsqlite3.SO).0.8.6 || exit $$?; \
184-
ln -s $(libsqlite3.SO).$(PACKAGE_VERSION) $(libsqlite3.SO).0.8.6 || exit $$?; \
185-
ls -la $(libsqlite3.SO).0.8.6; \
186-
elif [ x1 = "x$(INSTALL_SO_086_LINK)" ]; then \
187-
echo "ACHTUNG: installing legacy libtool-style links because INSTALL_SO_086_LINK=1"; \
188-
rm -f libsqlite3.la $(libsqlite3.SO).0.8.6 || exit $$?; \
189-
ln -s $(libsqlite3.SO).$(PACKAGE_VERSION) $(libsqlite3.SO).0.8.6 || exit $$?; \
190-
ls -la $(libsqlite3.SO).0.8.6; \
191-
fi; \
171+
172+
install-dll-unix-generic: install-dll-out-implib
173+
$(INSTALL) $(libsqlite3.DLL) "$(install-dir.lib)"
174+
@echo "Setting up $(libsqlite3.DLL) version symlinks..."; \
175+
cd "$(install-dir.lib)" || exit $$?; \
176+
rm -f $(libsqlite3.DLL).0 $(libsqlite3.DLL).$(PACKAGE_VERSION) || exit $$?; \
177+
mv $(libsqlite3.DLL) $(libsqlite3.DLL).$(PACKAGE_VERSION) || exit $$?; \
178+
ln -s $(libsqlite3.DLL).$(PACKAGE_VERSION) $(libsqlite3.DLL) || exit $$?; \
179+
ln -s $(libsqlite3.DLL).$(PACKAGE_VERSION) $(libsqlite3.DLL).0 || exit $$?; \
180+
ls -la $(libsqlite3.DLL) $(libsqlite3.DLL).[a03]*; \
181+
if [ -e $(libsqlite3.DLL).0.8.6 ]; then \
182+
echo "ACHTUNG: legacy libtool-compatible install found. Re-linking it..."; \
183+
rm -f libsqlite3.la $(libsqlite3.DLL).0.8.6 || exit $$?; \
184+
ln -s $(libsqlite3.DLL).$(PACKAGE_VERSION) $(libsqlite3.DLL).0.8.6 || exit $$?; \
185+
ls -la $(libsqlite3.DLL).0.8.6; \
186+
elif [ x1 = "x$(INSTALL_SO_086_LINK)" ]; then \
187+
echo "ACHTUNG: installing legacy libtool-style links because INSTALL_SO_086_LINK=1"; \
188+
rm -f libsqlite3.la $(libsqlite3.DLL).0.8.6 || exit $$?; \
189+
ln -s $(libsqlite3.DLL).$(PACKAGE_VERSION) $(libsqlite3.DLL).0.8.6 || exit $$?; \
190+
ls -la $(libsqlite3.DLL).0.8.6; \
192191
fi
193192

194-
install-so-0 install-so-:
195-
install-so: install-so-$(ENABLE_LIB_SHARED)
196-
install: install-so
193+
install-dll-msys: install-dll-out-implib $(install-dir.bin)
194+
$(INSTALL) $(libsqlite3.DLL) "$(install-dir.bin)"
195+
# ----------------------------------------------^^^ yes, bin
196+
install-dll-mingw: install-dll-msys
197+
install-dll-cygwin: install-dll-msys
198+
199+
install-dll-darwin: $(install-dir.lib) $(libsqlite3.DLL)
200+
$(INSTALL) $(libsqlite3.DLL) "$(install-dir.lib)"
201+
@echo "Setting up $(libsqlite3.DLL) version symlinks..."; \
202+
cd "$(install-dir.lib)" || exit $$?; \
203+
rm -f libsqlite3.0$(T.dll) libsqlite3.$(PACKAGE_VERSION)$(T.dll) || exit $$?; \
204+
dllname=libsqlite3.$(PACKAGE_VERSION)$(T.dll); \
205+
mv $(libsqlite3.DLL) $$dllname || exit $$?; \
206+
ln -s $$dllname $(libsqlite3.DLL) || exit $$?; \
207+
ln -s $$dllname libsqlite3.0$(T.dll) || exit $$?; \
208+
ls -la $$dllname $(libsqlite3.DLL) libsqlite3.0$(T.dll)
209+
210+
install-dll-1: install-dll-$(libsqlite3.DLL.install-rules)
211+
install-dll-0 install-dll-:
212+
install-dll: install-dll-$(ENABLE_LIB_SHARED)
213+
install: install-dll
197214

198215
install-lib-1: $(install-dir.lib) $(libsqlite3.LIB)
199216
$(INSTALL.noexec) $(libsqlite3.LIB) "$(install-dir.lib)"
@@ -209,7 +226,7 @@ ENABLE_STATIC_SHELL = @ENABLE_STATIC_SHELL@
209226
sqlite3-shell-link-flags.1 = $(TOP)/sqlite3.c $(LDFLAGS.libsqlite3)
210227
sqlite3-shell-link-flags.0 = -L. -lsqlite3 $(LDFLAGS.zlib)
211228
sqlite3-shell-deps.1 = $(TOP)/sqlite3.c
212-
sqlite3-shell-deps.0 = $(libsqlite3.SO)
229+
sqlite3-shell-deps.0 = $(libsqlite3.DLL)
213230
sqlite3$(T.exe): $(TOP)/shell.c $(sqlite3-shell-deps.$(ENABLE_STATIC_SHELL))
214231
$(CC) -o $@ \
215232
$(TOP)/shell.c $(sqlite3-shell-link-flags.$(ENABLE_STATIC_SHELL)) \
@@ -237,7 +254,7 @@ install: install-man1
237254

238255
clean:
239256
rm -f *.o sqlite3$(T.exe)
240-
rm -f $(libsqlite3.LIB) $(libsqlite3.SO) $(libsqlite3.SO).a
257+
rm -f $(libsqlite3.LIB) $(libsqlite3.DLL) libsqlite3$(T.dll).a
241258

242259
distclean: clean
243260
rm -f jimsh0$(T.exe) config.* sqlite3.pc sqlite_cfg.h Makefile

autoconf/auto.def

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,8 @@
33
#
44
# This is the main autosetup-compatible configure script for the
55
# "autoconf" bundle of the SQLite project.
6-
#
7-
# This script must be kept compatible with JimTCL, a copy of which is
8-
# included in this source tree as ./autosetup/jimsh0.c.
9-
#
106
use sqlite-config
11-
sqlite-config-bootstrap autoconf
12-
sqlite-check-common-bins
13-
sqlite-check-common-system-deps
14-
proj-check-rpath
15-
sqlite-handle-soname
16-
sqlite-setup-default-cflags
17-
sqlite-handle-debug
18-
sqlite-handle-threadsafe
19-
sqlite-handle-tempstore
20-
sqlite-handle-line-editing
21-
sqlite-handle-load-extension
22-
sqlite-handle-math
23-
sqlite-handle-icu
24-
25-
define ENABLE_STATIC_SHELL [opt-bool static-shell]
26-
define ENABLE_LIB_SHARED [opt-bool shared]
27-
define ENABLE_LIB_STATIC [opt-bool static]
28-
29-
sqlite-config-finalize
7+
sqlite-configure autoconf {
8+
sqlite-check-common-bins
9+
sqlite-check-common-system-deps
10+
}

autosetup/autosetup

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1634,8 +1634,8 @@ proc automf_command_reference {} {
16341634
16351635
if {[regexp {^#.*@section (.*)$} $line -> section]} {
16361636
lappend doc($current) [list section $section]
1637-
continue
1638-
}
1637+
continue
1638+
}
16391639
16401640
# Find embedded module names
16411641
if {[regexp {^#.*@module ([^ ]*)} $line -> modulename]} {
@@ -1651,7 +1651,7 @@ proc automf_command_reference {} {
16511651
if {$cmd eq "synopsis:"} {
16521652
set current $modulename
16531653
lappend doc($current) [list section "Module: $modulename"]
1654-
} else {
1654+
} else {
16551655
lappend doc($current) [list subsection $cmd]
16561656
}
16571657
@@ -2088,8 +2088,12 @@ if {$autosetup(iswin)} {
20882088
proc split-path {} {
20892089
split [getenv PATH .] :
20902090
}
2091+
# Check for an executable file
20912092
proc file-isexec {exec} {
2092-
file executable $exec
2093+
if {[file executable $exec] && [file isfile $exec]} {
2094+
return 1
2095+
}
2096+
return 0
20932097
}
20942098
}
20952099

autosetup/autosetup-find-tclsh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ for tclsh in ./jimsh0 $autosetup_tclsh jimsh tclsh tclsh8.5 tclsh8.6 tclsh8.7; d
99
done
1010
echo 1>&2 "No installed jimsh or tclsh, building local bootstrap jimsh0"
1111
for cc in ${CC_FOR_BUILD:-cc} gcc; do
12-
{ $cc -o jimsh0 "$d/jimsh0.c"; } >/dev/null 2>&1 || continue
12+
{ $cc -o jimsh0 "$d/jimsh0.c"; } 2>/dev/null >/dev/null || continue
1313
./jimsh0 "$d/${1-autosetup-test-tclsh}" && exit 0
1414
done
1515
echo 1>&2 "No working C compiler found. Tried ${CC_FOR_BUILD:-cc} and gcc."

0 commit comments

Comments
 (0)