Tooling support for including the debug build in the VSIX package.

FossilOrigin-Name: de784399ed1f0e27fc875e32719643d19819c8fb
This commit is contained in:
mistachkin
2012-10-12 18:06:07 +00:00
parent 6292c01634
commit 0ec0744502
5 changed files with 258 additions and 170 deletions
+24
View File
@@ -9,53 +9,75 @@ TOP = .
# Set this non-0 to create and use the SQLite amalgamation file.
#
!IFNDEF USE_AMALGAMATION
USE_AMALGAMATION = 1
!ENDIF
# Set this non-0 to use the International Components for Unicode (ICU).
#
!IFNDEF USE_ICU
USE_ICU = 0
!ENDIF
# Set this non-0 to dynamically link to the MSVC runtime library.
#
!IFNDEF USE_CRT_DLL
USE_CRT_DLL = 0
!ENDIF
# Set this non-0 to attempt setting the native compiler automatically
# for cross-compiling the command line tools needed during the compilation
# process.
#
!IFNDEF XCOMPILE
XCOMPILE = 0
!ENDIF
# Set this non-0 to use the native libraries paths for cross-compiling
# the command line tools needed during the compilation process.
#
!IFNDEF USE_NATIVE_LIBPATHS
USE_NATIVE_LIBPATHS = 0
!ENDIF
# Set this 0 to skip the compiling and embedding of version resources.
#
!IFNDEF USE_RC
USE_RC = 1
!ENDIF
# Set this non-0 to compile binaries suitable for the WinRT environment.
# This setting does not apply to any binaries that require Tcl to operate
# properly (i.e. the text fixture, etc).
#
!IFNDEF FOR_WINRT
FOR_WINRT = 0
!ENDIF
# Set this non-0 to skip attempting to look for and/or link with the Tcl
# runtime library.
#
!IFNDEF NO_TCL
NO_TCL = 0
!ENDIF
# Set this to non-0 to create and use PDBs.
#
!IFNDEF SYMBOLS
SYMBOLS = 1
!ENDIF
# Set this to non-0 to use the SQLite debugging heap subsystem.
#
!IFNDEF MEMDEBUG
MEMDEBUG = 0
!ENDIF
# Set this to non-0 to use the Win32 native heap subsystem.
#
!IFNDEF WIN32HEAP
WIN32HEAP = 0
!ENDIF
# Set this to one of the following values to enable various debugging
# features. Each level includes the debugging options from the previous
@@ -68,7 +90,9 @@ WIN32HEAP = 0
# 4 == SQLITE_DEBUG_OS_TRACE: Enables output from the OSTRACE() macros.
# 5 == SQLITE_ENABLE_IOTRACE: Enables output from the IOTRACE() macros.
#
!IFNDEF DEBUG
DEBUG = 0
!ENDIF
# Check for the predefined command macro CC. This should point to the compiler
# binary for the target platform. If it is not defined, simply define it to
+8 -8
View File
@@ -1,9 +1,9 @@
C Fix\sduplicate\stest\sname\sin\swhereD.test.
D 2012-10-10T13:59:11.378
C Tooling\ssupport\sfor\sincluding\sthe\sdebug\sbuild\sin\sthe\sVSIX\spackage.
D 2012-10-12T18:06:07.816
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 5f4f26109f9d80829122e0e09f9cda008fa065fb
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
F Makefile.msc a8495ef567c1872cd9e0679c96a02aafbf9c43b5
F Makefile.msc 1d8a5d3cf33b8b8d3247c99367a37af384cc7ebd
F Makefile.vxworks b18ad88e9a8c6a001f5cf4a389116a4f1a7ab45f
F README cd04a36fbc7ea56932a4052d7d0b7f09f27c33d6
F VERSION edab4af5a4623f8198833ea481ce98ab53750a8d
@@ -975,7 +975,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 cd505f24717ca4ecd94c651f763d7bb4e7fe68af x
F tool/build-all-msvc.bat 76b835e0ab91e30f22d8aa48db9dea4d2dc59e9f x
F tool/build-shell.sh b64a481901fc9ffe5ca8812a2a9255b6cfb77381
F tool/checkSpacing.c 810e51703529a204fc4e1eb060e9ab663e3c06d2
F tool/diffdb.c 7524b1b5df217c20cd0431f6789851a4e0cb191b
@@ -993,7 +993,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 19b2ab9ea16445953a76568a5bbe4cb864f92dfe
F tool/mkvsix.tcl a27951f30bb39c3504196610f17f687fc0b1c94d
F tool/offsets.c fe4262fdfa378e8f5499a42136d17bf3b98f6091
F tool/omittest.tcl 4665982e95a6e5c1bd806cf7bc3dea95be422d77
F tool/opcodeDoc.awk b3a2a3d5d3075b8bd90b7afe24283efdd586659c
@@ -1019,7 +1019,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 96247853ef3d556a13b899b4c907b9fa2c78d513
R eb33f3fc302126c0f34a21ed878e78ec
P 1182b54af0fd43d5e6aa6399837e7915aa60a578
R 9e8254ec6d4a71f688da7a8600f59454
U mistachkin
Z 046d6c9be8479dde4d96235907c599c3
Z 3494f0e2927d2f78ffed9eda067be39b
+1 -1
View File
@@ -1 +1 @@
1182b54af0fd43d5e6aa6399837e7915aa60a578
de784399ed1f0e27fc875e32719643d19819c8fb
+130 -114
View File
@@ -10,6 +10,7 @@ SETLOCAL
REM SET __ECHO=ECHO
REM SET __ECHO2=ECHO
REM SET __ECHO3=ECHO
IF NOT DEFINED _AECHO (SET _AECHO=REM)
IF NOT DEFINED _CECHO (SET _CECHO=REM)
IF NOT DEFINED _VECHO (SET _VECHO=REM)
@@ -181,129 +182,144 @@ FOR %%P IN (%PLATFORMS%) DO (
REM
SET PATH=%TOOLPATH%;%SystemRoot%\System32;%SystemRoot%
REM
REM NOTE: Launch a nested command shell to perform the following steps:
REM
REM 1. Setup the MSVC environment for this platform using the
REM official batch file.
REM
REM 2. Make sure that no stale build output files are present.
REM
REM 3. Build the "sqlite3.dll" and "sqlite3.lib" binaries for this
REM platform.
REM
REM 4. Copy the "sqlite3.dll" and "sqlite3.lib" binaries for this
REM platform to the platform-specific directory beneath the
REM binary directory.
REM
"%ComSpec%" /C (
FOR %%B IN (Debug Retail) DO (
REM
REM NOTE: Attempt to setup the MSVC environment for this platform.
REM NOTE: When preparing the debug build, set the DEBUG and MEMDEBUG
REM environment variables to be picked up by the MSVC makefile
REM itself.
REM
%__ECHO% CALL "%VCINSTALLDIR%\vcvarsall.bat" %%P
IF ERRORLEVEL 1 (
ECHO Failed to call "%VCINSTALLDIR%\vcvarsall.bat" for platform %%P.
GOTO errors
)
REM
REM NOTE: If this batch file is not running in "what-if" mode, check to
REM be sure we were actually able to setup the MSVC environment as
REM current versions of their official batch file do not set the
REM exit code upon failure.
REM
IF NOT DEFINED __ECHO (
IF NOT DEFINED WindowsSdkDir (
ECHO Cannot build, Windows SDK not found for platform %%P.
GOTO errors
)
)
REM
REM NOTE: When using MSVC 2012, the native SDK path cannot simply use
REM the "lib" sub-directory beneath the location specified in the
REM WindowsSdkDir environment variable because that location does
REM not actually contain the necessary library files for x86.
REM This must be done for each iteration because it relies upon
REM the WindowsSdkDir environment variable being set by the batch
REM file used to setup the MSVC environment.
REM
IF DEFINED SET_NSDKLIBPATH (
CALL :fn_CopyVariable WindowsSdkDir NSDKLIBPATH
CALL :fn_AppendVariable NSDKLIBPATH \lib\win8\um\x86
)
REM
REM NOTE: Unless prevented from doing so, invoke NMAKE with the MSVC
REM makefile to clean any stale build output from previous
REM iterations of this loop and/or previous runs of this batch
REM file, etc.
REM
IF NOT DEFINED NOCLEAN (
%__ECHO% nmake -f Makefile.msc clean
IF ERRORLEVEL 1 (
ECHO Failed to clean for platform %%P.
GOTO errors
)
IF /I "%%B" == "Debug" (
SET DEBUG=2
SET MEMDEBUG=1
) ELSE (
CALL :fn_UnsetVariable DEBUG
CALL :fn_UnsetVariable MEMDEBUG
)
REM
REM NOTE: Launch a nested command shell to perform the following steps:
REM
REM 1. Setup the MSVC environment for this platform using the
REM official batch file.
REM
REM 2. Make sure that no stale build output files are present.
REM
REM 3. Build the "sqlite3.dll" and "sqlite3.lib" binaries for this
REM platform.
REM
REM 4. Copy the "sqlite3.dll" and "sqlite3.lib" binaries for this
REM platform to the platform-specific directory beneath the
REM binary directory.
REM
"%ComSpec%" /C (
REM
REM NOTE: Even when the cleaning step has been disabled, we still need
REM to remove the build output for the files we are specifically
REM wanting to build for each platform.
REM NOTE: Attempt to setup the MSVC environment for this platform.
REM
%__ECHO% DEL /Q sqlite3.dll sqlite3.lib sqlite3.pdb
)
REM
REM NOTE: Invoke NMAKE with the MSVC makefile to build the "sqlite3.dll"
REM binary. The x86 compiler will be used to compile the native
REM command line tools needed during the build process itself.
REM Also, disable looking for and/or linking to the native Tcl
REM runtime library.
REM
%__ECHO% nmake -f Makefile.msc sqlite3.dll "NCC=""%VCINSTALLDIR%\bin\cl.exe""" USE_NATIVE_LIBPATHS=1 NO_TCL=1 %NMAKE_ARGS%
IF ERRORLEVEL 1 (
ECHO Failed to build "sqlite3.dll" for platform %%P.
GOTO errors
)
REM
REM NOTE: Copy the "sqlite3.dll" file to the platform-specific directory
REM beneath the binary directory.
REM
%__ECHO% XCOPY sqlite3.dll "%BINARYDIRECTORY%\%%D\" %FFLAGS% %DFLAGS%
IF ERRORLEVEL 1 (
ECHO Failed to copy "sqlite3.dll" to "%BINARYDIRECTORY%\%%D\".
GOTO errors
)
REM
REM NOTE: Copy the "sqlite3.lib" file to the platform-specific directory
REM beneath the binary directory.
REM
%__ECHO% XCOPY sqlite3.lib "%BINARYDIRECTORY%\%%D\" %FFLAGS% %DFLAGS%
IF ERRORLEVEL 1 (
ECHO Failed to copy "sqlite3.lib" to "%BINARYDIRECTORY%\%%D\".
GOTO errors
)
REM
REM NOTE: Copy the "sqlite3.pdb" file to the platform-specific directory
REM beneath the binary directory unless we are prevented from doing
REM so.
REM
IF NOT DEFINED NOSYMBOLS (
%__ECHO% XCOPY sqlite3.pdb "%BINARYDIRECTORY%\%%D\" %FFLAGS% %DFLAGS%
%__ECHO3% CALL "%VCINSTALLDIR%\vcvarsall.bat" %%P
IF ERRORLEVEL 1 (
ECHO Failed to copy "sqlite3.pdb" to "%BINARYDIRECTORY%\%%D\".
ECHO Failed to call "%VCINSTALLDIR%\vcvarsall.bat" for platform %%P.
GOTO errors
)
REM
REM NOTE: If this batch file is not running in "what-if" mode, check to
REM be sure we were actually able to setup the MSVC environment
REM as current versions of their official batch file do not set
REM the exit code upon failure.
REM
IF NOT DEFINED __ECHO (
IF NOT DEFINED WindowsSdkDir (
ECHO Cannot build, Windows SDK not found for platform %%P.
GOTO errors
)
)
REM
REM NOTE: When using MSVC 2012, the native SDK path cannot simply use
REM the "lib" sub-directory beneath the location specified in the
REM WindowsSdkDir environment variable because that location does
REM not actually contain the necessary library files for x86.
REM This must be done for each iteration because it relies upon
REM the WindowsSdkDir environment variable being set by the batch
REM file used to setup the MSVC environment.
REM
IF DEFINED SET_NSDKLIBPATH (
CALL :fn_CopyVariable WindowsSdkDir NSDKLIBPATH
CALL :fn_AppendVariable NSDKLIBPATH \lib\win8\um\x86
)
REM
REM NOTE: Unless prevented from doing so, invoke NMAKE with the MSVC
REM makefile to clean any stale build output from previous
REM iterations of this loop and/or previous runs of this batch
REM file, etc.
REM
IF NOT DEFINED NOCLEAN (
%__ECHO% nmake -f Makefile.msc clean
IF ERRORLEVEL 1 (
ECHO Failed to clean for platform %%P.
GOTO errors
)
) ELSE (
REM
REM NOTE: Even when the cleaning step has been disabled, we still
REM need to remove the build output for the files we are
REM specifically wanting to build for each platform.
REM
%__ECHO% DEL /Q sqlite3.dll sqlite3.lib sqlite3.pdb
)
REM
REM NOTE: Call NMAKE with the MSVC makefile to build the "sqlite3.dll"
REM binary. The x86 compiler will be used to compile the native
REM command line tools needed during the build process itself.
REM Also, disable looking for and/or linking to the native Tcl
REM runtime library.
REM
%__ECHO% nmake -f Makefile.msc sqlite3.dll XCOMPILE=1 USE_NATIVE_LIBPATHS=1 NO_TCL=1 %NMAKE_ARGS%
IF ERRORLEVEL 1 (
ECHO Failed to build %%B "sqlite3.dll" for platform %%P.
GOTO errors
)
REM
REM NOTE: Copy the "sqlite3.dll" file to the appropriate directory for
REM the build and platform beneath the binary directory.
REM
%__ECHO% XCOPY sqlite3.dll "%BINARYDIRECTORY%\%%B\%%D\" %FFLAGS% %DFLAGS%
IF ERRORLEVEL 1 (
ECHO Failed to copy "sqlite3.dll" to "%BINARYDIRECTORY%\%%B\%%D\".
GOTO errors
)
REM
REM NOTE: Copy the "sqlite3.lib" file to the appropriate directory for
REM the build and platform beneath the binary directory.
REM
%__ECHO% XCOPY sqlite3.lib "%BINARYDIRECTORY%\%%B\%%D\" %FFLAGS% %DFLAGS%
IF ERRORLEVEL 1 (
ECHO Failed to copy "sqlite3.lib" to "%BINARYDIRECTORY%\%%B\%%D\".
GOTO errors
)
REM
REM NOTE: Copy the "sqlite3.pdb" file to the appropriate directory for
REM the build and platform beneath the binary directory unless we
REM are prevented from doing so.
REM
IF NOT DEFINED NOSYMBOLS (
%__ECHO% XCOPY sqlite3.pdb "%BINARYDIRECTORY%\%%B\%%D\" %FFLAGS% %DFLAGS%
IF ERRORLEVEL 1 (
ECHO Failed to copy "sqlite3.pdb" to "%BINARYDIRECTORY%\%%B\%%D\".
GOTO errors
)
)
)
)
)
+95 -47
View File
@@ -90,12 +90,13 @@ proc substFile { fileName } {
return [writeFile $fileName [uplevel 1 [list subst [readFile $fileName]]]]
}
proc replacePlatform { fileName platformName } {
proc replaceBuildAndPlatform { fileName buildName platformName } {
#
# NOTE: Returns the specified file name containing the platform name instead
# of platform placeholder tokens.
#
return [string map [list <platform> $platformName] $fileName]
return [string map [list <build> $buildName <platform> $platformName] \
$fileName]
}
set script [file normalize [info script]]
@@ -249,12 +250,12 @@ if {![regexp -line -- $pattern $data dummy version]} then {
if {![info exists fileNames(source)]} then {
set fileNames(source) [list "" "" "" \
[file join $sourceDirectory sqlite3.h] \
[file join $binaryDirectory <platform> sqlite3.lib] \
[file join $binaryDirectory <platform> sqlite3.dll]]
[file join $binaryDirectory <build> <platform> sqlite3.lib] \
[file join $binaryDirectory <build> <platform> sqlite3.dll]]
if {![info exists no(symbols)]} then {
lappend fileNames(source) \
[file join $binaryDirectory <platform> sqlite3.pdb]
[file join $binaryDirectory <build> <platform> sqlite3.pdb]
}
}
@@ -262,27 +263,31 @@ if {![info exists fileNames(destination)]} then {
set fileNames(destination) [list \
[file join $stagingDirectory extension.vsixmanifest] \
[file join $stagingDirectory SDKManifest.xml] \
[file join $stagingDirectory DesignTime CommonConfiguration \
<platform> SQLite.WinRT.props] \
[file join $stagingDirectory DesignTime CommonConfiguration \
<platform> sqlite3.h] \
[file join $stagingDirectory DesignTime CommonConfiguration \
<platform> sqlite3.lib] \
[file join $stagingDirectory Redist CommonConfiguration \
<platform> sqlite3.dll]]
[file join $stagingDirectory DesignTime <build> <platform> \
SQLite.WinRT.props] \
[file join $stagingDirectory DesignTime <build> <platform> sqlite3.h] \
[file join $stagingDirectory DesignTime <build> <platform> sqlite3.lib] \
[file join $stagingDirectory Redist <build> <platform> sqlite3.dll]]
if {![info exists no(symbols)]} then {
lappend fileNames(destination) \
[file join $stagingDirectory Redist Debug \
<platform> sqlite3.pdb]
[file join $stagingDirectory Redist <build> <platform> sqlite3.pdb]
}
}
if {![info exists fileNames(neutral)]} then {
set fileNames(neutral) [list 1 1 1 1 0 0]
if {![info exists fileNames(buildNeutral)]} then {
set fileNames(buildNeutral) [list 1 1 1 1 0 0]
if {![info exists no(symbols)]} then {
lappend fileNames(neutral) 0
lappend fileNames(buildNeutral) 0
}
}
if {![info exists fileNames(platformNeutral)]} then {
set fileNames(platformNeutral) [list 1 1 1 1 0 0]
if {![info exists no(symbols)]} then {
lappend fileNames(platformNeutral) 0
}
}
@@ -294,6 +299,31 @@ if {![info exists fileNames(subst)]} then {
}
}
if {![info exists fileNames(noDebug)]} then {
set fileNames(noDebug) [list 0 0 0 0 0 0]
if {![info exists no(symbols)]} then {
lappend fileNames(noDebug) 0
}
}
if {![info exists fileNames(noRetail)]} then {
set fileNames(noRetail) [list 0 0 0 0 0 0]
if {![info exists no(symbols)]} then {
lappend fileNames(noRetail) 1
}
}
###############################################################################
#
# NOTE: Setup the list of builds supported by this script.
#
if {![info exists buildNames]} then {
set buildNames [list Debug Retail]
}
###############################################################################
#
@@ -338,45 +368,63 @@ eval $extractCommand
#
foreach sourceFileName $fileNames(source) \
destinationFileName $fileNames(destination) \
isNeutral $fileNames(neutral) useSubst $fileNames(subst) {
buildNeutral $fileNames(buildNeutral) platformNeutral \
$fileNames(platformNeutral) useSubst $fileNames(subst) \
noDebug $fileNames(noDebug) noRetail $fileNames(noRetail) {
#
# NOTE: If the current file is platform-neutral, then only one platform will
# be processed for it, namely "neutral"; otherwise, each supported
# platform will be processed for it individually.
# NOTE: If the current file is build-neutral, then only one build will
# be processed for it, namely "CommonConfiguration"; otherwise, each
# supported build will be processed for it individually.
#
foreach platformName [expr {$isNeutral ? [list neutral] : $platformNames}] {
foreach buildName \
[expr {$buildNeutral ? [list CommonConfiguration] : $buildNames}] {
#
# NOTE: Use the actual platform name in the destination file name.
# NOTE: Should the current file be skipped for this build?
#
set newDestinationFileName [replacePlatform $destinationFileName \
$platformName]
#
# NOTE: Does the source file need to be copied to the destination file?
#
if {[string length $sourceFileName] > 0} then {
#
# NOTE: First, make sure the destination directory exists.
#
file mkdir [file dirname $newDestinationFileName]
#
# NOTE: Then, copy the source file to the destination file verbatim.
#
file copy [replacePlatform $sourceFileName $platformName] \
$newDestinationFileName
if {[info exists no${buildName}] && [set no${buildName}]} then {
continue
}
#
# NOTE: Does the destination file contain dynamic replacements that must
# be processed now?
# NOTE: If the current file is platform-neutral, then only one platform
# will be processed for it, namely "neutral"; otherwise, each
# supported platform will be processed for it individually.
#
if {$useSubst} then {
foreach platformName \
[expr {$platformNeutral ? [list neutral] : $platformNames}] {
#
# NOTE: Perform any dynamic replacements contained in the destination
# file and then re-write it in-place.
# NOTE: Use the actual platform name in the destination file name.
#
substFile $newDestinationFileName
set newDestinationFileName [replaceBuildAndPlatform \
$destinationFileName $buildName $platformName]
#
# NOTE: Does the source file need to be copied to the destination file?
#
if {[string length $sourceFileName] > 0} then {
#
# NOTE: First, make sure the destination directory exists.
#
file mkdir [file dirname $newDestinationFileName]
#
# NOTE: Then, copy the source file to the destination file verbatim.
#
file copy [replaceBuildAndPlatform $sourceFileName $buildName \
$platformName] $newDestinationFileName
}
#
# NOTE: Does the destination file contain dynamic replacements that must
# be processed now?
#
if {$useSubst} then {
#
# NOTE: Perform any dynamic replacements contained in the destination
# file and then re-write it in-place.
#
substFile $newDestinationFileName
}
}
}
}