From d501b949a39d276494c8e36cdc2b94bfe28e671c Mon Sep 17 00:00:00 2001 From: stephan Date: Sat, 12 Sep 2026 10:43:45 +0000 Subject: [PATCH 1/3] Configure-script patches from [forum:fe9e99eb27c8|forum post fe9e99eb27c8] to address cygwin/msys cross-compilation issues related to --with-tcl and --with-tclsh. Stashing in a branch pending testing on those platorms. It does not adversely affect any native-build systems tested so far. FossilOrigin-Name: 4470bed69bd9d7a2187d7187a44d10128f771c782241bd3685bf1683f8e80f4e --- autosetup/sqlite-config.tcl | 99 +++++++++++++++++++++++++++---------- manifest | 17 ++++--- manifest.tags | 4 +- manifest.uuid | 2 +- 4 files changed, 86 insertions(+), 36 deletions(-) diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl index 328faad540..c1f6615b72 100644 --- a/autosetup/sqlite-config.tcl +++ b/autosetup/sqlite-config.tcl @@ -247,13 +247,22 @@ proc sqlite-configure {buildMode configScript} { => {Directory containing tclConfig.sh or a directory one level up from that, from which we can derive a directory containing tclConfig.sh. A dir name of "prefix" is equivalent to the directory specified by - the --prefix flag.} + the --prefix flag. + + This determines the TCL that SQLite will link against. It + does not affect the TCL that is executed as part of the + build.} with-tclsh:PATH - => {Full pathname of tclsh to use. It is used for (A) trying to find - tclConfig.sh and (B) all TCL-based code generation. Use --with-tcl - unless you have a specific need for this flag. Warning: if its - containing dir has multiple tclsh versions, it may select the - wrong tclConfig.sh!} + => {Full pathname of tclsh to use. It is used for all TCL-based + code generation. + + Additionally, when doing a native (build = host) build, it + may also be used as a legacy fallback to find tclConfig.sh + if --with-tcl does not say where that is. Relying on that + is not recommended. Warning: if its containing dir has + multiple tclsh versions, it may select the wrong + tclConfig.sh! The safe thing is to only pass --with-tclsh + if one also passes --with-tcl.} static-tclsqlite3=0 => {Statically-link tclsqlite3. This only works if TCL support is enabled and all requisite libraries are available in @@ -1916,25 +1925,45 @@ proc sqlite-handle-wasi-sdk {} { # handling. Some related bits and pieces are performed before and # after that function is called. # -# Important [define]'d vars: +# Important [define]'d vars. They can be split into library and tool vars. # -# - HAVE_TCL indicates whether we have a tclsh suitable for building -# the TCL SQLite extension and, by extension, the testing -# infrastructure. This must only be 1 for environments where -# tclConfig.sh can be found. +# TCL library vars: # -# - TCLSH_CMD is the path to the canonical tclsh or "". It never -# refers to jimtcl. +# - HAVE_TCL indicates whether we have the TCL that the SQLite TCL +# extension will be linked with, and so whether that extension is +# built. This is 1 for environments where tclConfig.sh can be found. +# That file describes a library to link against, so whether any tclsh +# can be run is a separate matter, and none is needed for this. # # - TCL_CONFIG_SH is the path to tclConfig.sh or "". # # - TCLLIBDIR is the dir to which libtclsqlite3 gets installed. # +# TCL tool vars: +# +# - TCLSH_CMD is the path to the canonical tclsh or "". It never +# refers to jimtcl. +# # - BTCLSH = the path to the tcl interpreter used for in-tree code -# generation. It may be jimtcl or the canonical tclsh but may not -# be empty - this tree requires TCL to generated numerous +# generation. It may be jimtcl or the canonical tclsh but may not be +# empty, as TCL code is run as part of the build to generate numerous # components. # +# The two configure CLI flags are separated by which set of variables +# they affect. --with-tcl affects only TCL library vars, and +# --with-tclsh almost only affects TCL tool vars. There is just one +# exception: when compiling natively, a tclsh is asked where its own +# tclConfig.sh is if --with-tcl is not passed. +# +# This distinction is good in any event to separate concerns, but it is +# especially important for cross compilation. In that case, the TCL that +# SQLite links against will be one that runs on the host platform, while +# the TCL that SQLite's build scripts use at build time will run on the +# build platform. Mixing up the two flags and the two kinds of vars is +# likely to break cross compilation; that is why the one exception to +# the separation is strictly confined to the native compilation case. +# See: https://sqlite.org/forum/forumpost/fe9e99eb27c8c2ba +# # If --tcl or --with-tcl are provided but no TCL is found, this # function fails fatally. If they are not explicitly provided then # failure to find TCL is not fatal but a loud warning will be emitted. @@ -1981,15 +2010,25 @@ proc sqlite-check-tcl {} { set doConfigLookup 1 ; # set to 0 to test the tclConfig.sh-not-found cases if {"" ne $with_tclsh} { - # --with-tclsh was provided or found above. Validate it and use it - # to trump any value passed via --with-tcl=DIR. + # --with-tclsh was provided or found above. Validate it and, if + # nothing better is to be had, ask it where its tclConfig.sh is. + # The two name different things: the shell runs here, whereas + # tclConfig.sh describes the library the extension is linked + # against. The shell is a guide to that only when neither + # --with-tcl=DIR says where it is nor cross compiling puts it on + # another platform entirely. if {![file-isexec $with_tclsh]} { proj-fatal "TCL shell $with_tclsh is not executable" } else { define TCLSH_CMD $with_tclsh #msg-result "Using tclsh: $with_tclsh" } - if {$doConfigLookup && + # Only worth asking when --with-tcl has not already said, and when + # the answer would be about the right platform: this tclsh runs + # here, so cross compiling the tclConfig.sh beside it describes a + # library for here, not for what is being built for. + if {$doConfigLookup && "" eq $with_tcl + && !$::sqliteConfig(is-cross-compiling) && [catch {exec $with_tclsh $::autosetup(libdir)/find_tclconfig.tcl} result] == 0} { set with_tcl $result } @@ -2101,11 +2140,14 @@ proc sqlite-check-tcl {} { if {[file-isexec $with_tclsh]} { msg-result "Using tclsh: $with_tclsh" - if {$cfg ne ""} { - define HAVE_TCL 1 - } else { - proj-warn "Found tclsh but no tclConfig.sh." - } + } + # tclConfig.sh describes what the extension is built against. + # Whether a tclsh can be run here is a separate question, affecting + # code generation and the test suite. + if {$cfg ne ""} { + define HAVE_TCL 1 + } elseif {[file-isexec $with_tclsh]} { + proj-warn "Found tclsh (${with_tclsh}) but no tclConfig.sh." } show-notices # If TCL is not found: if it was explicitly requested then fail @@ -2149,9 +2191,14 @@ proc sqlite-determine-codegen-tcl {} { define CFLAGS_JIMSH [proj-get-env CFLAGS_JIMSH {-O1}] set cgtcl [opt-val with-tclsh jimsh] if {"jimsh" ne $cgtcl} { - # When --with-tclsh=X is used, use that for all TCL purposes, - # including in-tree code generation, per developer request. - define BTCLSH "\$(TCLSH_CMD)" + # When --with-tclsh=X is used, generate code with X rather than with + # the in-tree jimsh, per developer request. + # + # Name it directly rather than through the $(TCLSH_CMD) makefile + # var, which gets set to "false" when the extension is not built, + # but we need code generation regardless of whether the extension + # is built. + define BTCLSH $cgtcl return $cgtcl } set flagsToRestore {CC CFLAGS AS_CFLAGS CPPFLAGS AS_CPPFLAGS LDFLAGS LINKFLAGS LIBS CROSS} diff --git a/manifest b/manifest index a8f8e058c9..32accdcbde 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Do\snot\sdiscard\sINDEXED\sBY\sor\sNOT\sINDEXED\sfrom\sa\sparenthesized\sterm\nof\sthe\sFROM\sclause.\n[bugs:/info/2026-09-10T20:38:13Z|Bug\s2026-09-10T20:38:13Z]. -D 2026-09-10T23:54:06.766 +C Configure-script\spatches\sfrom\s[forum:fe9e99eb27c8|forum\spost\sfe9e99eb27c8]\sto\saddress\scygwin/msys\scross-compilation\sissues\srelated\sto\s--with-tcl\sand\s--with-tclsh.\sStashing\sin\sa\sbranch\spending\stesting\son\sthose\splatorms.\sIt\sdoes\snot\sadversely\saffect\sany\snative-build\ssystems\stested\sso\sfar. +D 2026-09-12T10:43:45.904 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -48,7 +48,7 @@ F autosetup/find_tclconfig.tcl 3394bcd1aad45d6af48262f50808d4f0ac4f1088ba8fa9d08 F autosetup/jimsh0.c daf13a86959fe2d055ed42d9417ceb63d698ae4b71bde959a0979ab729a83819 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba F autosetup/proj.tcl 67683f214977a416baafc4c1020f9940ff047a7306b2292c5872d6287460b7d5 -F autosetup/sqlite-config.tcl a503f8b418547c2872348dbcb71abb09726f3970088625ec90d8000035b06b32 +F autosetup/sqlite-config.tcl 4f0bcb5848f253f9bfce1d3ce5b58a3103c428ace7b06887a8ff3e9ad49a9130 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F autosetup/teaish/README.txt b40071e6f8506500a2f7f71d5fc69e0bf87b9d7678dd9da1e5b4d0acbf40b1ca F autosetup/teaish/core.tcl e014dd95900c7f9a34e8e0f460f47e94841059827bce8b4c49668b0c7ae3f1a0 @@ -2221,8 +2221,11 @@ F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee F tool/warnings.sh a554d13f6e5cf3760f041b87939e3d616ec6961859c3245e8ef701d1eafc2ca2 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f F tool/winmain.c 00c8fb88e365c9017db14c73d3c78af62194d9644feaf60e220ab0f411f3604c -P 0c173d54b1bab44748f0010ec7aa5bd79891aa9aaea91d2996c6f0d3f859d1a8 -R 7bed5c399bf471e53122e132ad89d8af -U drh -Z 85735e92ffa213f73732a337211dddee +P e308b0fce47e184860564f0535174017eb7d5d7efc4f86dd1eb8d234f75e4d08 +R 7af4476b19e56dd530cd636f45d540c3 +T *branch * cygwin-msys-tclsh-forum-fe9e99eb +T *sym-cygwin-msys-tclsh-forum-fe9e99eb * +T -sym-trunk * Cancelled\sby\sbranch. +U stephan +Z 8578e248bf60ab2f47b148f63f428307 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.tags b/manifest.tags index bec971799f..7e17f27119 100644 --- a/manifest.tags +++ b/manifest.tags @@ -1,2 +1,2 @@ -branch trunk -tag trunk +branch cygwin-msys-tclsh-forum-fe9e99eb +tag cygwin-msys-tclsh-forum-fe9e99eb diff --git a/manifest.uuid b/manifest.uuid index aa915ee340..20f9f31c0c 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e308b0fce47e184860564f0535174017eb7d5d7efc4f86dd1eb8d234f75e4d08 +4470bed69bd9d7a2187d7187a44d10128f771c782241bd3685bf1683f8e80f4e From c129a16427c1007f4d6dfcd6083d15b06111f6f0 Mon Sep 17 00:00:00 2001 From: stephan Date: Tue, 15 Sep 2026 10:20:57 +0000 Subject: [PATCH 2/3] Minor internal doc addition explaining a build flag for jimsh. FossilOrigin-Name: 8eff1b5cda7a8429b918afd531a6f352e7e4cc1afc770b9e3b3888fe021ca8a1 --- autosetup/sqlite-config.tcl | 3 +++ manifest | 15 ++++++--------- manifest.uuid | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl index c1f6615b72..609f9f7d08 100644 --- a/autosetup/sqlite-config.tcl +++ b/autosetup/sqlite-config.tcl @@ -2223,6 +2223,9 @@ proc sqlite-determine-codegen-tcl {} { # so that we can avoid the situation that we later, at # make-time, try to compile jimsh but it then fails due to # missing headers (i.e. fail earlier rather than later). + # + # One of HAVE_REALPATH or HAVE__FULLPATH are required here for + # jimsh's [file normalize] to work. if {$sysh && [cc-check-functions realpath]} { define-append CFLAGS_JIMSH -DHAVE_REALPATH define BTCLSH "\$(JIMSH)" diff --git a/manifest b/manifest index 32accdcbde..8aaf446f4c 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Configure-script\spatches\sfrom\s[forum:fe9e99eb27c8|forum\spost\sfe9e99eb27c8]\sto\saddress\scygwin/msys\scross-compilation\sissues\srelated\sto\s--with-tcl\sand\s--with-tclsh.\sStashing\sin\sa\sbranch\spending\stesting\son\sthose\splatorms.\sIt\sdoes\snot\sadversely\saffect\sany\snative-build\ssystems\stested\sso\sfar. -D 2026-09-12T10:43:45.904 +C Minor\sinternal\sdoc\saddition\sexplaining\sa\sbuild\sflag\sfor\sjimsh. +D 2026-09-15T10:20:57.747 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -48,7 +48,7 @@ F autosetup/find_tclconfig.tcl 3394bcd1aad45d6af48262f50808d4f0ac4f1088ba8fa9d08 F autosetup/jimsh0.c daf13a86959fe2d055ed42d9417ceb63d698ae4b71bde959a0979ab729a83819 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba F autosetup/proj.tcl 67683f214977a416baafc4c1020f9940ff047a7306b2292c5872d6287460b7d5 -F autosetup/sqlite-config.tcl 4f0bcb5848f253f9bfce1d3ce5b58a3103c428ace7b06887a8ff3e9ad49a9130 +F autosetup/sqlite-config.tcl b4f06bb14643fb9c0986ebaa440f3877c97bdd3350b0404a7201cd9bba898a78 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F autosetup/teaish/README.txt b40071e6f8506500a2f7f71d5fc69e0bf87b9d7678dd9da1e5b4d0acbf40b1ca F autosetup/teaish/core.tcl e014dd95900c7f9a34e8e0f460f47e94841059827bce8b4c49668b0c7ae3f1a0 @@ -2221,11 +2221,8 @@ F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee F tool/warnings.sh a554d13f6e5cf3760f041b87939e3d616ec6961859c3245e8ef701d1eafc2ca2 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f F tool/winmain.c 00c8fb88e365c9017db14c73d3c78af62194d9644feaf60e220ab0f411f3604c -P e308b0fce47e184860564f0535174017eb7d5d7efc4f86dd1eb8d234f75e4d08 -R 7af4476b19e56dd530cd636f45d540c3 -T *branch * cygwin-msys-tclsh-forum-fe9e99eb -T *sym-cygwin-msys-tclsh-forum-fe9e99eb * -T -sym-trunk * Cancelled\sby\sbranch. +P 4470bed69bd9d7a2187d7187a44d10128f771c782241bd3685bf1683f8e80f4e +R 08fa19fd17d7660ce65d2bd418e6ecd8 U stephan -Z 8578e248bf60ab2f47b148f63f428307 +Z 729a55fcd7384aef1cbf260b0abaeef4 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 20f9f31c0c..8e52ac9a7d 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -4470bed69bd9d7a2187d7187a44d10128f771c782241bd3685bf1683f8e80f4e +8eff1b5cda7a8429b918afd531a6f352e7e4cc1afc770b9e3b3888fe021ca8a1 From e4e1b4a464e632fb06870114081d06ce7c53a1de Mon Sep 17 00:00:00 2001 From: stephan Date: Sun, 4 Oct 2026 19:47:43 +0000 Subject: [PATCH 3/3] When using --with-tcl and friends during cross-compilation, emit a warning that tclConfig.sh will not be used. Addresses [forum:9771d82cd0cd7923|forum post 2026-10-04T17:25:09Z]. Normalize TCL to Tcl in nearby docs and help text because that's how tcl-lang.org types it. FossilOrigin-Name: 41f095e34974da53170200719a069c0a30110e27a1db85f562bbe744a40e9a80 --- autosetup/sqlite-config.tcl | 110 +++++++++++++++++++----------------- manifest | 12 ++-- manifest.uuid | 2 +- 3 files changed, 65 insertions(+), 59 deletions(-) diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl index e839b318db..896f586ca5 100644 --- a/autosetup/sqlite-config.tcl +++ b/autosetup/sqlite-config.tcl @@ -231,13 +231,13 @@ proc sqlite-configure {buildMode configScript} { } } - # Options for TCL support + # Options for Tcl support tcl { {canonical} { tcl=1 - => {Disable components which require TCL, including all tests. - This tree requires TCL for code generation but can use the in-tree - copy of autosetup/jimsh0.c for that. The SQLite TCL extension and the + => {Disable components which require Tcl, including all tests. + This tree requires Tcl for code generation but can use the in-tree + copy of autosetup/jimsh0.c for that. The SQLite Tcl extension and the test code require a canonical tclsh.} with-tcl:DIR => {Directory containing tclConfig.sh or a directory one level up from @@ -245,11 +245,11 @@ proc sqlite-configure {buildMode configScript} { A dir name of "prefix" is equivalent to the directory specified by the --prefix flag. - This determines the TCL that SQLite will link against. It - does not affect the TCL that is executed as part of the + This determines the Tcl that SQLite will link against. It + does not affect the Tcl that is executed as part of the build.} with-tclsh:PATH - => {Full pathname of tclsh to use. It is used for all TCL-based + => {Full pathname of tclsh to use. It is used for all Tcl-based code generation. Additionally, when doing a native (build = host) build, it @@ -260,7 +260,7 @@ proc sqlite-configure {buildMode configScript} { tclConfig.sh! The safe thing is to only pass --with-tclsh if one also passes --with-tcl.} static-tclsqlite3=0 - => {Statically-link tclsqlite3. This only works if TCL support is + => {Statically-link tclsqlite3. This only works if Tcl support is enabled and all requisite libraries are available in static form. Note that glibc is unable to fully statically link certain libraries required by tclsqlite3, so this won't @@ -453,7 +453,7 @@ proc sqlite-configure {buildMode configScript} { if {[catch {options {}} msg xopts]} { # Workaround for - # where [options] behaves oddly on _some_ TCL builds when it's + # where [options] behaves oddly on _some_ Tcl builds when it's # called from deeper than the global scope. dict incr xopts -level return {*}$xopts $msg @@ -1915,7 +1915,7 @@ proc sqlite-handle-wasi-sdk {} { }; # sqlite-handle-wasi-sdk ######################################################################## -# TCL... +# Tcl... # # sqlite-check-tcl performs most of the --with-tcl and --with-tclsh # handling. Some related bits and pieces are performed before and @@ -1923,9 +1923,9 @@ proc sqlite-handle-wasi-sdk {} { # # Important [define]'d vars. They can be split into library and tool vars. # -# TCL library vars: +# Tcl library vars: # -# - HAVE_TCL indicates whether we have the TCL that the SQLite TCL +# - HAVE_TCL indicates whether we have the Tcl that the SQLite Tcl # extension will be linked with, and so whether that extension is # built. This is 1 for environments where tclConfig.sh can be found. # That file describes a library to link against, so whether any tclsh @@ -1935,39 +1935,39 @@ proc sqlite-handle-wasi-sdk {} { # # - TCLLIBDIR is the dir to which libtclsqlite3 gets installed. # -# TCL tool vars: +# Tcl tool vars: # # - TCLSH_CMD is the path to the canonical tclsh or "". It never # refers to jimtcl. # # - BTCLSH = the path to the tcl interpreter used for in-tree code # generation. It may be jimtcl or the canonical tclsh but may not be -# empty, as TCL code is run as part of the build to generate numerous +# empty, as Tcl code is run as part of the build to generate numerous # components. # # The two configure CLI flags are separated by which set of variables -# they affect. --with-tcl affects only TCL library vars, and -# --with-tclsh almost only affects TCL tool vars. There is just one +# they affect. --with-tcl affects only Tcl library vars, and +# --with-tclsh almost only affects Tcl tool vars. There is just one # exception: when compiling natively, a tclsh is asked where its own # tclConfig.sh is if --with-tcl is not passed. # # This distinction is good in any event to separate concerns, but it is -# especially important for cross compilation. In that case, the TCL that +# especially important for cross compilation. In that case, the Tcl that # SQLite links against will be one that runs on the host platform, while -# the TCL that SQLite's build scripts use at build time will run on the +# the Tcl that SQLite's build scripts use at build time will run on the # build platform. Mixing up the two flags and the two kinds of vars is # likely to break cross compilation; that is why the one exception to # the separation is strictly confined to the native compilation case. # See: https://sqlite.org/forum/forumpost/fe9e99eb27c8c2ba # -# If --tcl or --with-tcl are provided but no TCL is found, this +# If --tcl or --with-tcl are provided but no Tcl is found, this # function fails fatally. If they are not explicitly provided then -# failure to find TCL is not fatal but a loud warning will be emitted. +# failure to find Tcl is not fatal but a loud warning will be emitted. # proc sqlite-check-tcl {} { define TCLSH_CMD false ; # Significant is that it exits with non-0 define HAVE_TCL 0 ; # Will be enabled via --tcl or a successful search - define TCLLIBDIR "" ; # Installation dir for TCL extension lib + define TCLLIBDIR "" ; # Installation dir for Tcl extension lib define TCL_CONFIG_SH ""; # full path to tclConfig.sh # Clear out all vars which would harvest from tclConfig.sh so that @@ -1978,8 +1978,8 @@ proc sqlite-check-tcl {} { file delete -force ".tclenv.sh"; # ensure no stale state from previous configures. if {![opt-bool tcl]} { proj-indented-notice { - NOTE: TCL is disabled via --disable-tcl. This means that none - of the TCL-based components will be built, including tests + NOTE: Tcl is disabled via --disable-tcl. This means that none + of the Tcl-based components will be built, including tests and sqlite3_analyzer. } return @@ -2014,25 +2014,31 @@ proc sqlite-check-tcl {} { # --with-tcl=DIR says where it is nor cross compiling puts it on # another platform entirely. if {![file-isexec $with_tclsh]} { - proj-fatal "TCL shell $with_tclsh is not executable" + proj-fatal "Tcl shell $with_tclsh is not executable" } else { define TCLSH_CMD $with_tclsh #msg-result "Using tclsh: $with_tclsh" } - # Only worth asking when --with-tcl has not already said, and when - # the answer would be about the right platform: this tclsh runs - # here, so cross compiling the tclConfig.sh beside it describes a - # library for here, not for what is being built for. - if {$doConfigLookup && "" eq $with_tcl - && !$::sqliteConfig(is-cross-compiling) && - [catch {exec $with_tclsh $::autosetup(libdir)/find_tclconfig.tcl} result] == 0} { - set with_tcl $result - } - if {"" ne $with_tcl && [file isdir $with_tcl]} { - msg-result "$with_tclsh recommends the tclConfig.sh from $with_tcl" + + if {"" ne $with_tcl} { + # --with-tcl was given explicitly; do not second-guess it with tclsh. + } elseif {$::sqliteConfig(is-cross-compiling)} { + # This tclsh runs on the build platform, so the tclConfig.sh it would + # recommend describes Tcl for here, not for the host platform. + proj-warn "Cannot ask $with_tclsh to recommend a tclConfig.sh because we are cross compiling." + # Leave with_tcl empty and do not set use_tcl either way so the $libdir + # search below can still attempt to find one. } else { - proj-warn "$with_tclsh is unable to recommend a tclConfig.sh" - set use_tcl 0 + if {$doConfigLookup && + [catch {exec $with_tclsh $::autosetup(libdir)/find_tclconfig.tcl} result] == 0} { + set with_tcl $result + } + if {"" ne $with_tcl && [file isdir $with_tcl]} { + msg-result "$with_tclsh recommends the tclConfig.sh from $with_tcl" + } else { + proj-warn "$with_tclsh is unable to recommend a tclConfig.sh" + set use_tcl 0 + } } } set cfg "" @@ -2079,7 +2085,7 @@ proc sqlite-check-tcl {} { break } define TCL_CONFIG_SH $cfg - # Export a subset of tclConfig.sh to the current TCL-space. If $cfg + # Export a subset of tclConfig.sh to the current Tcl-space. If $cfg # is an empty string, this emits empty-string entries for the # various options we're interested in. proj-tclConfig-sh-to-autosetup $cfg @@ -2115,7 +2121,7 @@ proc sqlite-check-tcl {} { set tcllibdir [get-env TCLLIBDIR ""] set sq3Ver [get-define PACKAGE_VERSION] if {"" eq $tcllibdir} { - # Attempt to extract TCLLIBDIR from TCL's $auto_path + # 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 { @@ -2146,44 +2152,44 @@ proc sqlite-check-tcl {} { proj-warn "Found tclsh (${with_tclsh}) but no tclConfig.sh." } show-notices - # If TCL is not found: if it was explicitly requested then fail + # If Tcl is not found: if it was explicitly requested then fail # fatally, else just emit a warning. If we can find the APIs needed - # to generate a working JimTCL then that will suffice for build-time - # TCL purposes (see: proc sqlite-determine-codegen-tcl). + # to generate a working JimTcl then that will suffice for build-time + # Tcl purposes (see: proc sqlite-determine-codegen-tcl). if {![get-define HAVE_TCL] && ([proj-opt-was-provided tcl] || [proj-opt-was-provided with-tcl])} { - proj-fatal "TCL support was requested but no tclConfig.sh could be found." + proj-fatal "Tcl support was requested but no tclConfig.sh could be found." } if {"" eq $cfg} { proj-assert {0 == [get-define HAVE_TCL]} proj-indented-notice { WARNING: Cannot find a usable tclConfig.sh file. Use --with-tcl=DIR to specify a directory where tclConfig.sh can be - found. SQLite does not use TCL internally, but some optional - components require TCL, including tests and sqlite3_analyzer. + found. SQLite does not use Tcl internally, but some optional + components require Tcl, including tests and sqlite3_analyzer. } } }; # sqlite-check-tcl ######################################################################## -# sqlite-determine-codegen-tcl checks which TCL to use as a code +# sqlite-determine-codegen-tcl checks which Tcl to use as a code # generator. By default, prefer jimsh simply because we have it # in-tree (it's part of autosetup) unless --with-tclsh=X is used, in # which case prefer X. # -# Returns the human-readable name of the TCL it selects. Fails fatally -# if it cannot detect a TCL appropriate for code generation. +# Returns the human-readable name of the Tcl it selects. Fails fatally +# if it cannot detect a Tcl appropriate for code generation. # # Defines: # -# - BTCLSH = the TCL shell used for code generation. It may set this +# - BTCLSH = the Tcl shell used for code generation. It may set this # to an unexpanded makefile var name. # # - CFLAGS_JIMSH = any flags needed for buildng a BTCLSH-compatible # jimsh. The defaults may be passed on to configure as # CFLAGS_JIMSH=... proc sqlite-determine-codegen-tcl {} { - msg-result "Checking for TCL to use for code generation... " + msg-result "Checking for Tcl to use for code generation... " define CFLAGS_JIMSH [proj-get-env CFLAGS_JIMSH {-O1}] set cgtcl [opt-val with-tclsh jimsh] if {"jimsh" ne $cgtcl} { @@ -2210,7 +2216,7 @@ proc sqlite-determine-codegen-tcl {} { # block. foreach flag $flagsToRestore {define $flag ""} define CC [get-define CC_FOR_BUILD] - # These headers are technically optional for JimTCL but necessary if + # These headers are technically optional for JimTcl but necessary if # we want to use it for code generation: set sysh [cc-check-includes dirent.h sys/time.h] # jimsh0.c hard-codes #define's for HAVE_DIRENT_H and @@ -2268,7 +2274,7 @@ proc sqlite-determine-codegen-tcl {} { proc sqlite-handle-tcl {} { sqlite-check-tcl if {"canonical" ne $::sqliteConfig(build-mode)} return - msg-result "TCL for code generation: [sqlite-determine-codegen-tcl]" + msg-result "Tcl for code generation: [sqlite-determine-codegen-tcl]" # Determine the base name of the Tcl extension's DLL # diff --git a/manifest b/manifest index 534963c693..aebac98299 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Merge\strunk\sinto\sthis\sbranch. -D 2026-10-04T18:24:04.347 +C When\susing\s--with-tcl\sand\sfriends\sduring\scross-compilation,\semit\sa\swarning\sthat\stclConfig.sh\swill\snot\sbe\sused.\sAddresses\s[forum:9771d82cd0cd7923|forum\spost\s2026-10-04T17:25:09Z].\sNormalize\sTCL\sto\sTcl\sin\snearby\sdocs\sand\shelp\stext\sbecause\sthat's\show\stcl-lang.org\stypes\sit. +D 2026-10-04T19:47:43.471 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -48,7 +48,7 @@ F autosetup/find_tclconfig.tcl 3394bcd1aad45d6af48262f50808d4f0ac4f1088ba8fa9d08 F autosetup/jimsh0.c daf13a86959fe2d055ed42d9417ceb63d698ae4b71bde959a0979ab729a83819 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba F autosetup/proj.tcl 67683f214977a416baafc4c1020f9940ff047a7306b2292c5872d6287460b7d5 -F autosetup/sqlite-config.tcl 4f3d4ef97439d23b237b1476e44b41ae12883e96ffa952fbf744142fb00a91d4 +F autosetup/sqlite-config.tcl 062c021fb0377cb9091135d6805b5e1c697b5276c642c72fe1245c9feee9e4e4 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F autosetup/teaish/README.txt b40071e6f8506500a2f7f71d5fc69e0bf87b9d7678dd9da1e5b4d0acbf40b1ca F autosetup/teaish/core.tcl e014dd95900c7f9a34e8e0f460f47e94841059827bce8b4c49668b0c7ae3f1a0 @@ -2278,8 +2278,8 @@ F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee F tool/warnings.sh a554d13f6e5cf3760f041b87939e3d616ec6961859c3245e8ef701d1eafc2ca2 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f F tool/winmain.c 00c8fb88e365c9017db14c73d3c78af62194d9644feaf60e220ab0f411f3604c -P 8eff1b5cda7a8429b918afd531a6f352e7e4cc1afc770b9e3b3888fe021ca8a1 f63139ba68bc7df770bbd3c26bcd760c479889fb45fa921e9e225e38c9e2044c -R 944541cf8d51f9c722846afd8cbd8ed6 +P 40d58aa98ded07621a4ee1300bc164b27c33879a28932b790ecdf118b23ba6ca +R 771ec5fa0646617381291d7cfe227f57 U stephan -Z 304c94f6d2eecd02f2e5773d5ac308bd +Z 0eafbf57e2302aaed6d774480b0e0d81 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index a9d75f1149..bbfd4d72c6 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -40d58aa98ded07621a4ee1300bc164b27c33879a28932b790ecdf118b23ba6ca +41f095e34974da53170200719a069c0a30110e27a1db85f562bbe744a40e9a80