aboutsummaryrefslogtreecommitdiff
path: root/main.mk
diff options
context:
space:
mode:
Diffstat (limited to 'main.mk')
-rw-r--r--main.mk58
1 files changed, 44 insertions, 14 deletions
diff --git a/main.mk b/main.mk
index fe874b1f3..34c1cc3cf 100644
--- a/main.mk
+++ b/main.mk
@@ -772,7 +772,6 @@ TESTSRC = \
$(TOP)/src/test_thread.c \
$(TOP)/src/test_vdbecov.c \
$(TOP)/src/test_vfs.c \
- $(TOP)/src/test_windirent.c \
$(TOP)/src/test_window.c \
$(TOP)/src/test_wsd.c \
$(TOP)/ext/fts3/fts3_term.c \
@@ -1048,13 +1047,17 @@ $(T.tcl.env.sh): $(TCLSH_CMD) $(TCL_CONFIG_SH) $(MAKEFILE_LIST)
@if [ x = "x$(TCL_CONFIG_SH)" ]; then \
echo 'TCL_CONFIG_SH must be set to point to a "tclConfig.sh"' 1>&2; exit 1; \
fi; \
- if [ x != "x$(TCLLIBDIR)" ]; then echo TCLLIBDIR="$(TCLLIBDIR)"; else \
+ if [ x != "x$(TCLLIBDIR)" ]; then \
+ echo "# generated by main.mk"; \
+ echo TCLLIBDIR="$(TCLLIBDIR)"; \
+ else \
ld= ; \
for d in `echo "puts stdout \\$$auto_path" | $(TCLSH_CMD)`; do \
if [ -d "$$d" ]; then ld=$$d; break; fi; \
done; \
if [ x = "x$$ld" ]; then echo "Cannot determine TCLLIBDIR" 1>&2; exit 1; fi; \
- echo "TCLLIBDIR=$$ld/sqlite3"; \
+ echo "# generated by main.mk"; \
+ echo "TCLLIBDIR=$$ld/sqlite3$(PACKAGE_VERSION)"; \
fi > $@; \
echo ". \"$(TCL_CONFIG_SH)\" || exit \$$?" >> $@; \
echo "Created $@"
@@ -1624,14 +1627,28 @@ install-headers: sqlite3.h $(install-dir.include)
install: install-headers
#
+# If TCL_EXT_DLL_BASENAME is not set then guess the Tcl extension's
+# DLL name depending on the Tcl version. This does not account for
+# Cygwin's naming - the canonical build will usually set it, but
+# static makefiles importing this one will need to account for that on
+# their own. They can do that by setting libtclsqlite3.basename-[89]
+# to appropriate names (cygsqlite resp. cygtcl9sqlite).
+#
+TCL_MAJOR_VERSION ?= 0
+libtclsqlite3.basename-8 ?= libsqlite
+libtclsqlite3.basename-9 ?= libtcl9sqlite
+TCL_EXT_DLL_BASENAME ?= $(libtclsqlite3.basename-$(TCL_MAJOR_VERSION))
+libtclsqlite3.DLL ?= $(TCL_EXT_DLL_BASENAME)$(PACKAGE_VERSION)$(T.dll)
+
+#
# libtclsqlite3...
#
-pkgIndex.tcl:
- echo 'package ifneeded sqlite3 $(PACKAGE_VERSION) [list load [file join $$dir libtclsqlite3[info sharedlibextension]] Sqlite3]' > $@
+pkgIndex.tcl: $(TOP)/main.mk
+ echo 'package ifneeded sqlite3 $(PACKAGE_VERSION) [list load [file join $$dir $(libtclsqlite3.DLL)] Sqlite3]' > $@
pkgIndex.tcl-1: pkgIndex.tcl
pkgIndex.tcl-0 pkgIndex.tcl-:
tcl: pkgIndex.tcl-$(HAVE_TCL)
-libtclsqlite3.DLL = libtclsqlite3$(T.dll)
+
$(libtclsqlite3.DLL): $(T.tcl.env.sh) tclsqlite.o $(LIBOBJ)
$(T.tcl.env.source); \
$(T.link.shared) -o $@ tclsqlite.o \
@@ -1672,34 +1689,47 @@ CFLAGS.tclextension = $(CFLAGS.intree_includes) $(CFLAGS.env) $(OPT_FEATURE_FLAG
# by --with-tclsh=
#
tclextension: tclsqlite3.c
- $(TCLSH_CMD) $(TOP)/tool/buildtclext.tcl --build-only --cc "$(T.cc)" $(CFLAGS.tclextension)
+ $(TCLSH_CMD) $(TOP)/tool/buildtclext.tcl --build-only \
+ --tclConfig.sh $(TCL_CONFIG_SH) --cc "$(T.cc)" $(CFLAGS.tclextension)
#
# Install the SQLite TCL extension in a way that is appropriate for $TCLSH_CMD
# to find it.
#
tclextension-install: tclsqlite3.c
- $(TCLSH_CMD) $(TOP)/tool/buildtclext.tcl --destdir "$(DESTDIR)" --cc "$(T.cc)" $(CFLAGS.tclextension)
+ $(TCLSH_CMD) $(TOP)/tool/buildtclext.tcl --destdir "$(DESTDIR)" \
+ --tclConfig.sh $(TCL_CONFIG_SH) --cc "$(T.cc)" $(CFLAGS.tclextension)
#
# Uninstall the SQLite TCL extension that is used by $TCLSH_CMD.
#
tclextension-uninstall:
- $(TCLSH_CMD) $(TOP)/tool/buildtclext.tcl --uninstall
+ $(TCLSH_CMD) $(TOP)/tool/buildtclext.tcl --uninstall \
+ --tclConfig.sh $(TCL_CONFIG_SH)
#
# List all installed the SQLite TCL extensions that is are accessible
# by $TCLSH_CMD, including prior versions.
#
tclextension-list:
- @ $(TCLSH_CMD) $(TOP)/tool/buildtclext.tcl --info
+ @ $(TCLSH_CMD) $(TOP)/tool/buildtclext.tcl --info \
+ --tclConfig.sh $(TCL_CONFIG_SH)
# Verify that the SQLite TCL extension that is loaded by default
# in $(TCLSH_CMD) is the same as the version of SQLite for the
# current source tree
#
tclextension-verify: sqlite3.h
- @ $(TCLSH_CMD) $(TOP)/tool/buildtclext.tcl --version-check
+ @ $(TCLSH_CMD) $(TOP)/tool/buildtclext.tcl --version-check \
+ --tclConfig.sh $(TCL_CONFIG_SH)
+
+# Run all of the tclextension targets in order, ending with uninstall.
+tclextension-all:
+ $(MAKE) tclextension
+ $(MAKE) tclextension-install
+ $(MAKE) tclextension-list
+ $(MAKE) tclextension-verify
+ $(MAKE) tclextension-uninstall
#
# FTS5 things
@@ -2330,12 +2360,12 @@ SHELL_DEP = \
$(TOP)/ext/misc/sqlar.c \
$(TOP)/ext/misc/uint.c \
$(TOP)/ext/misc/vfstrace.c \
+ $(TOP)/ext/misc/windirent.h \
$(TOP)/ext/misc/zipfile.c \
$(TOP)/ext/recover/dbdata.c \
$(TOP)/ext/recover/sqlite3recover.c \
- $(TOP)/ext/recover/sqlite3recover.h \
- $(TOP)/src/test_windirent.c \
- $(TOP)/src/test_windirent.h
+ $(TOP)/ext/recover/sqlite3recover.h
+
shell.c: $(SHELL_DEP) $(TOP)/tool/mkshellc.tcl $(B.tclsh)
$(B.tclsh) $(TOP)/tool/mkshellc.tcl shell.c