From: drh <> Date: Thu, 10 Oct 2024 09:59:06 +0000 (+0000) Subject: Adjustments to the Makefile.msc to get static builds of sqlite3_analyzer.exe X-Git-Tag: version-3.47.0~50^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f553588c76ee1adbdc7b7c8ec340c687a2f881be;p=thirdparty%2Fsqlite.git Adjustments to the Makefile.msc to get static builds of sqlite3_analyzer.exe working with TCL9. Update the compile-for-windows.md document for TCL9. FossilOrigin-Name: df16d07d8db042cdb1dc6bb9a00a0265ba791a615d74f9152d0b3344e618fe93 --- diff --git a/Makefile.msc b/Makefile.msc index 148e09ab73..529e6995c0 100644 --- a/Makefile.msc +++ b/Makefile.msc @@ -962,6 +962,10 @@ TCLLIBDIR = $(TCLDIR)\lib LIBTCL = tcl$(TCLVERSION)$(TCLSUFFIX).lib !ENDIF +!IFNDEF TCLLIBS +TCLLIBS = /NODEFAULTLIB:libucrt.lib netapi32.lib user32.lib ucrt.lib +!ENDIF + !IFNDEF LIBTCLSTUB !IF EXISTS("$(TCLLIBDIR)\tclstub$(TCLSUFFIX).lib") LIBTCLSTUB = tclstub$(TCLSUFFIX).lib diff --git a/doc/compile-for-windows.md b/doc/compile-for-windows.md index 1627188acd..18189f5376 100644 --- a/doc/compile-for-windows.md +++ b/doc/compile-for-windows.md @@ -1,7 +1,7 @@ # Notes On Compiling SQLite On Windows 11 Here are step-by-step instructions on how to build SQLite from -canonical source on a new Windows 11 PC, as of 2023-11-01: +canonical source on a new Windows 11 PC, as of 2024-10-09: 1. Install Microsoft Visual Studio. The free "community edition" will work fine. Do a standard install for C++ development. @@ -20,9 +20,11 @@ canonical source on a new Windows 11 PC, as of 2023-11-01: install the TCL development libraries in the "`c:\Tcl`" directory. Make adjustments if you want TCL installed somewhere else. SQLite needs both the - "tclsh.exe" command-line tool as part of the build process, and - the "tcl86.lib" library in order to run tests. You will need - TCL version 8.6 or later. + "tclsh90.exe" command-line tool as part of the build process, and + the "tcl90.lib" and "tclstub.lib" libraries in order to run tests. + This document assumes you are working with TCL version 9.0. + See versions of this document from prior to 2024-10-10 for + instructions on how to build using TCL version 8.6.
  1. Get the TCL source archive, perhaps from [https://www.tcl.tk/software/tcltk/download.html](https://www.tcl.tk/software/tcltk/download.html). @@ -30,13 +32,10 @@ canonical source on a new Windows 11 PC, as of 2023-11-01: of the source tree.
  2. Run: `nmake /f makefile.vc release`
  3. Run: `nmake /f makefile.vc INSTALLDIR=c:\Tcl install` -
  4. CD to `c:\Tcl\lib`. In that subfolder make a copy of the - "`tcl86t.lib`" file to the alternative name "`tcl86.lib`" - (omitting the second 't'). Leave the copy in the same directory - as the original. -
  5. CD to `c:\Tcl\bin`. Make a copy of the "`tclsh86t.exe`" - file into "`tclsh.exe`" (without the "86t") in the same directory. -
  6. Add `c:\Tcl\bin` to your %PATH%. To do this, go to Settings +
  7. Optional: CD to `c:\Tcl\bin` and make a copy of + `tclsh90.exe` over into just `tclsh.exe`. +
  8. Optional: + Add `c:\Tcl\bin` to your %PATH%. To do this, go to Settings and search for "path". Select "edit environment variables for your account" and modify your default PATH accordingly. You will need to close and reopen your command prompts after @@ -59,6 +58,7 @@ canonical source on a new Windows 11 PC, as of 2023-11-01:
  9. `nmake /f makefile.msc sqlite3.c`
  10. `nmake /f makefile.msc sqlite3.exe`
  11. `nmake /f makefile.msc sqldiff.exe` +
  12. `nmake /f makefile.msc sqlite3-rsync.exe`
  13. `nmake /f makefile.msc tclextension-install`
  14. `nmake /f makefile.msc devtest`
  15. `nmake /f makefile.msc releasetest` @@ -127,7 +127,7 @@ 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%. +will depend on having the "tcl98.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: @@ -137,13 +137,12 @@ statically linked so that it does not depend on separate DLL: 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` - + 3. Run: `nmake /f makefile.vc OPTS=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 + you will find the "tcl90s.lib" file. Copy this file into the + same directory that you put the "tcl90.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.) @@ -152,12 +151,12 @@ statically linked so that it does not depend on separate DLL: utility program, but add the following extra arguments to the nmake command line:
    -      CCOPTS="-DSTATIC_BUILD" LIBTCL="tcl86s.lib netapi32.lib user32.lib"
    +      CCOPTS="-DSTATIC_BUILD" LIBTCL="tcl90s.lib"
           

    So, for example, to build a statically linked version of sqlite3_analyzer.exe, you might type:

    -      nmake /f Makefile.msc CCOPTS="-DSTATIC_BUILD" LIBTCL="tcl86s.lib netapi32.lib user32.lib" sqlite3_analyzer.exe
    +      nmake /f Makefile.msc CCOPTS="-DSTATIC_BUILD" LIBTCL="tcl90s.lib" sqlite3_analyzer.exe
           
    6. After your executable is built, you can verify that it does not diff --git a/manifest b/manifest index cdce6cf63e..21bb077fd9 100644 --- a/manifest +++ b/manifest @@ -1,11 +1,11 @@ -C Improvements\sto\sMakefile.msc:\s(1)\sAttempt\sto\sfind\ssane\svalues\sfor\skey\nvariables\sbased\son\sthe\svalue\sof\sTCLDIR.\s\s(2)\sDefault\sto\sTCLVERSION\s90\sinstead\nof\s86.\s\s(3)\sAdd\sthe\s"tcl-env"\starget\sthat\sshows\sthe\svalues\sof\skey\svariables\nassociated\swith\sTCL. -D 2024-10-09T20:05:26.424 +C Adjustments\sto\sthe\sMakefile.msc\sto\sget\sstatic\sbuilds\sof\ssqlite3_analyzer.exe\nworking\swith\sTCL9.\s\sUpdate\sthe\scompile-for-windows.md\sdocument\sfor\sTCL9. +D 2024-10-10T09:59:06.503 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 c6abbbe25cef6bf1eb255884cd9137b6afa4f850f4bdc78ba718f4035c35000b +F Makefile.msc 34801b42a51a9c3cb2c98fb83e3e3a08c1a304b73e7a1ef30846fe6848c1ffd7 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 4d4bfafda42a7a33f166d23aed4db1bb4ea1e5751595a5cced2bad349fd14652 +F doc/compile-for-windows.md 8402957e1ba3ddae2d37cb44fab7fca7e099b3f2fcf33bced3a16188a00b955e F doc/json-enhancements.md e356fc834781f1f1aa22ee300027a270b2c960122468499bf347bb123ce1ea4f F doc/jsonb.md 5fab4b8613aa9153fbeb6259297bd4697988af8b3d23900deba588fa7841456b F doc/lemon.html 8b266ff711d2ec7f867c3dca37634963f48a630329908cc282beebfa8c708706 @@ -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 e8f719d13fbcbaf1b52b421d7af59759b1b4692d4010a68d5865dfeaf3cf8cb0 -R 6adacab87cffb89c84a1bbdbcff4792d +P 6b7a789a416fb62a532882d10e41c7048a6805f5fbbc008f36f9802be45d9ebb +R c9f14e0cb6269b0c33c6b11339c3cd13 U drh -Z f45d0adbf7e7e6e176374a9b7492aa02 +Z 3a6d1e8e76a2ebf4de7346b7f2c5b6fe # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 783841eca9..e5bc20be19 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -6b7a789a416fb62a532882d10e41c7048a6805f5fbbc008f36f9802be45d9ebb +df16d07d8db042cdb1dc6bb9a00a0265ba791a615d74f9152d0b3344e618fe93