aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordrh <>2024-10-11 17:02:37 +0000
committerdrh <>2024-10-11 17:02:37 +0000
commit17408fbbd85e970be0aeb42c0bf87e6dcb486059 (patch)
tree0326ab15d6174dd14ef378d33fb4587d1d14dd7e
parentb23cce9a16a6b90fed2bd3e189fe4e9f2ff63b68 (diff)
downloadsqlite-17408fbbd85e970be0aeb42c0bf87e6dcb486059.tar.gz
sqlite-17408fbbd85e970be0aeb42c0bf87e6dcb486059.zip
An improved method for statically linking sqlite3_analyzer.exe using Tcl9.
Enable wildcard expansion of arguments to testfiture on Windows. FossilOrigin-Name: 9b87ea219bce5689a69efac31063b9b11928e59124c0d36194715ff7faa5129d
-rw-r--r--Makefile.msc15
-rw-r--r--doc/compile-for-windows.md6
-rw-r--r--manifest18
-rw-r--r--manifest.uuid2
-rw-r--r--src/tclsqlite.c14
-rw-r--r--test/shell1.test5
6 files changed, 46 insertions, 14 deletions
diff --git a/Makefile.msc b/Makefile.msc
index 529e6995c..0977a4935 100644
--- a/Makefile.msc
+++ b/Makefile.msc
@@ -66,6 +66,14 @@ USE_STDCALL = 0
USE_SEH = 1
!ENDIF
+# Use STATICALLY_LINK_TCL=1 to statically link against TCL
+#
+!IFNDEF STATICALLY_LINK_TCL
+STATICALLY_LINK_TCL = 0
+!ELSEIF $(STATICALLY_LINK_TCL)!=0
+CCOPTS = $(CCOPTS) -DSTATIC_BUILD
+!ENDIF
+
# Set this non-0 to have the shell executable link against the core dynamic
# link library.
#
@@ -929,6 +937,9 @@ TCC = $(TCC) /fsanitize=address
# prior to running nmake in order to match the actual installed location and
# version on this machine.
#
+!IF $(STATICALLY_LINK_TCL)!=0
+TCLSUFFIX = s
+!ENDIF
!IFNDEF TCLSUFFIX
TCLSUFFIX =
!ENDIF
@@ -963,7 +974,11 @@ LIBTCL = tcl$(TCLVERSION)$(TCLSUFFIX).lib
!ENDIF
!IFNDEF TCLLIBS
+!IF $(STATICALLY_LINK_TCL)!=0
TCLLIBS = /NODEFAULTLIB:libucrt.lib netapi32.lib user32.lib ucrt.lib
+!ELSE
+TCLLIBS =
+!ENDIF
!ENDIF
!IFNDEF LIBTCLSTUB
diff --git a/doc/compile-for-windows.md b/doc/compile-for-windows.md
index 18189f537..acc733561 100644
--- a/doc/compile-for-windows.md
+++ b/doc/compile-for-windows.md
@@ -148,15 +148,15 @@ statically linked so that it does not depend on separate DLL:
"`C:\Tcl\lib`" for 64-bit builds.)
5. CD into your SQLite source code directory and build the desired
- utility program, but add the following extra arguments to the
+ utility program, but add the following extra argument to the
nmake command line:
<blockquote><pre>
- CCOPTS="-DSTATIC_BUILD" LIBTCL="tcl90s.lib"
+ STATICALLY_LINK_TCL=1
</pre></blockquote>
<p>So, for example, to build a statically linked version of
sqlite3_analyzer.exe, you might type:
<blockquote><pre>
- nmake /f Makefile.msc CCOPTS="-DSTATIC_BUILD" LIBTCL="tcl90s.lib" sqlite3_analyzer.exe
+ nmake /f Makefile.msc STATICALLY_LINK_TCL=1 sqlite3_analyzer.exe
</pre></blockquote>
6. After your executable is built, you can verify that it does not
diff --git a/manifest b/manifest
index a632e7547..dd462bbb4 100644
--- a/manifest
+++ b/manifest
@@ -1,11 +1,11 @@
-C Fix\sthe\sCSV\soutput\smode\sin\sthe\sCLI\ssuch\sthat\sthe\sline\sending\sis\sNL\sby\sdefault\nbut\sgoes\sto\sCRLF\sif\s".crnl\son"\sis\sset.\s\sMake\sthe\s.crnl\scommand\savailable\son\nnon-Windows\sbuilds.\s\sUpdate\sthe\s.crnl\scommand\ssuch\sthat\sif\sit\shas\sno\sarguments\nit\sshows\sthe\scurrent\ssetting.
-D 2024-10-11T14:30:58.752
+C An\simproved\smethod\sfor\sstatically\slinking\ssqlite3_analyzer.exe\susing\sTcl9.\nEnable\swildcard\sexpansion\sof\sarguments\sto\stestfiture\son\sWindows.
+D 2024-10-11T17:02:37.285
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
F Makefile.in e504a9f003b2de41447b81296d9a6988a67ffabc34fa396b60ffd89b0c63a7bf
F Makefile.linux-gcc f3842a0b1efbfbb74ac0ef60e56b301836d05b4d867d014f714fa750048f1ab6
-F Makefile.msc 34801b42a51a9c3cb2c98fb83e3e3a08c1a304b73e7a1ef30846fe6848c1ffd7
+F Makefile.msc 829ad1543511bd2953b0f9ac41e494daf96e25b4ec2e00c2abe76a08d7b46b3d
F README.md c3c0f19532ce28f6297a71870f3c7b424729f0e6d9ab889616d3587dd2332159
F VERSION 0db40f92c04378404eb45bff93e9e42c148c7e54fd3da99469ed21e22411f5a6
F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50
@@ -39,7 +39,7 @@ F configure 135e050689ea244477582e6d77cc7867dfcfe6e0f82e3eab3e47655a67035f8f x
F configure.ac aca8ebf47b7644c473e11e599ea986eeb23860a8732a8812039ad961ef52a713
F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad
F doc/F2FS.txt c1d4a0ae9711cfe0e1d8b019d154f1c29e0d3abfe820787ba1e9ed7691160fcd
-F doc/compile-for-windows.md 8402957e1ba3ddae2d37cb44fab7fca7e099b3f2fcf33bced3a16188a00b955e
+F doc/compile-for-windows.md 8e00693196087e3564a9a2bce642fa39febc1c901212832fbe0637681dada3db
F doc/json-enhancements.md e356fc834781f1f1aa22ee300027a270b2c960122468499bf347bb123ce1ea4f
F doc/jsonb.md 5fab4b8613aa9153fbeb6259297bd4697988af8b3d23900deba588fa7841456b
F doc/lemon.html 8b266ff711d2ec7f867c3dca37634963f48a630329908cc282beebfa8c708706
@@ -778,7 +778,7 @@ F src/sqliteInt.h ad02397dc4d22b77f9a331412d46e4c1e49459dd386fba8373fa148998e1e7
F src/sqliteLimit.h 6878ab64bdeb8c24a1d762d45635e34b96da21132179023338c93f820eee6728
F src/status.c cb11f8589a6912af2da3bb1ec509a94dd8ef27df4d4c1a97e0bcf2309ece972b
F src/table.c 0f141b58a16de7e2fbe81c308379e7279f4c6b50eb08efeec5892794a0ba30d1
-F src/tclsqlite.c e4bd0a252e7f73f338b98b8a0d8fe1017cfd0e171841cefc7776307b7304424d
+F src/tclsqlite.c e2b752dd08034c834e3639afa3300940d6e847fcd94207e1f2f1b83ce08b87be
F src/tclsqlite.h c6af51f31a2b2172d674608763a4b98fdf5cd587e4025053e546fb8077757262
F src/test1.c 8bf8b74145b768f42386787f93f6d6dad7bc400a4ee2d50e4ad5a06a20a97ef1
F src/test2.c 7ebc518e6735939d8979273a6f7b1d9b5702babf059f6ad62499f7f60a9eb9a3
@@ -1629,7 +1629,7 @@ F test/sharedA.test 64bdd21216dda2c6a3bd3475348ccdc108160f34682c97f2f51c19fc0e21
F test/sharedB.test 1a84863d7a2204e0d42f2e1606577c5e92e4473fa37ea0f5bdf829e4bf8ee707
F test/shared_err.test 32634e404a3317eeb94abc7a099c556a346fdb8fb3858dbe222a4cbb8926a939
F test/sharedlock.test 5ede3c37439067c43b0198f580fd374ebf15d304
-F test/shell1.test b02d628494fa284cdb2b7b2fecdadea96913796afd623f340a79d68f055dcb7e
+F test/shell1.test 5d84e415adf7cc4edd5913c4f23c761104ff135b9c190fcf7b430a4cbca6cb65
F test/shell2.test 01a01f76ed98088ce598794fbf5b359e148271541a8ddbf79d21cc353cc67a24
F test/shell3.test db1953a8e59d08e9240b7cc5948878e184f7eb2623591587f8fd1f1a5bd536d8
F test/shell4.test 522fdc628c55eff697b061504fb0a9e4e6dfc5d9087a633ab0f3dd11bcc4f807
@@ -2216,8 +2216,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P d25bdce36abed95524ad058a277aba7bb17270e7ff1476474713dbc29742c762
-R 1814f31c76f5b99a165395372f50c6cf
+P da750e39df7bf42330d8c8b266300da07247c9619895861b4cff4be7c94db7cf
+R d5a71ea2b4b6f4e15db36a5243995451
U drh
-Z d664c82762a3265052efdefacef5a18c
+Z c56b353e7027413971154cd95e000d9f
# Remove this line to create a well-formed Fossil manifest.
diff --git a/manifest.uuid b/manifest.uuid
index 77aea442e..cf2070969 100644
--- a/manifest.uuid
+++ b/manifest.uuid
@@ -1 +1 @@
-da750e39df7bf42330d8c8b266300da07247c9619895861b4cff4be7c94db7cf
+9b87ea219bce5689a69efac31063b9b11928e59124c0d36194715ff7faa5129d
diff --git a/src/tclsqlite.c b/src/tclsqlite.c
index 1fd214fe8..9ed666951 100644
--- a/src/tclsqlite.c
+++ b/src/tclsqlite.c
@@ -4037,6 +4037,20 @@ EXTERN int sqlite_Init(Tcl_Interp *interp){ return Sqlite3_Init(interp);}
static const char *tclsh_main_loop(void){
static const char zMainloop[] =
"if {[llength $argv]>=1} {\n"
+#ifdef WIN32
+ "set new [list]\n"
+ "foreach arg $argv {\n"
+ "if {[file exists $arg]} {\n"
+ "lappend new $arg\n"
+ "} else {\n"
+ "foreach match [lsort [glob -nocomplain $arg]] {\n"
+ "lappend new $match\n"
+ "}\n"
+ "}\n"
+ "}\n"
+ "set argv $new\n"
+ "unset new\n"
+#endif
"set argv0 [lindex $argv 0]\n"
"set argv [lrange $argv 1 end]\n"
"source $argv0\n"
diff --git a/test/shell1.test b/test/shell1.test
index b4883e352..a272295f5 100644
--- a/test/shell1.test
+++ b/test/shell1.test
@@ -1063,7 +1063,10 @@ do_test shell1-5.0 {
continue
}
# Tcl 8.7 maps 0x80 through 0x9f into valid UTF8. So skip those tests.
- if {$i>=0x80 && ($i<=0x9F || $tcl_version>=9.0)} continue
+ if {$i>=0x80} {
+ if {$i<=0x9F || $tcl_version>=9.0} continue
+ if {$tcl_platform(platform)=="windows"} continue
+ }
if {$i>=0xE0 && $tcl_platform(os)=="OpenBSD"} continue
if {$i>=0xE0 && $i<=0xEF && $tcl_platform(os)=="Linux"} continue
set hex [format %02X $i]