]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Add notes on how to build a statically linked version of sqlite3_analyzer.exe.
authordrh <>
Mon, 23 Oct 2023 23:34:24 +0000 (23:34 +0000)
committerdrh <>
Mon, 23 Oct 2023 23:34:24 +0000 (23:34 +0000)
FossilOrigin-Name: 99ce9939c861ecc07877e640f75d395afb6502130bf4b5ccea8b98a80a1569ce

doc/compile-for-windows.md
manifest
manifest.uuid

index 0bd39d21f1cc7a69ad66334aa517358277892ddf..55e1f8e41c9fbb94e48241425c65327a995f0407 100644 (file)
@@ -16,7 +16,7 @@ canonical source on a new Windows 11 PC, as of 2023-08-16:
       a 32-bit build.)  The subsequent steps will not work in a vanilla
       DOS prompt.  Nor will they work in PowerShell.
 
-  3.  Install TCL development libraries.  This note assumes that you wil
+  3.  Install TCL development libraries.  This note assumes that you will
       install the TCL development libraries in the "`c:\Tcl`" directory.
       Make adjustments
       if you want TCL installed somewhere else.  SQLite needs both the
@@ -83,3 +83,54 @@ following minor changes:
       <ul>
       <li>  `set PATH=c:\tcl32\bin;%PATH%`
       </ul>
+
+## Statically Linking The TCL Library
+
+Some utility programs associated with SQLite need to be linked
+with TCL in order to function.  The [sqlite3_analyzer.exe program](https://sqlite.org/sqlanalyze.html)
+is an example.  You can build as described above, and then
+enter:
+
+> ~~~~
+nmake /f Makefile.msc sqlite3_analyzer.exe
+~~~~
+
+And you will end up with a working executable.  However, that executable
+will depend on having the "tcl86.dll" library somewhere on your %PATH%.
+Use the following steps to build an executable that has the TCL library
+statically linked so that it does not depend on separate DLL:
+
+  1.  Use the appropriate "Command Prompt" window - either x86 or
+      x64, depending on whether you want a 32-bit or 64-bit executable.
+
+  2.  Untar the TCL source tarball into a fresh directory.  CD into
+      the "win/" subfolder.
+
+  3.  Run: `nmake /f makefile.vc OPTS=nothreads,static shell`
+
+
+  4.  CD into the "Release*" subfolder that is created (note the
+      wildcard - the full name of the directory might vary).  There
+      you will find the "tcl86s.lib" file.  Copy this file into the
+      same directory that you put the "tcl86.lib" on your initial
+      installation.  (In this document, that directory is
+      "`C:\Tcl32\lib`" for 32-bit builds and
+      "`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
+      nmake command line:
+      <blockquote><pre>
+      CCOPTS="-DSTATIC_BUILD" LIBTCL="tcl86s.lib netapi32.lib user32.lib"
+      </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="tcl86s.lib netapi32.lib user32.lib" sqlite3_analyzer.exe
+      </pre></blockquote>
+
+  6.  After your executable is built, you can verify that it does not
+      depend on the TCL DLL by running:
+      <blockquote><pre>
+      dumpbin /dependents sqlite3_analyzer.exe
+      </pre></blockquote>
index b50e573781c70c4a1421a51dd6229fafea51ffe3..88e45d03bb1d736efa3c98b9a64483cd1bd6ff92 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Add\sthe\ssqlite3res\sfile\sto\sthe\sWindows\sbuild\sof\ssqldiff.exe\sso\sthat\sthe\nresulting\sbinary\sshows\sthe\sSQLite\sicon.
-D 2023-10-23T19:51:16.905
+C Add\snotes\son\show\sto\sbuild\sa\sstatically\slinked\sversion\sof\ssqlite3_analyzer.exe.
+D 2023-10-23T23:34:24.214
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
 F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@@ -37,7 +37,7 @@ F configure 1d9cbcb416cb5387b3f750ae6db63cfedb703a2e46bf8ca61daecff31d208252 x
 F configure.ac de31fea7d975bb7ebafbe0e2190a855cc80d48558bf0c9a6578a1836daf1cd3a
 F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad
 F doc/F2FS.txt c1d4a0ae9711cfe0e1d8b019d154f1c29e0d3abfe820787ba1e9ed7691160fcd
-F doc/compile-for-windows.md c52f2903f1cb11b2308798feecca2e44701b037b78f467a538ac5c46c28ee250
+F doc/compile-for-windows.md 3fbda59bea9219e7b88fac89747aaf8c74b77de53d76a5abefd2570bf2bc6ca2
 F doc/json-enhancements.md e356fc834781f1f1aa22ee300027a270b2c960122468499bf347bb123ce1ea4f
 F doc/lemon.html 44a53a1d2b42d7751f7b2f478efb23c978e258d794bfd172442307a755b9fa44
 F doc/pager-invariants.txt 27fed9a70ddad2088750c4a2b493b63853da2710
@@ -2138,8 +2138,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
 F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P f20b4a96f747adeb2ed486f06dd7d911f0f24b37df87dcd32d2c3e4b687da9a6
-R 249d9631460bc3a44c3fdfd22aa9b706
+P c696a4963bdd010c8161acbf7601078313e7da5ebb3f60381a489a70e5728dea
+R 63bc65d093cd6c883a355f795496cb92
 U drh
-Z 64d0e0dfaea30cc947f8f792dbf1bb4a
+Z 23c997e26716c966c8277eb8fd0c7c2b
 # Remove this line to create a well-formed Fossil manifest.
index 52441ba107f0a82a72ec18067a78b09226d655d2..cbe6cf319cc250a305f14973682a41465a63670f 100644 (file)
@@ -1 +1 @@
-c696a4963bdd010c8161acbf7601078313e7da5ebb3f60381a489a70e5728dea
\ No newline at end of file
+99ce9939c861ecc07877e640f75d395afb6502130bf4b5ccea8b98a80a1569ce
\ No newline at end of file