]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Eliminate configure/build discrepancies in how 'make tclextension-...' works vs other...
authorstephan <stephan@noemail.net>
Wed, 18 Jun 2025 14:17:18 +0000 (14:17 +0000)
committerstephan <stephan@noemail.net>
Wed, 18 Jun 2025 14:17:18 +0000 (14:17 +0000)
FossilOrigin-Name: 7ca545fd3b460fcf92e117baef42655eb6e78ebb5bdc6302f8f1b5b8446c0a06

Makefile.in
autosetup/sqlite-config.tcl
main.mk
manifest
manifest.uuid

index 57728b04980690da92170b3be0e84841639a2f58..995bbde449db1cb59a1a9d7ff77b839e5eef3c16 100644 (file)
@@ -213,6 +213,13 @@ TCL_CONFIG_SH = @TCL_CONFIG_SH@
 #TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@
 #TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@
 #TCL_VERSION = @TCL_VERSION@
+TCL_MAJOR_VERSION = @TCL_MAJOR_VERSION@
+# ^^^ main.mk optionally uses this for determining the Tcl extension's
+# DLL name.
+TCL_EXT_DLL_BASENAME = @TCL_EXT_DLL_BASENAME@
+# ^^^ base name of the Tcl extension DLL. It varies by platform and
+# Tcl version.
+
 #
 # $(TCLLIBDIR) = where to install the tcl plugin. If this is empty, it
 # is calculated at make-time by the targets which need it but we
index 8b53e97554e6bedaff7c381b8d7b394208e500b5..027b5fad2950717ba2ae10bc142286a246e99405 100644 (file)
@@ -1966,13 +1966,14 @@ proc sqlite-check-tcl {} {
     # TCLLIBDIR from here, which will cause the canonical makefile to
     # use this one rather than to re-calculate it at make-time.
     set tcllibdir [get-env TCLLIBDIR ""]
+    set sq3Ver [get-define PACKAGE_VERSION]
     if {"" eq $tcllibdir} {
       # Attempt to extract TCLLIBDIR from TCL's $auto_path
       if {"" ne $with_tclsh &&
           [catch {exec echo "puts stdout \$auto_path" | "$with_tclsh"} result] == 0} {
         foreach i $result {
           if {[file isdir $i]} {
-            set tcllibdir $i/sqlite3
+            set tcllibdir $i/sqlite${sq3Ver}
             break
           }
         }
@@ -2108,9 +2109,26 @@ proc sqlite-determine-codegen-tcl {} {
 # sqlite-determine-codegen-tcl.
 proc sqlite-handle-tcl {} {
   sqlite-check-tcl
-  if {"canonical" eq $::sqliteConfig(build-mode)} {
-    msg-result "TCL for code generation: [sqlite-determine-codegen-tcl]"
+  if {"canonical" ne $::sqliteConfig(build-mode)} return
+  msg-result "TCL for code generation: [sqlite-determine-codegen-tcl]"
+
+  # Determine the base name of the Tcl extension's DLL
+  #
+  if {[get-define HAVE_TCL]} {
+    if {[string match *-cygwin [get-define host]]} {
+      set libname cyg
+    } else {
+      set libname lib
+    }
+    if {[get-define TCL_MAJOR_VERSION] > 8} {
+      append libname tcl9
+    }
+    append libname sqlite
+  } else {
+    set libname ""
   }
+  define TCL_EXT_DLL_BASENAME $libname
+  # The extension is added in the makefile
 }
 
 ########################################################################
diff --git a/main.mk b/main.mk
index c2a0e6087a195e507a0c88b6408ca89a805927c5..34c1cc3cf2f7efa396b3394e4ade96988bada7ff 100644 (file)
--- a/main.mk
+++ b/main.mk
@@ -1047,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 $@"
@@ -1622,15 +1626,29 @@ install-headers: sqlite3.h $(install-dir.include)
        $(INSTALL.noexec) sqlite3.h "$(TOP)/src/sqlite3ext.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 \
index b7b3dcf53a5a1eaa1bc8b7c5d715b4b26a039329..81d3f83d185056974e7e7d376c04d0aca2bdd650 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,10 +1,10 @@
-C Change\sthe\sdefinition\sof\sSQLITE_DYNAMIC\sto\sa\sfunction\sthat\shas\sexactly\nthe\ssame\stype\sas\ssqlite3_destructor_type,\sin\san\seffort\sto\swork\saround\npossible\slegacy\scompiler\sbugs.
-D 2025-06-18T14:14:46.007
+C Eliminate\sconfigure/build\sdiscrepancies\sin\show\s'make\stclextension-...'\sworks\svs\sother\smakefile-side\shandling\sof\sthe\sextension,\sconforming\sto\sthe\sformer.
+D 2025-06-18T14:17:18.963
 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
 F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d
-F Makefile.in c3e414df4dc8dfb12f1f6baf129fcb6d18cd0ebd3c9109370fb3fceeeef9a37a
+F Makefile.in d8bc4aee9fb645c9f2ff0e3a30585d17a0df076bb6a33f0f20bab4999abb45a0
 F Makefile.linux-generic bd3e3cacd369821a6241d4ea1967395c962dfe3057e38cb0a435cee0e8b789d0
 F Makefile.msc ec2011bbdfc917d6a1c7c173dabb29c14ead0dd8e2e0b67278a00ae4ba576a77
 F README.md e28077cfbef795e99c9c75ed95aa7257a1166709b562076441a8506ac421b7c1
@@ -47,7 +47,7 @@ F autosetup/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1
 F autosetup/jimsh0.c 563b966c137a4ce3c9333e5196723b7ac0919140a9d7989eb440463cd855c367
 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba
 F autosetup/proj.tcl 6aac1eb3059fc511c8e1659f33b96eb2a216a371ed9b28be6661374061be9b15
-F autosetup/sqlite-config.tcl 332ac1364fc2a30b09ba4625593bc1c45411ce26c1de72f60ba505938295a8f5
+F autosetup/sqlite-config.tcl d806333654f40b6ffb737529bc43e31ac0ecc66d6d7d4dace0be697e4bd87b85
 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9
 F autosetup/teaish/README.txt b40071e6f8506500a2f7f71d5fc69e0bf87b9d7678dd9da1e5b4d0acbf40b1ca
 F autosetup/teaish/core.tcl aee092fc71986d1272b835ea7492bb55ffc213a289502e4f14da80cf67b7e3c3
@@ -709,7 +709,7 @@ F ext/wasm/tests/opfs/sahpool/sahpool-pausing.js f264925cfc82155de38cecb3d204c36
 F ext/wasm/tests/opfs/sahpool/sahpool-worker.js bd25a43fc2ab2d1bafd8f2854ad3943ef673f7c3be03e95ecf1612ff6e8e2a61
 F ext/wasm/wasmfs.make 68999f5bd8c489239592d59a420f8c627c99169bbd6fa16a404751f757b9f702
 F magic.txt 5ade0bc977aa135e79e3faaea894d5671b26107cc91e70783aa7dc83f22f3ba0
-F main.mk 4e6adba7e0bd1f784d4ba236e63f0841a04b171c83230cab9ebb1985e91a260c
+F main.mk 3ced12d068b22957f4e82a0b94a2c1d83b37dcf39c087263691267f7bfb39a84
 F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271
 F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504
 F mptest/crash01.test 61e61469e257df0850df4293d7d4d6c2af301421
@@ -2208,8 +2208,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350
 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
 F tool/warnings.sh 1ad0169b022b280bcaaf94a7fa231591be96b514230ab5c98fbf15cd7df842dd
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 928976abcb11f9d5abe1f7631002592c4af7bf83ecadba5b0763866d039c2270
-R b0e1bd933813958ce65bff166eef8a19
-U drh
-Z 560a12a583baccd030ed842ff9da9e35
+P 83553edf78c35d171a0ddf1a51306e963d715e56d95b8159b561b729cfb27843
+R 506467c19e9b457458aced59b08b435c
+U stephan
+Z 0ea4081a0e1ef871648f1ee7549a9ae2
 # Remove this line to create a well-formed Fossil manifest.
index 62aa2bb03efe81e572cfbc6074eaf17a7dc7c219..67f02605cf6f85244cf691e0b02d3af973184c32 100644 (file)
@@ -1 +1 @@
-83553edf78c35d171a0ddf1a51306e963d715e56d95b8159b561b729cfb27843
+7ca545fd3b460fcf92e117baef42655eb6e78ebb5bdc6302f8f1b5b8446c0a06