From: mistachkin Date: Fri, 19 Oct 2012 00:23:31 +0000 (+0000) Subject: Add detailed comments to the build tools used to generate the VSIX package. Also... X-Git-Tag: version-3.7.15~58 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7c5dbdfd14152396463e629e50441a611968f61f;p=thirdparty%2Fsqlite.git Add detailed comments to the build tools used to generate the VSIX package. Also, allow the build configurations and native library directories to be overridden for the multi-platform build tool for MSVC. FossilOrigin-Name: 0482c73bfdf80b0c0ce9abea706554d7ddf36f69 --- diff --git a/manifest b/manifest index 6edbe106ad..2605fbeeaf 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Put\sauxiliary\slibraries\safter\slibsqlite3.a\sin\sthe\stestfixture\starget\sof\sthe\n"main.mk"\smakefile. -D 2012-10-18T20:49:26.488 +C Add\sdetailed\scomments\sto\sthe\sbuild\stools\sused\sto\sgenerate\sthe\sVSIX\spackage.\s\sAlso,\sallow\sthe\sbuild\sconfigurations\sand\snative\slibrary\sdirectories\sto\sbe\soverridden\sfor\sthe\smulti-platform\sbuild\stool\sfor\sMSVC. +D 2012-10-19T00:23:31.437 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 5f4f26109f9d80829122e0e09f9cda008fa065fb F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -977,7 +977,7 @@ F test/wherelimit.test 5e9fd41e79bb2b2d588ed999d641d9c965619b31 F test/win32lock.test b2a539e85ae6b2d78475e016a9636b4451dc7fb9 F test/zeroblob.test caaecfb4f908f7bc086ed238668049f96774d688 F test/zerodamage.test e7f77fded01dfcdf92ac2c5400f1e35d7a21463c -F tool/build-all-msvc.bat 76b835e0ab91e30f22d8aa48db9dea4d2dc59e9f x +F tool/build-all-msvc.bat c4ff2f18b1a59bb370ce48fdd286b51a82fa0f5c x F tool/build-shell.sh b64a481901fc9ffe5ca8812a2a9255b6cfb77381 F tool/checkSpacing.c 810e51703529a204fc4e1eb060e9ab663e3c06d2 F tool/diffdb.c 7524b1b5df217c20cd0431f6789851a4e0cb191b @@ -995,7 +995,7 @@ F tool/mksqlite3c-noext.tcl 8bce31074e4cbe631bb7676526a048335f4c9f02 F tool/mksqlite3c.tcl 589c7f44e990be1b8443cfe4808dce392b0327fa F tool/mksqlite3h.tcl 78013ad79a5e492e5f764f3c7a8ef834255061f8 F tool/mksqlite3internalh.tcl 3dca7bb5374cee003379b8cbac73714f610ef795 -F tool/mkvsix.tcl adc17f82e3812787fdb015098d006e31804d6aa5 +F tool/mkvsix.tcl c5e0d52592fb07a17626cd54e5f71295fb4d1b55 F tool/offsets.c fe4262fdfa378e8f5499a42136d17bf3b98f6091 F tool/omittest.tcl 4665982e95a6e5c1bd806cf7bc3dea95be422d77 F tool/opcodeDoc.awk b3a2a3d5d3075b8bd90b7afe24283efdd586659c @@ -1021,7 +1021,7 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381 F tool/win/sqlite.vsix 67d8a99aceb56384a81b3f30d6c71743146d2cc9 -P 5be96788a142362fa1f218191d2a93fdea46d93d -R 3f8f18e3119674320ee09b7250162066 -U drh -Z 482461e0a8744c4ec96bca6882c387ab +P 8fc8548f52ab8fcfb53f88db68422e09c9b98da1 +R ecd8eecc21d562cb6365b84ab6aacfa3 +U mistachkin +Z e537762f3e1c5212ff12ec99c30fc6e2 diff --git a/manifest.uuid b/manifest.uuid index 70cd8f5723..ede7cfe4bf 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -8fc8548f52ab8fcfb53f88db68422e09c9b98da1 \ No newline at end of file +0482c73bfdf80b0c0ce9abea706554d7ddf36f69 \ No newline at end of file diff --git a/tool/build-all-msvc.bat b/tool/build-all-msvc.bat index 989a2af795..c768e2b6e8 100755 --- a/tool/build-all-msvc.bat +++ b/tool/build-all-msvc.bat @@ -6,6 +6,49 @@ :: Multi-Platform Build Tool for MSVC :: +REM +REM This batch script is used to build the SQLite DLL for multiple platforms +REM and configurations using MSVC. The built SQLite DLLs, their associated +REM import libraries, and optionally their symbols files, are placed within +REM the directory specified on the command line, in sub-directories named for +REM their respective platforms and configurations. This batch script must be +REM run from inside a Visual Studio Command Prompt for the desired version of +REM Visual Studio ^(the initial platform configured for the command prompt does +REM not really matter^). Exactly one command line argument is required, the +REM name of an existing directory to be used as the final destination directory +REM for the generated output files, which will be placed in sub-directories +REM created therein. Ideally, the directory specified should be empty. +REM +REM Example: +REM +REM CD /D C:\dev\sqlite\core +REM tool\build-all-msvc.bat C:\Temp +REM +REM In the example above, "C:\dev\sqlite\core" represents the root of the +REM source tree for SQLite and "C:\Temp" represents the final destination +REM directory for the generated output files. +REM +REM There are several environment variables that may be set to modify the +REM behavior of this batch script and its associated Makefile. The list of +REM platforms to build may be overriden by using the PLATFORMS environment +REM variable, which should contain a list of platforms ^(e.g. x86 x86_amd64 +REM x86_arm^). All platforms must be supported by the version of Visual Studio +REM being used. The list of configurations to build may be overridden by +REM setting the CONFIGURATIONS environment variable, which should contain a +REM list of configurations to build ^(e.g. Debug Retail^). Neither of these +REM variable values may contain any double quotes, surrounding or embedded. +REM Finally, the NCRTLIBPATH and NSDKLIBPATH environment variables may be set +REM to specify the location of the CRT and SDK, respectively, needed to compile +REM executables native to the architecture of the build machine during any +REM cross-compilation that may be necessary, depending on the platforms to be +REM built. These values in these two variables should be surrounded by double +REM quotes if they contain spaces. +REM +REM Please note that the SQLite build process performed by the Makefile +REM associated with this batch script requires both Gawk ^(gawk.exe^) and Tcl +REM 8.5 ^(tclsh85.exe^) to be present in a directory contained in the PATH +REM environment variable unless a pre-existing amalgamation file is used. +REM SETLOCAL REM SET __ECHO=ECHO @@ -93,6 +136,16 @@ IF NOT DEFINED PLATFORMS ( %_VECHO% Platforms = '%PLATFORMS%' +REM +REM NOTE: If the list of configurations is not already set, use the default +REM list. +REM +IF NOT DEFINED CONFIGURATIONS ( + SET CONFIGURATIONS=Debug Retail +) + +%_VECHO% Configurations = '%CONFIGURATIONS%' + REM REM NOTE: Setup environment variables to translate between the MSVC platform REM names and the names to be used for the platform-specific binary @@ -115,6 +168,24 @@ FOR %%T IN (gawk.exe tclsh85.exe) DO ( SET %%T_PATH=%%~dp$PATH:T ) +REM +REM NOTE: The Gawk executable "gawk.exe" is required during the SQLite build +REM process unless a pre-existing amalgamation file is used. +REM +IF NOT DEFINED gawk.exe_PATH ( + ECHO The Gawk executable "gawk.exe" is required to be in the PATH. + GOTO errors +) + +REM +REM NOTE: The Tcl 8.5 executable "tclsh85.exe" is required during the SQLite +REM build process unless a pre-existing amalgamation file is used. +REM +IF NOT DEFINED tclsh85.exe_PATH ( + ECHO The Tcl 8.5 executable "tclsh85.exe" is required to be in the PATH. + GOTO errors +) + REM REM NOTE: Set the TOOLPATH variable to contain all the directories where the REM external tools were found in the search above. @@ -128,7 +199,13 @@ REM NOTE: Check for MSVC 2012 because the Windows SDK directory handling is REM slightly different for that version. REM IF "%VisualStudioVersion%" == "11.0" ( - SET SET_NSDKLIBPATH=1 + REM + REM NOTE: If the Windows SDK library path has already been set, do not set + REM it to something else later on. + REM + IF NOT DEFINED NSDKLIBPATH ( + SET SET_NSDKLIBPATH=1 + ) ) ELSE ( CALL :fn_UnsetVariable SET_NSDKLIBPATH ) @@ -182,7 +259,7 @@ FOR %%P IN (%PLATFORMS%) DO ( REM SET PATH=%TOOLPATH%;%SystemRoot%\System32;%SystemRoot% - FOR %%B IN (Debug Retail) DO ( + FOR %%B IN (%CONFIGURATIONS%) DO ( REM REM NOTE: When preparing the debug build, set the DEBUG and MEMDEBUG REM environment variables to be picked up by the MSVC makefile diff --git a/tool/mkvsix.tcl b/tool/mkvsix.tcl index 82dae2f691..750453ab94 100644 --- a/tool/mkvsix.tcl +++ b/tool/mkvsix.tcl @@ -2,7 +2,85 @@ # # This script is used to generate a VSIX (Visual Studio Extension) file for # SQLite usable by Visual Studio. - +# +# PREREQUISITES +# +# 1. Tcl 8.4 and later are supported, earlier versions have not been tested. +# +# 2. The "sqlite3.h" file is assumed to exist in the parent directory of the +# directory containing this script. The [optional] second command line +# argument to this script may be used to specify an alternate location. +# This script also assumes that the "sqlite3.h" file corresponds with the +# version of the binaries to be packaged. This assumption is not verified +# by this script. +# +# 3. The temporary directory specified in the TEMP or TMP environment variables +# must refer to an existing directory writable by the current user. +# +# 4. The "zip" and "unzip" command line tools must be located either in a +# directory contained in the PATH environment variable or specified as the +# exact file names to execute in the "ZipTool" and "UnZipTool" environment +# variables, respectively. +# +# 5. The template VSIX file (which is basically a zip file) must be located in +# a "win" directory inside the directory containing this script. It should +# not contain any executable binaries. It should only contain dynamic +# textual content files to be processed using [subst] and/or static content +# files to be copied verbatim. +# +# 6. The executable and other compiled binary files to be packaged into the +# final VSIX file (e.g. DLLs, LIBs, and PDBs) must be located in a single +# directory tree. The top-level directory of the tree must be specified as +# the first command line argument to this script. The second level +# sub-directory names must match those of the build configuration (e.g. +# "Debug" or "Retail"). The third level sub-directory names must match +# those of the platform (e.g. "x86", "x64", and "ARM"). For example, the +# binary files to be packaged would need to be organized as follows when +# packaging the "Debug" and "Retail" build configurations for the "x86" and +# "x64" platforms (in this example, "C:\temp" is the top-level directory as +# specified in the first command line argument): +# +# C:\Temp\Debug\x86\sqlite3.lib +# C:\Temp\Debug\x86\sqlite3.dll +# C:\Temp\Debug\x86\sqlite3.pdb +# C:\Temp\Debug\x64\sqlite3.lib +# C:\Temp\Debug\x64\sqlite3.dll +# C:\Temp\Debug\x64\sqlite3.pdb +# C:\Temp\Retail\x86\sqlite3.lib +# C:\Temp\Retail\x86\sqlite3.dll +# C:\Temp\Retail\x86\sqlite3.pdb +# C:\Temp\Retail\x64\sqlite3.lib +# C:\Temp\Retail\x64\sqlite3.dll +# C:\Temp\Retail\x64\sqlite3.pdb +# +# The above directory tree organization is performed automatically if the +# "tool\build-all-msvc.bat" batch script is used to build the binary files +# to be packaged. +# +# USAGE +# +# Typically, when on Windows, this script is executed using commands similar to +# the following (from a normal Windows command prompt window): +# +# CD /D C:\dev\sqlite\core +# tclsh85 tool\mkvsix.tcl C:\Temp +# +# In the example above, "C:\dev\sqlite\core" represents the root of the source +# tree for SQLite and "C:\Temp" represents the top-level directory containing +# the executable and other compiled binary files, organized into a directory +# tree as described in item 6 of the PREREQUISITES section, above. +# +# This script should work on non-Windows platforms as well, provided that all +# the requirements listed in the PREREQUISITES section are met. +# +# NOTES +# +# The temporary directory is used as a staging area for the final VSIX file. +# The template VSIX file is extracted, its contents processed, and then the +# resulting files are packaged into the final VSIX file. +# +package require Tcl 8.4 + proc fail { {error ""} {usage false} } { if {[string length $error] > 0} then { puts stdout $error @@ -245,7 +323,11 @@ if {![regexp -line -- $pattern $data dummy version]} then { ############################################################################### # -# NOTE: Setup the master file list data, including the necessary flags. +# NOTE: Setup all the master file list data. This includes the source and +# destination file names, build-neutral boolean flags, platform-neutral +# boolean flags, and the dynamic content (subst) boolean flags. There +# is also one set of boolean flags per build configuration, currently +# "Debug" and "Retail", that control which files are skipped for it. # if {![info exists fileNames(source)]} then { set fileNames(source) [list "" "" "" \