From 00b638bb6f2e0fb2bdcff933111d46139ede35bd Mon Sep 17 00:00:00 2001 From: mistachkin Date: Fri, 18 Apr 2014 00:08:13 +0000 Subject: [PATCH 1/9] Preliminary changes to support building VSIX packages for Windows Phone 8.1. FossilOrigin-Name: a1b2f28ba85b043df68875f5d3446140db4f2cb0 --- manifest | 19 +++++++++++-------- manifest.uuid | 2 +- tool/mkvsix.tcl | 25 ++++++++++++++++++++----- tool/win/sqlite.vsix | Bin 32825 -> 32820 bytes 4 files changed, 32 insertions(+), 14 deletions(-) diff --git a/manifest b/manifest index a1452995b3..eea66b0d82 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sthe\sSQLITE_TESTCTRL_BYTEORDER\stest\scontrol\sto\sinterrogate\sSQLite's\snotion\nof\sthe\sprocessor\sbyte\sorder\sand\swhether\sthe\sbyte\sorder\sis\sknown\sat\scompile-time\nor\sdetermined\sat\srun-time. -D 2014-04-18T00:06:02.110 +C Preliminary\schanges\sto\ssupport\sbuilding\sVSIX\spackages\sfor\sWindows\sPhone\s8.1. +D 2014-04-18T00:08:13.436 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 2ef13430cd359f7b361bb863504e227b25cc7f81 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -1132,7 +1132,7 @@ F tool/mksqlite3c-noext.tcl 8bce31074e4cbe631bb7676526a048335f4c9f02 F tool/mksqlite3c.tcl ed5b4e9ca8bf209ff401059a16362f37710fd8b8 F tool/mksqlite3h.tcl ba24038056f51fde07c0079c41885ab85e2cff12 F tool/mksqlite3internalh.tcl 3dca7bb5374cee003379b8cbac73714f610ef795 -F tool/mkvsix.tcl 6477fb9dab838b7eea1eed50658ff1cda04850b5 +F tool/mkvsix.tcl df937e1fadbd98995c701002b2a4b0187a04f6ff F tool/offsets.c fe4262fdfa378e8f5499a42136d17bf3b98f6091 F tool/omittest.tcl 34d7ac01fe4fd18e3637f64abe12c40eca0f6b97 F tool/opcodeDoc.awk b3a2a3d5d3075b8bd90b7afe24283efdd586659c @@ -1159,8 +1159,11 @@ F tool/vdbe-compress.tcl 0cf56e9263a152b84da86e75a5c0cdcdb7a47891 F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01 -F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff -P c6fa8d0d82805be230f672eabccdfa5680d4ddfd -R f2d9932522491a86ed313bf5e3a1693d -U drh -Z 4f6d25a564bc084e4d5fbc71ec75b6b1 +F tool/win/sqlite.vsix a94fb9b1b1ef06efc2898975cdfcfa9643731f5e +P 9c6961967ae00e563ebe2859eaf2639a79f2cb01 +R cd982f22bbf931205d39222b6f2ba26d +T *branch * vsixWinPhone81 +T *sym-vsixWinPhone81 * +T -sym-trunk * +U mistachkin +Z 0f515f990cd1ad75013b0794d9a0c168 diff --git a/manifest.uuid b/manifest.uuid index c03388d6de..f9d51641f8 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -9c6961967ae00e563ebe2859eaf2639a79f2cb01 \ No newline at end of file +a1b2f28ba85b043df68875f5d3446140db4f2cb0 \ No newline at end of file diff --git a/tool/mkvsix.tcl b/tool/mkvsix.tcl index 65fa731245..3268efdee7 100644 --- a/tool/mkvsix.tcl +++ b/tool/mkvsix.tcl @@ -256,7 +256,8 @@ if {[string equal -nocase $packageFlavor WinRT]} then { set displayName "SQLite for Windows Runtime" set targetPlatformIdentifier Windows set targetPlatformVersion v8.0 - set minVsVersion 11.0 + set minVsVersion [appendArgs \ + "\r\n " {MinVSVersion="11.0"}] set extraSdkPath "" set extraFileListAttributes [appendArgs \ "\r\n " {AppliesTo="WindowsAppContainer"} \ @@ -266,7 +267,8 @@ if {[string equal -nocase $packageFlavor WinRT]} then { set displayName "SQLite for Windows Runtime (Windows 8.1)" set targetPlatformIdentifier Windows set targetPlatformVersion v8.1 - set minVsVersion 12.0 + set minVsVersion [appendArgs \ + "\r\n " {MinVSVersion="12.0"}] set extraSdkPath "" set extraFileListAttributes [appendArgs \ "\r\n " {AppliesTo="WindowsAppContainer"} \ @@ -276,7 +278,17 @@ if {[string equal -nocase $packageFlavor WinRT]} then { set displayName "SQLite for Windows Phone" set targetPlatformIdentifier "Windows Phone" set targetPlatformVersion v8.0 - set minVsVersion 11.0 + set minVsVersion [appendArgs \ + "\r\n " {MinVSVersion="11.0"}] + set extraSdkPath "\\..\\$targetPlatformIdentifier" + set extraFileListAttributes "" +} elseif {[string equal -nocase $packageFlavor WP81]} then { + set shortName SQLite.WP81 + set displayName "SQLite for Windows Phone 8.1" + set targetPlatformIdentifier "WindowsPhoneApp" + set targetPlatformVersion v8.1 + set minVsVersion [appendArgs \ + "\r\n " {MinVSVersion="12.0"}] set extraSdkPath "\\..\\$targetPlatformIdentifier" set extraFileListAttributes "" } elseif {[string equal -nocase $packageFlavor Win32]} then { @@ -284,13 +296,16 @@ if {[string equal -nocase $packageFlavor WinRT]} then { set displayName "SQLite for Windows" set targetPlatformIdentifier Windows set targetPlatformVersion v8.0 - set minVsVersion 11.0 + set minVsVersion [appendArgs \ + "\r\n " {MinVSVersion="11.0"}] set extraSdkPath "" set extraFileListAttributes [appendArgs \ "\r\n " {AppliesTo="VisualC"} \ "\r\n " {DependsOn="Microsoft.VCLibs, version=11.0"}] } else { - fail "unsupported package flavor, must be one of: WinRT WinRT81 WP80 Win32" + fail [appendArgs \ + "unsupported package flavor, must be one of: " \ + "WinRT WinRT81 WP80 WP81 Win32"] } if {$argc >= 4} then { diff --git a/tool/win/sqlite.vsix b/tool/win/sqlite.vsix index ac4afb3f4bc2aa7c4419376732e5a7b3910d1070..de4d0a1f96ad3b53b899a7bcfbba53f23a1d4990 100644 GIT binary patch delta 313 zcmV-90mlBhfC99D0OuO<`_nW@U49E_iKh zRgh0h!$1(l?}dJcWy#e>>ZK#bm%`XWEq3S8|QbemE~Y0oaTn%_((vn3jMK$hu5rMX28f2R6=tSpo|+cp1k z&?E6gzKOLgD~sljMljq5(yIX^5M~`ES(~)C%Z4o z>h=0f?;lVcLX-FbvkrS(1PuUykwjgh(dOF#001|Wc7HGjqdpA6kXp}^t$#ZK36tr6 LN(K*n00000h#!t5 delta 327 zcmV-N0l5COfC9OI0OuO<`_nW@U49E_iKh zRgg_f!$1&*?}h${W$D#KZ=zjGK?{Nvq0ozZh{>cG*)L~jO-1tG-H^t%dwbxSecze+ zVsEtg1`6n`l2_TK6ktnNq1`DNxxToTVsST}%vY%42?I|jBE5SIe_j_q&xHXcXTQ}E zJ2@CHTmsxYYkz0f$~Q)}%A9&PQEY?%E`p0{nAg)fZ^nWJ4kYG}8c?a;FS$0QC1 z?h?bEsTdnBnF&84L+FO-P4qtHhIQ18Uc+H9DEUC-NS;|xEval$e#wy_Ij^4%t(c|# zxOQav_CdVezRUh93HcbB;15ts0|b-5e;BhRdp`sXQ(e?Tdi!qm-~a#sOp|ecFb5W4 ZChz5K&XcHrI{^-px001^@mD~UT From e756bfb3635d952a54420f9f473db41997c13428 Mon Sep 17 00:00:00 2001 From: mistachkin Date: Mon, 21 Apr 2014 18:00:11 +0000 Subject: [PATCH 2/9] Preliminary changes to support building VSIX packages for Windows 8.0 and Windows Phone 8.0 using Visual Studio 2013. FossilOrigin-Name: 3bf97c811a25babf760f256245c756ed6710f8ba --- manifest | 15 ++++++--------- manifest.uuid | 2 +- tool/mkvsix.tcl | 22 +++++++++++++++++++++- 3 files changed, 28 insertions(+), 11 deletions(-) diff --git a/manifest b/manifest index eea66b0d82..df82a686b4 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Preliminary\schanges\sto\ssupport\sbuilding\sVSIX\spackages\sfor\sWindows\sPhone\s8.1. -D 2014-04-18T00:08:13.436 +C Preliminary\schanges\sto\ssupport\sbuilding\sVSIX\spackages\sfor\sWindows\s8.0\sand\sWindows\sPhone\s8.0\susing\sVisual\sStudio\s2013. +D 2014-04-21T18:00:11.146 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 2ef13430cd359f7b361bb863504e227b25cc7f81 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -1132,7 +1132,7 @@ F tool/mksqlite3c-noext.tcl 8bce31074e4cbe631bb7676526a048335f4c9f02 F tool/mksqlite3c.tcl ed5b4e9ca8bf209ff401059a16362f37710fd8b8 F tool/mksqlite3h.tcl ba24038056f51fde07c0079c41885ab85e2cff12 F tool/mksqlite3internalh.tcl 3dca7bb5374cee003379b8cbac73714f610ef795 -F tool/mkvsix.tcl df937e1fadbd98995c701002b2a4b0187a04f6ff +F tool/mkvsix.tcl 0d439bb042d0f889210afa91674fe7bf07131d39 F tool/offsets.c fe4262fdfa378e8f5499a42136d17bf3b98f6091 F tool/omittest.tcl 34d7ac01fe4fd18e3637f64abe12c40eca0f6b97 F tool/opcodeDoc.awk b3a2a3d5d3075b8bd90b7afe24283efdd586659c @@ -1160,10 +1160,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01 F tool/win/sqlite.vsix a94fb9b1b1ef06efc2898975cdfcfa9643731f5e -P 9c6961967ae00e563ebe2859eaf2639a79f2cb01 -R cd982f22bbf931205d39222b6f2ba26d -T *branch * vsixWinPhone81 -T *sym-vsixWinPhone81 * -T -sym-trunk * +P a1b2f28ba85b043df68875f5d3446140db4f2cb0 +R c68a023e71ddd46ca56f8a556c77ce10 U mistachkin -Z 0f515f990cd1ad75013b0794d9a0c168 +Z aa4cbe46e2e91580e28bf4f7ed1db0b0 diff --git a/manifest.uuid b/manifest.uuid index f9d51641f8..0f284be186 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a1b2f28ba85b043df68875f5d3446140db4f2cb0 \ No newline at end of file +3bf97c811a25babf760f256245c756ed6710f8ba \ No newline at end of file diff --git a/tool/mkvsix.tcl b/tool/mkvsix.tcl index 3268efdee7..787326f0f1 100644 --- a/tool/mkvsix.tcl +++ b/tool/mkvsix.tcl @@ -262,6 +262,17 @@ if {[string equal -nocase $packageFlavor WinRT]} then { set extraFileListAttributes [appendArgs \ "\r\n " {AppliesTo="WindowsAppContainer"} \ "\r\n " {DependsOn="Microsoft.VCLibs, version=11.0"}] +} elseif {[string equal -nocase $packageFlavor WinRT_2013]} then { + set shortName SQLite.WinRT.2013 + set displayName "SQLite for Windows Runtime (2013)" + set targetPlatformIdentifier Windows + set targetPlatformVersion v8.0 + set minVsVersion [appendArgs \ + "\r\n " {MinVSVersion="12.0"}] + set extraSdkPath "" + set extraFileListAttributes [appendArgs \ + "\r\n " {AppliesTo="WindowsAppContainer"} \ + "\r\n " {DependsOn="Microsoft.VCLibs, version=12.0"}] } elseif {[string equal -nocase $packageFlavor WinRT81]} then { set shortName SQLite.WinRT81 set displayName "SQLite for Windows Runtime (Windows 8.1)" @@ -282,6 +293,15 @@ if {[string equal -nocase $packageFlavor WinRT]} then { "\r\n " {MinVSVersion="11.0"}] set extraSdkPath "\\..\\$targetPlatformIdentifier" set extraFileListAttributes "" +} elseif {[string equal -nocase $packageFlavor WP80_2013]} then { + set shortName SQLite.WP80.2013 + set displayName "SQLite for Windows Phone (2013)" + set targetPlatformIdentifier "Windows Phone" + set targetPlatformVersion v8.0 + set minVsVersion [appendArgs \ + "\r\n " {MinVSVersion="12.0"}] + set extraSdkPath "\\..\\$targetPlatformIdentifier" + set extraFileListAttributes "" } elseif {[string equal -nocase $packageFlavor WP81]} then { set shortName SQLite.WP81 set displayName "SQLite for Windows Phone 8.1" @@ -305,7 +325,7 @@ if {[string equal -nocase $packageFlavor WinRT]} then { } else { fail [appendArgs \ "unsupported package flavor, must be one of: " \ - "WinRT WinRT81 WP80 WP81 Win32"] + "WinRT WinRT_2013 WinRT81 WP80 WP80_2013 WP81 Win32"] } if {$argc >= 4} then { From 897f6833fc4482ea1bada1e9ddde538704a8dc56 Mon Sep 17 00:00:00 2001 From: mistachkin Date: Tue, 6 May 2014 00:09:46 +0000 Subject: [PATCH 3/9] Refactor VSIX package creation tool to better support Visual Studio 2013. FossilOrigin-Name: 8be166af239cbdaff3937c4003a6dc6e8a96e53a --- manifest | 12 +-- manifest.uuid | 2 +- tool/mkvsix.tcl | 250 +++++++++++++++++++++++++++++++----------------- 3 files changed, 167 insertions(+), 97 deletions(-) diff --git a/manifest b/manifest index 44f50d85ea..eb814f0314 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Merge\supdates\sfrom\strunk. -D 2014-05-05T22:50:19.792 +C Refactor\sVSIX\spackage\screation\stool\sto\sbetter\ssupport\sVisual\sStudio\s2013. +D 2014-05-06T00:09:46.488 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in dd2b1aba364ff9b05de41086f74407f285c57670 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -1140,7 +1140,7 @@ F tool/mksqlite3c-noext.tcl 1712d3d71256ca1f297046619c89e77a4d7c8f6d F tool/mksqlite3c.tcl ba274df71f5e6534b0a913c7c48eabfcbd0934b6 F tool/mksqlite3h.tcl ba24038056f51fde07c0079c41885ab85e2cff12 F tool/mksqlite3internalh.tcl b6514145a7d5321b47e64e19b8116cc44f973eb1 -F tool/mkvsix.tcl 0d439bb042d0f889210afa91674fe7bf07131d39 +F tool/mkvsix.tcl ee6cf791d22baeac5d488a30bac156e5098fabb9 F tool/offsets.c fe4262fdfa378e8f5499a42136d17bf3b98f6091 F tool/omittest.tcl 34d7ac01fe4fd18e3637f64abe12c40eca0f6b97 F tool/opcodeDoc.awk b3a2a3d5d3075b8bd90b7afe24283efdd586659c @@ -1168,7 +1168,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01 F tool/win/sqlite.vsix a94fb9b1b1ef06efc2898975cdfcfa9643731f5e -P eaa8fc810fcff8171b6c5cff8c661a6faf0e023b c1ab9092e29bc9d172c1f1a3becbcc83b79f2080 -R 6e2bd0951e32bcb3346844cc25759e20 +P 668ed76ac6cfd5810aea7319c752d77fafaab319 +R 5812195e1a7ed7ccc7cd4024eddb3bfc U mistachkin -Z 072e655b0f9d22e16552a74286be445f +Z add6d3433971df64a412a72ae0f72bd9 diff --git a/manifest.uuid b/manifest.uuid index 78722cf280..8b91267341 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -668ed76ac6cfd5810aea7319c752d77fafaab319 \ No newline at end of file +8be166af239cbdaff3937c4003a6dc6e8a96e53a \ No newline at end of file diff --git a/tool/mkvsix.tcl b/tool/mkvsix.tcl index 787326f0f1..feb1bcefd9 100644 --- a/tool/mkvsix.tcl +++ b/tool/mkvsix.tcl @@ -66,11 +66,15 @@ # containing the root of the source tree for SQLite. The third argument is # optional and if present must contain the flavor the VSIX package to build. # Currently, the only supported package flavors are "WinRT", "WinRT81", and -# "WP80". The fourth argument is optional and if present must be a string -# containing a list of platforms to include in the VSIX package. The format -# of the platform list string is "platform1,platform2,platform3". Typically, -# when on Windows, this script is executed using commands similar to the -# following from a normal Windows command prompt: +# "WP80", "WP81", and "Win32". The fourth argument is optional and if present +# must be a string containing a list of platforms to include in the VSIX +# package. The platform list is "platform1,platform2,platform3". The fifth +# argument is optional and if present must contain the version of Visual Studio +# required by the package. Currently, the only supported versions are "2012" +# and "2013". The package flavors "WinRT81" and "WP81" are only supported when +# the Visual Studio version is "2013". Typically, when on Windows, this script +# is executed using commands similar to the following from a normal Windows +# command prompt: # # CD /D C:\dev\sqlite\core # tclsh85 tool\mkvsix.tcl C:\Temp @@ -100,7 +104,7 @@ proc fail { {error ""} {usage false} } { puts stdout "usage:\ [file tail [info nameofexecutable]]\ [file tail [info script]] \[sourceDirectory\]\ -\[packageFlavor\] \[platformNames\]" +\[packageFlavor\] \[platformNames\] \[vsVersion\]" exit 1 } @@ -170,13 +174,50 @@ proc writeFile { fileName data } { return "" } -proc substFile { fileName } { +proc getMinVsVersionXmlChunk { vsVersion } { + switch -exact $vsVersion { + 2012 { + return [appendArgs \ + "\r\n " {MinVSVersion="11.0"}] + } + 2013 { + return [appendArgs \ + "\r\n " {MinVSVersion="12.0"}] + } + default { + return "" + } + } +} + +proc getExtraFileListXmlChunk { packageFlavor vsVersion } { # - # NOTE: Performs all Tcl command, variable, and backslash substitutions in - # the specified file and then rewrites the contents of that same file - # with the substituted data. + # NOTE: Neither Windows Phone 8.0 nor Windows Phone 8.1 require any extra + # attributes in their VSIX package SDK manifests. # - return [writeFile $fileName [uplevel 1 [list subst [readFile $fileName]]]] + if {[string equal $packageFlavor WP80] || \ + [string equal $packageFlavor WP81]} then { + return "" + } + + set appliesTo [expr {[string equal $packageFlavor Win32] ? \ + "VisualC" : "WindowsAppContainer"}] + + switch -exact $vsVersion { + 2012 { + return [appendArgs \ + "\r\n " AppliesTo=\" $appliesTo \" \ + "\r\n " {DependsOn="Microsoft.VCLibs, version=11.0"}] + } + 2013 { + return [appendArgs \ + "\r\n " AppliesTo=\" $appliesTo \" \ + "\r\n " {DependsOn="Microsoft.VCLibs, version=12.0"}] + } + default { + return "" + } + } } proc replaceFileNameTokens { fileName name buildName platformName } { @@ -188,6 +229,15 @@ proc replaceFileNameTokens { fileName name buildName platformName } { $name] $fileName] } +proc substFile { fileName } { + # + # NOTE: Performs all Tcl command, variable, and backslash substitutions in + # the specified file and then rewrites the contents of that same file + # with the substituted data. + # + return [writeFile $fileName [uplevel 1 [list subst [readFile $fileName]]]] +} + # # NOTE: This is the entry point for this script. # @@ -206,7 +256,7 @@ set rootName [file rootname [file tail $script]] # NOTE: Process and verify all the command line arguments. # set argc [llength $argv] -if {$argc < 1 || $argc > 4} then {fail} +if {$argc < 1 || $argc > 5} then {fail} set binaryDirectory [lindex $argv 0] @@ -251,93 +301,113 @@ if {[string length $packageFlavor] == 0} then { fail "invalid package flavor" } -if {[string equal -nocase $packageFlavor WinRT]} then { - set shortName SQLite.WinRT - set displayName "SQLite for Windows Runtime" - set targetPlatformIdentifier Windows - set targetPlatformVersion v8.0 - set minVsVersion [appendArgs \ - "\r\n " {MinVSVersion="11.0"}] - set extraSdkPath "" - set extraFileListAttributes [appendArgs \ - "\r\n " {AppliesTo="WindowsAppContainer"} \ - "\r\n " {DependsOn="Microsoft.VCLibs, version=11.0"}] -} elseif {[string equal -nocase $packageFlavor WinRT_2013]} then { - set shortName SQLite.WinRT.2013 - set displayName "SQLite for Windows Runtime (2013)" - set targetPlatformIdentifier Windows - set targetPlatformVersion v8.0 - set minVsVersion [appendArgs \ - "\r\n " {MinVSVersion="12.0"}] - set extraSdkPath "" - set extraFileListAttributes [appendArgs \ - "\r\n " {AppliesTo="WindowsAppContainer"} \ - "\r\n " {DependsOn="Microsoft.VCLibs, version=12.0"}] -} elseif {[string equal -nocase $packageFlavor WinRT81]} then { - set shortName SQLite.WinRT81 - set displayName "SQLite for Windows Runtime (Windows 8.1)" - set targetPlatformIdentifier Windows - set targetPlatformVersion v8.1 - set minVsVersion [appendArgs \ - "\r\n " {MinVSVersion="12.0"}] - set extraSdkPath "" - set extraFileListAttributes [appendArgs \ - "\r\n " {AppliesTo="WindowsAppContainer"} \ - "\r\n " {DependsOn="Microsoft.VCLibs, version=12.0"}] -} elseif {[string equal -nocase $packageFlavor WP80]} then { - set shortName SQLite.WP80 - set displayName "SQLite for Windows Phone" - set targetPlatformIdentifier "Windows Phone" - set targetPlatformVersion v8.0 - set minVsVersion [appendArgs \ - "\r\n " {MinVSVersion="11.0"}] - set extraSdkPath "\\..\\$targetPlatformIdentifier" - set extraFileListAttributes "" -} elseif {[string equal -nocase $packageFlavor WP80_2013]} then { - set shortName SQLite.WP80.2013 - set displayName "SQLite for Windows Phone (2013)" - set targetPlatformIdentifier "Windows Phone" - set targetPlatformVersion v8.0 - set minVsVersion [appendArgs \ - "\r\n " {MinVSVersion="12.0"}] - set extraSdkPath "\\..\\$targetPlatformIdentifier" - set extraFileListAttributes "" -} elseif {[string equal -nocase $packageFlavor WP81]} then { - set shortName SQLite.WP81 - set displayName "SQLite for Windows Phone 8.1" - set targetPlatformIdentifier "WindowsPhoneApp" - set targetPlatformVersion v8.1 - set minVsVersion [appendArgs \ - "\r\n " {MinVSVersion="12.0"}] - set extraSdkPath "\\..\\$targetPlatformIdentifier" - set extraFileListAttributes "" -} elseif {[string equal -nocase $packageFlavor Win32]} then { - set shortName SQLite.Win32 - set displayName "SQLite for Windows" - set targetPlatformIdentifier Windows - set targetPlatformVersion v8.0 - set minVsVersion [appendArgs \ - "\r\n " {MinVSVersion="11.0"}] - set extraSdkPath "" - set extraFileListAttributes [appendArgs \ - "\r\n " {AppliesTo="VisualC"} \ - "\r\n " {DependsOn="Microsoft.VCLibs, version=11.0"}] -} else { - fail [appendArgs \ - "unsupported package flavor, must be one of: " \ - "WinRT WinRT_2013 WinRT81 WP80 WP80_2013 WP81 Win32"] -} - if {$argc >= 4} then { set platformNames [list] foreach platformName [split [lindex $argv 3] ", "] { + set platformName [string trim $platformName] + if {[string length $platformName] > 0} then { lappend platformNames $platformName } } } +if {$argc >= 5} then { + set vsVersion [lindex $argv 4] +} else { + set vsVersion 2012 +} + +if {[string length $vsVersion] == 0} then { + fail "invalid Visual Studio version" +} + +if {$vsVersion ne "2012" && $vsVersion ne "2013"} then { + fail [appendArgs \ + "unsupported Visual Studio version, must be one of: " \ + [list 2012 2013]] +} + +set shortNames(WinRT,2012) SQLite.WinRT +set shortNames(WinRT,2013) SQLite.WinRT.2013 +set shortNames(WinRT81,2013) SQLite.WinRT81 +set shortNames(WP80,2012) SQLite.WP80 +set shortNames(WP80,2013) SQLite.WP80.2013 +set shortNames(WP81,2013) SQLite.WP81 +set shortNames(Win32,2012) SQLite.Win32 +set shortNames(Win32,2013) SQLite.Win32.2013 + +set displayNames(WinRT,2012) "SQLite for Windows Runtime" +set displayNames(WinRT,2013) "SQLite for Windows Runtime" +set displayNames(WinRT81,2013) "SQLite for Windows Runtime (Windows 8.1)" +set displayNames(WP80,2012) "SQLite for Windows Phone" +set displayNames(WP80,2013) "SQLite for Windows Phone" +set displayNames(WP81,2013) "SQLite for Windows Phone 8.1" +set displayNames(Win32,2012) "SQLite for Windows" +set displayNames(Win32,2013) "SQLite for Windows" + +if {[string equal $packageFlavor WinRT]} then { + set shortName $shortNames($packageFlavor,$vsVersion) + set displayName $displayNames($packageFlavor,$vsVersion) + set targetPlatformIdentifier Windows + set targetPlatformVersion v8.0 + set minVsVersion [getMinVsVersionXmlChunk $vsVersion] + set extraSdkPath "" + set extraFileListAttributes \ + [getExtraFileListXmlChunk $packageFlavor $vsVersion] +} elseif {[string equal $packageFlavor WinRT81]} then { + if {$vsVersion ne "2013"} then { + fail [appendArgs \ + "unsupported combination, package flavor " $packageFlavor \ + " is only supported with Visual Studio 2013"] + } + set shortName $shortNames($packageFlavor,$vsVersion) + set displayName $displayNames($packageFlavor,$vsVersion) + set targetPlatformIdentifier Windows + set targetPlatformVersion v8.1 + set minVsVersion [getMinVsVersionXmlChunk $vsVersion] + set extraSdkPath "" + set extraFileListAttributes \ + [getExtraFileListXmlChunk $packageFlavor $vsVersion] +} elseif {[string equal $packageFlavor WP80]} then { + set shortName $shortNames($packageFlavor,$vsVersion) + set displayName $displayNames($packageFlavor,$vsVersion) + set targetPlatformIdentifier "Windows Phone" + set targetPlatformVersion v8.0 + set minVsVersion [getMinVsVersionXmlChunk $vsVersion] + set extraSdkPath "\\..\\$targetPlatformIdentifier" + set extraFileListAttributes \ + [getExtraFileListXmlChunk $packageFlavor $vsVersion] +} elseif {[string equal $packageFlavor WP81]} then { + if {$vsVersion ne "2013"} then { + fail [appendArgs \ + "unsupported combination, package flavor " $packageFlavor \ + " is only supported with Visual Studio 2013"] + } + set shortName $shortNames($packageFlavor,$vsVersion) + set displayName $displayNames($packageFlavor,$vsVersion) + set targetPlatformIdentifier WindowsPhoneApp + set targetPlatformVersion v8.1 + set minVsVersion [getMinVsVersionXmlChunk $vsVersion] + set extraSdkPath "\\..\\$targetPlatformIdentifier" + set extraFileListAttributes \ + [getExtraFileListXmlChunk $packageFlavor $vsVersion] +} elseif {[string equal $packageFlavor Win32]} then { + set shortName $shortNames($packageFlavor,$vsVersion) + set displayName $displayNames($packageFlavor,$vsVersion) + set targetPlatformIdentifier Windows + set targetPlatformVersion v8.0 + set minVsVersion [getMinVsVersionXmlChunk $vsVersion] + set extraSdkPath "" + set extraFileListAttributes \ + [getExtraFileListXmlChunk $packageFlavor $vsVersion] +} else { + fail [appendArgs \ + "unsupported package flavor, must be one of: " \ + [list WinRT WinRT81 WP80 WP81 Win32]] +} + ############################################################################### # @@ -525,7 +595,7 @@ if {![info exists buildNames]} then { # overridden via the command line or the user-specific customizations # file. # -if {![info exists platformNames]} then { +if {![info exists platformNames] || [llength $platformNames] == 0} then { set platformNames [list x86 x64 ARM] } From 4712c21287cf757babe805bb1feaeb6be50a7564 Mon Sep 17 00:00:00 2001 From: mistachkin Date: Fri, 9 May 2014 20:51:17 +0000 Subject: [PATCH 4/9] When cross-compiling with the MSVC makefile, make sure the correct library path is used. Also, keep track of the required compilation options separately. FossilOrigin-Name: c3dce2e7390eec3a337be1b99f80ad5f721cc647 --- Makefile.msc | 80 ++++++++++++++++++++++++++++++++++----------------- manifest | 14 ++++----- manifest.uuid | 2 +- 3 files changed, 62 insertions(+), 34 deletions(-) diff --git a/Makefile.msc b/Makefile.msc index 2b970e3097..a2d623e653 100644 --- a/Makefile.msc +++ b/Makefile.msc @@ -1,6 +1,9 @@ # # nmake Makefile for SQLite # +############################################################################### +############################## START OF OPTIONS ############################### +############################################################################### # The toplevel directory of the source tree. This is the directory # that contains this "Makefile.msc". @@ -116,6 +119,19 @@ DEBUG = 0 OPTIMIZATIONS = 2 !ENDIF +# These are the "standard" SQLite compilation options used when compiling for +# the Windows platform. +# +!IFNDEF OPT_FEATURE_FLAGS +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS3=1 +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RTREE=1 +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1 +!ENDIF + +############################################################################### +############################### END OF OPTIONS ################################ +############################################################################### + # 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 # the legacy default value 'cl.exe'. @@ -140,6 +156,15 @@ LD = link.exe RC = rc.exe !ENDIF +# Check for the MSVC runtime library path macro. Othertise, this value will +# default to the 'lib' directory underneath the MSVC installation directory. +# +!IFNDEF CRTLIBPATH +CRTLIBPATH = $(VCINSTALLDIR)\lib +!ENDIF + +CRTLIBPATH = $(CRTLIBPATH:\\=\) + # Check for the command macro NCC. This should point to the compiler binary # for the platform the compilation process is taking place on. If it is not # defined, simply define it to have the same value as the CC macro. When @@ -168,8 +193,8 @@ NCC = $(NCC:\\=\) NCC = $(CC) !ENDIF -# Check for the MSVC runtime library path macro. Othertise, this -# value will default to the 'lib' directory underneath the MSVC +# Check for the MSVC native runtime library path macro. Othertise, +# this value will default to the 'lib' directory underneath the MSVC # installation directory. # !IFNDEF NCRTLIBPATH @@ -306,7 +331,6 @@ TCC = $(TCC) -DSQLITE_ENABLE_IOTRACE RCC = $(RCC) -DSQLITE_ENABLE_IOTRACE !ENDIF -# # Prevent warnings about "insecure" MSVC runtime library functions # being used. # @@ -314,28 +338,24 @@ TCC = $(TCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS BCC = $(BCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS RCC = $(RCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -# # Prevent warnings about "deprecated" POSIX functions being used. # TCC = $(TCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS BCC = $(BCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS RCC = $(RCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -# # Use the SQLite debugging heap subsystem? # !IF $(MEMDEBUG)!=0 TCC = $(TCC) -DSQLITE_MEMDEBUG=1 RCC = $(RCC) -DSQLITE_MEMDEBUG=1 -# # Use native Win32 heap subsystem instead of malloc/free? # !ELSEIF $(WIN32HEAP)!=0 TCC = $(TCC) -DSQLITE_WIN32_MALLOC=1 RCC = $(RCC) -DSQLITE_WIN32_MALLOC=1 -# # Validate the heap on every call into the native Win32 heap subsystem? # !IF $(DEBUG)>2 @@ -430,25 +450,25 @@ RCC = $(RCC) -DSQLITE_TEMP_STORE=1 # The same set of OMIT and ENABLE flags should be passed to the # LEMON parser generator and the mkkeywordhash tool as well. -# BEGIN standard options -OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS3=1 -OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RTREE=1 -OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1 -# END standard options +# These are the required SQLite compilation options used when compiling for +# the Windows platform. +# +REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_MAX_TRIGGER_DEPTH=100 -# BEGIN required Windows option -OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_MAX_TRIGGER_DEPTH=100 -# END required Windows option +# Add the required and optional SQLite compilation options into the command +# lines used to invoke the MSVC code and resource compilers. +# +TCC = $(TCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) +RCC = $(RCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) -TCC = $(TCC) $(OPT_FEATURE_FLAGS) -RCC = $(RCC) $(OPT_FEATURE_FLAGS) - -# Add in any optional parameters specified on the make commane line -# ie. make "OPTS=-DSQLITE_ENABLE_FOO=1 -DSQLITE_OMIT_FOO=1". +# Add in any optional parameters specified on the commane line, e.g. +# nmake /f Makefile.msc all "OPTS=-DSQLITE_ENABLE_FOO=1 -DSQLITE_OMIT_FOO=1" +# TCC = $(TCC) $(OPTS) RCC = $(RCC) $(OPTS) # If compiling for debugging, add some defines. +# !IF $(DEBUG)>0 TCC = $(TCC) -D_DEBUG BCC = $(BCC) -D_DEBUG @@ -457,6 +477,7 @@ RCC = $(RCC) -D_DEBUG # If optimizations are enabled or disabled (either implicitly or # explicitly), add the necessary flags. +# !IF $(DEBUG)>0 || $(OPTIMIZATIONS)==0 TCC = $(TCC) -Od BCC = $(BCC) -Od @@ -472,12 +493,14 @@ BCC = $(BCC) -O1 !ENDIF # If symbols are enabled (or compiling for debugging), enable PDBs. +# !IF $(DEBUG)>0 || $(SYMBOLS)!=0 TCC = $(TCC) -Zi BCC = $(BCC) -Zi !ENDIF # If ICU support is enabled, add the compiler options for it. +# !IF $(USE_ICU)!=0 TCC = $(TCC) -DSQLITE_ENABLE_ICU=1 RCC = $(RCC) -DSQLITE_ENABLE_ICU=1 @@ -489,6 +512,7 @@ RCC = $(RCC) -I$(ICUINCDIR) # Command line prefixes for compiling code, compiling resources, # linking, etc. +# LTCOMPILE = $(TCC) -Fo$@ LTRCOMPILE = $(RCC) -r LTLIB = lib.exe @@ -512,13 +536,13 @@ LTLINKOPTS = $(LTLINKOPTS) /APPCONTAINER !IF "$(VISUALSTUDIOVERSION)"=="12.0" !IFNDEF STORELIBPATH !IF "$(PLATFORM)"=="x86" -STORELIBPATH = $(NCRTLIBPATH)\store +STORELIBPATH = $(CRTLIBPATH)\store !ELSEIF "$(PLATFORM)"=="x64" -STORELIBPATH = $(NCRTLIBPATH)\store\amd64 +STORELIBPATH = $(CRTLIBPATH)\store\amd64 !ELSEIF "$(PLATFORM)"=="ARM" -STORELIBPATH = $(NCRTLIBPATH)\store\arm +STORELIBPATH = $(CRTLIBPATH)\store\arm !ELSE -STORELIBPATH = $(NCRTLIBPATH)\store +STORELIBPATH = $(CRTLIBPATH)\store !ENDIF !ENDIF STORELIBPATH = $(STORELIBPATH:\\=\) @@ -527,23 +551,27 @@ LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(STORELIBPATH)" !ENDIF # If either debugging or symbols are enabled, enable PDBs. +# !IF $(DEBUG)>0 || $(SYMBOLS)!=0 LDFLAGS = /DEBUG !ENDIF # Start with the Tcl related linker options. +# !IF $(NO_TCL)==0 LTLIBPATHS = /LIBPATH:$(TCLLIBDIR) LTLIBS = $(LIBTCL) !ENDIF # If ICU support is enabled, add the linker options for it. +# !IF $(USE_ICU)!=0 LTLIBPATHS = $(LTLIBPATHS) /LIBPATH:$(ICULIBDIR) LTLIBS = $(LTLIBS) $(LIBICU) !ENDIF # nawk compatible awk. +# !IFNDEF NAWK NAWK = gawk.exe !ENDIF @@ -1222,7 +1250,7 @@ parse.h: parse.c parse.c: $(TOP)\src\parse.y lemon.exe $(TOP)\addopcodes.awk del /Q parse.y parse.h parse.h.temp copy $(TOP)\src\parse.y . - .\lemon.exe $(OPT_FEATURE_FLAGS) $(OPTS) parse.y + .\lemon.exe $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(OPTS) parse.y move parse.h parse.h.temp $(NAWK) -f $(TOP)\addopcodes.awk parse.h.temp > parse.h @@ -1230,7 +1258,7 @@ sqlite3.h: $(TOP)\src\sqlite.h.in $(TOP)\manifest.uuid $(TOP)\VERSION $(TCLSH_CMD) $(TOP)\tool\mksqlite3h.tcl $(TOP:\=/) > sqlite3.h mkkeywordhash.exe: $(TOP)\tool\mkkeywordhash.c - $(BCC) -Fe$@ $(OPT_FEATURE_FLAGS) $(OPTS) $(TOP)\tool\mkkeywordhash.c /link $(NLTLINKOPTS) $(NLTLIBPATHS) + $(BCC) -Fe$@ $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(OPTS) $(TOP)\tool\mkkeywordhash.c /link $(NLTLINKOPTS) $(NLTLIBPATHS) keywordhash.h: $(TOP)\tool\mkkeywordhash.c mkkeywordhash.exe .\mkkeywordhash.exe > keywordhash.h diff --git a/manifest b/manifest index bec4a2d4fe..491f33f044 100644 --- a/manifest +++ b/manifest @@ -1,9 +1,9 @@ -C Include\ssqlite3rtree.h\sin\sthe\stsrc/\spile\sof\ssource\sfiles\sduring\ntarget_source\sin\sthe\smain.mk\smakefile. -D 2014-05-07T21:16:56.524 +C When\scross-compiling\swith\sthe\sMSVC\smakefile,\smake\ssure\sthe\scorrect\slibrary\spath\sis\sused.\s\sAlso,\skeep\strack\sof\sthe\srequired\scompilation\soptions\sseparately. +D 2014-05-09T20:51:17.136 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in dd2b1aba364ff9b05de41086f74407f285c57670 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 -F Makefile.msc 7e6c495d9a145054a09f518781916c7503f7a8e9 +F Makefile.msc f4b4d99d61cfe4ec508600dccd1a0ab2dc8a8b9b F Makefile.vxworks 034289efa9d591b04b1a73598623119c306cbba0 F README.md 64f270c43c38c46de749e419c22f0ae2f4499fe8 F VERSION 9f823c026c6a32fc5f84d212a8aae0a221dba45c @@ -1170,7 +1170,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01 F tool/win/sqlite.vsix a94fb9b1b1ef06efc2898975cdfcfa9643731f5e -P 68766f837491cb89c2103f2627eb9e23ab326a68 -R 1b75d6e5e9a19ccc14f8e59e21c749f6 -U drh -Z 3528e73d8f87faaf66e6658213b6d573 +P 116bed5af664899a73b46dca528ac0c021fc50c3 +R 88c72e40fa185e1eb8f17237cccbb934 +U mistachkin +Z b5868dcc5cdf0f5ef12e0a431c431ca8 diff --git a/manifest.uuid b/manifest.uuid index 150ca37810..a49c4f2f02 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -116bed5af664899a73b46dca528ac0c021fc50c3 \ No newline at end of file +c3dce2e7390eec3a337be1b99f80ad5f721cc647 \ No newline at end of file From d9b3c549b3fe3413aa8f37e175007895d2b00e2c Mon Sep 17 00:00:00 2001 From: mistachkin Date: Fri, 9 May 2014 23:31:55 +0000 Subject: [PATCH 5/9] Further MSVC makefile changes to support Windows Phone 8.1. FossilOrigin-Name: a9c81815e1b7a9c05da61f75edac45cb1a954135 --- Makefile.msc | 39 +++++++++++++++++++++++++++++++++++++++ manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 46 insertions(+), 7 deletions(-) diff --git a/Makefile.msc b/Makefile.msc index a2d623e653..218abe1f8c 100644 --- a/Makefile.msc +++ b/Makefile.msc @@ -16,6 +16,12 @@ TOP = . USE_AMALGAMATION = 1 !ENDIF +# Set this non-0 to use the libraries necessary for Windows Phone 8.1. +# +!IFNDEF USE_WP81_OPTS +USE_WP81_OPTS = 0 +!ENDIF + # Set this non-0 to split the SQLite amalgamation file into chunks to # be used for debugging with Visual Studio. # @@ -132,6 +138,12 @@ OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1 ############################### END OF OPTIONS ################################ ############################################################################### +# This assumes that MSVC is always installed in 32-bit Program Files directory +# and sets the variable for use in locating other 32-bit installs accordingly. +# +PROGRAMFILES_X86 = $(VCINSTALLDIR)\..\.. +PROGRAMFILES_X86 = $(PROGRAMFILES_X86:\\=\) + # 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 # the legacy default value 'cl.exe'. @@ -550,6 +562,33 @@ LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(STORELIBPATH)" !ENDIF !ENDIF +# When compiling for Windows Phone 8.1, an extra library path is +# required. +# +!IF $(USE_WP81_OPTS)!=0 +!IFNDEF WP81LIBPATH +!IF "$(PLATFORM)"=="x86" +WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86 +!ELSEIF "$(PLATFORM)"=="ARM" +WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\ARM +!ELSE +WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86 +!ENDIF +!ENDIF +!ENDIF + +# When compiling for Windows Phone 8.1, some extra linker options +# are also required. +# +!IF $(USE_WP81_OPTS)!=0 +!IFDEF WP81LIBPATH +LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(WP81LIBPATH)" +!ENDIF +LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE +LTLINKOPTS = $(LTLINKOPTS) WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib +LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:ole32.lib +!ENDIF + # If either debugging or symbols are enabled, enable PDBs. # !IF $(DEBUG)>0 || $(SYMBOLS)!=0 diff --git a/manifest b/manifest index 7f6738b740..3eb473a136 100644 --- a/manifest +++ b/manifest @@ -1,9 +1,9 @@ -C Merge\supdates\sfrom\strunk. -D 2014-05-09T20:54:07.623 +C Further\sMSVC\smakefile\schanges\sto\ssupport\sWindows\sPhone\s8.1. +D 2014-05-09T23:31:55.574 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in dd2b1aba364ff9b05de41086f74407f285c57670 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 -F Makefile.msc f4b4d99d61cfe4ec508600dccd1a0ab2dc8a8b9b +F Makefile.msc 26164f8288a7380b05587534ca3974c3837e5bd0 F Makefile.vxworks 034289efa9d591b04b1a73598623119c306cbba0 F README.md 64f270c43c38c46de749e419c22f0ae2f4499fe8 F VERSION 9f823c026c6a32fc5f84d212a8aae0a221dba45c @@ -1170,7 +1170,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01 F tool/win/sqlite.vsix a94fb9b1b1ef06efc2898975cdfcfa9643731f5e -P 69698ae90c415cb32d2c144725853483da65f0ff c3dce2e7390eec3a337be1b99f80ad5f721cc647 -R 5a8ec6fb329eaf82ce72337357145445 +P f4fea7bb8a4b118bdceff400a6c49c6291c0d58e +R cc5d4172ed1063b929dacadc942922f5 U mistachkin -Z 30139e1f65fbd864d0f9d58c85a7550e +Z e9a82f6e684a32dc44406c7db15e32b2 diff --git a/manifest.uuid b/manifest.uuid index 8c9091248c..36d319c95e 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -f4fea7bb8a4b118bdceff400a6c49c6291c0d58e \ No newline at end of file +a9c81815e1b7a9c05da61f75edac45cb1a954135 \ No newline at end of file From 1273614191d1ab5edc0ef4d6556a0b06e8fa3b18 Mon Sep 17 00:00:00 2001 From: mistachkin Date: Sat, 10 May 2014 17:28:45 +0000 Subject: [PATCH 6/9] When using Visual Studio 2013, add the appropriate MaxPlatformVersion attribute to the VSIX SDK manifest. FossilOrigin-Name: 0a4f59676bd0ab33b2c86c9a35a2ebbdbaf09ee7 --- manifest | 14 +++++++------- manifest.uuid | 2 +- tool/mkvsix.tcl | 37 ++++++++++++++++++++++++++++++++++++- tool/win/sqlite.vsix | Bin 32820 -> 32825 bytes 4 files changed, 44 insertions(+), 9 deletions(-) diff --git a/manifest b/manifest index 491f33f044..00a1115ee6 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C When\scross-compiling\swith\sthe\sMSVC\smakefile,\smake\ssure\sthe\scorrect\slibrary\spath\sis\sused.\s\sAlso,\skeep\strack\sof\sthe\srequired\scompilation\soptions\sseparately. -D 2014-05-09T20:51:17.136 +C When\susing\sVisual\sStudio\s2013,\sadd\sthe\sappropriate\sMaxPlatformVersion\sattribute\sto\sthe\sVSIX\sSDK\smanifest. +D 2014-05-10T17:28:45.158 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in dd2b1aba364ff9b05de41086f74407f285c57670 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -1142,7 +1142,7 @@ F tool/mksqlite3c-noext.tcl 1712d3d71256ca1f297046619c89e77a4d7c8f6d F tool/mksqlite3c.tcl ba274df71f5e6534b0a913c7c48eabfcbd0934b6 F tool/mksqlite3h.tcl ba24038056f51fde07c0079c41885ab85e2cff12 F tool/mksqlite3internalh.tcl b6514145a7d5321b47e64e19b8116cc44f973eb1 -F tool/mkvsix.tcl 924dcdecda86969686833301c08f84cca2600d94 +F tool/mkvsix.tcl 64805dc0677009f0ba6b6e7199b2f7613cac3ebe F tool/offsets.c fe4262fdfa378e8f5499a42136d17bf3b98f6091 F tool/omittest.tcl 34d7ac01fe4fd18e3637f64abe12c40eca0f6b97 F tool/opcodeDoc.awk b3a2a3d5d3075b8bd90b7afe24283efdd586659c @@ -1169,8 +1169,8 @@ F tool/vdbe-compress.tcl 0cf56e9263a152b84da86e75a5c0cdcdb7a47891 F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01 -F tool/win/sqlite.vsix a94fb9b1b1ef06efc2898975cdfcfa9643731f5e -P 116bed5af664899a73b46dca528ac0c021fc50c3 -R 88c72e40fa185e1eb8f17237cccbb934 +F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f +P c3dce2e7390eec3a337be1b99f80ad5f721cc647 +R 7cb8e1b3df65a486b753c19d33da3975 U mistachkin -Z b5868dcc5cdf0f5ef12e0a431c431ca8 +Z f2874f77f50d8a6763121ff9dede6833 diff --git a/manifest.uuid b/manifest.uuid index a49c4f2f02..ff047bf0ce 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -c3dce2e7390eec3a337be1b99f80ad5f721cc647 \ No newline at end of file +0a4f59676bd0ab33b2c86c9a35a2ebbdbaf09ee7 \ No newline at end of file diff --git a/tool/mkvsix.tcl b/tool/mkvsix.tcl index 712cf32278..378435aab4 100644 --- a/tool/mkvsix.tcl +++ b/tool/mkvsix.tcl @@ -189,6 +189,33 @@ proc getMinVsVersionXmlChunk { vsVersion } { } } +proc getMaxPlatformVersionXmlChunk { packageFlavor vsVersion } { + # + # NOTE: Only Visual Studio 2013 supports this SDK manifest attribute. + # + if {![string equal $vsVersion 2013]} then { + return "" + } + + switch -exact $packageFlavor { + WinRT { + return [appendArgs \ + "\r\n " {MaxPlatformVersion="8.0"}] + } + WinRT81 { + return [appendArgs \ + "\r\n " {MaxPlatformVersion="8.1"}] + } + WP80 { + return [appendArgs \ + "\r\n " {MaxPlatformVersion="8.0"}] + } + default { + return "" + } + } +} + proc getExtraFileListXmlChunk { packageFlavor vsVersion } { # # NOTE: Windows Phone 8.0 does not require any extra attributes in its VSIX @@ -321,7 +348,7 @@ if {[string length $vsVersion] == 0} then { fail "invalid Visual Studio version" } -if {$vsVersion ne "2012" && $vsVersion ne "2013"} then { +if {![string equal $vsVersion 2012] && ![string equal $vsVersion 2013]} then { fail [appendArgs \ "unsupported Visual Studio version, must be one of: " \ [list 2012 2013]] @@ -349,6 +376,8 @@ if {[string equal $packageFlavor WinRT]} then { set targetPlatformIdentifier Windows set targetPlatformVersion v8.0 set minVsVersion [getMinVsVersionXmlChunk $vsVersion] + set maxPlatformVersion \ + [getMaxPlatformVersionXmlChunk $packageFlavor $vsVersion] set extraSdkPath "" set extraFileListAttributes \ [getExtraFileListXmlChunk $packageFlavor $vsVersion] @@ -363,6 +392,8 @@ if {[string equal $packageFlavor WinRT]} then { set targetPlatformIdentifier Windows set targetPlatformVersion v8.1 set minVsVersion [getMinVsVersionXmlChunk $vsVersion] + set maxPlatformVersion \ + [getMaxPlatformVersionXmlChunk $packageFlavor $vsVersion] set extraSdkPath "" set extraFileListAttributes \ [getExtraFileListXmlChunk $packageFlavor $vsVersion] @@ -372,6 +403,8 @@ if {[string equal $packageFlavor WinRT]} then { set targetPlatformIdentifier "Windows Phone" set targetPlatformVersion v8.0 set minVsVersion [getMinVsVersionXmlChunk $vsVersion] + set maxPlatformVersion \ + [getMaxPlatformVersionXmlChunk $packageFlavor $vsVersion] set extraSdkPath "\\..\\$targetPlatformIdentifier" set extraFileListAttributes \ [getExtraFileListXmlChunk $packageFlavor $vsVersion] @@ -381,6 +414,8 @@ if {[string equal $packageFlavor WinRT]} then { set targetPlatformIdentifier Windows set targetPlatformVersion v8.0 set minVsVersion [getMinVsVersionXmlChunk $vsVersion] + set maxPlatformVersion \ + [getMaxPlatformVersionXmlChunk $packageFlavor $vsVersion] set extraSdkPath "" set extraFileListAttributes \ [getExtraFileListXmlChunk $packageFlavor $vsVersion] diff --git a/tool/win/sqlite.vsix b/tool/win/sqlite.vsix index de4d0a1f96ad3b53b899a7bcfbba53f23a1d4990..1450011266bc556131d33a625ca17688ffd19c00 100644 GIT binary patch delta 326 zcmV-M0lEIPfC9OI0OuO<`_nW@U49E_iKh zRgg_f!$1&*?}h${W$D#KZ=zjGK?{PFg3yb4Sd&RJvR}^5nuz4TyCtpFxxK?PJTEg} z^wx+^porcnc~P880j}~jx}B1Vo3l$P7B|z$e1!%cF!FRF^4ww!e@1^jY70uvzUxyQ z)Y=o=yT&WoGKZ_O?7FUq9|jo;PrEYTSajRC9UBfg>V9K1 zH=gWi2|bfOHe50jz9oh@jFP7mLiWaWGK|5%;Vvq9N90NVqo7_=)ngw0|b-5e;BhRdp`sXuTrW+6g`>a-~a#sOp|ecFb1R> YRY!Delc#??0S=Soe@X@vd;kCd0J=VsfdBvi delta 312 zcmV-80muHifC99D0OuO<`_nW@U49E_iKh zRgh0h!$1(l?}dJcWy#e>>ZK#bm%`XWEq3S8|QbemE~Y0oaTn%_((vn3jMK$hu5rMX28f2R6=tSpo|+cp1k z&?E6gzKOLgD~sljMljq5(yIX^5M~`ES(~)C%Z4o z>h=0f?;lVcLX-FbvkrS(1PuUykwjgh(dOF#001|Wc7HGiqdpA6kXn?#Rlj(m- K1`m7y0002+?Tu6b From 0f710546e71337dd680201d61566c1f329abb8a5 Mon Sep 17 00:00:00 2001 From: mistachkin Date: Mon, 12 May 2014 15:37:03 +0000 Subject: [PATCH 7/9] In mutex_w32.c, make inclusion of the Windows header file dependent on SQLITE_OS_WIN, not SQLITE_MUTEX_W32. FossilOrigin-Name: 93ffbcc0b1d207950851dbb16a8c101afb949d5f --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/mutex_w32.c | 12 +++++++----- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/manifest b/manifest index 00a1115ee6..735ec8ef6c 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C When\susing\sVisual\sStudio\s2013,\sadd\sthe\sappropriate\sMaxPlatformVersion\sattribute\sto\sthe\sVSIX\sSDK\smanifest. -D 2014-05-10T17:28:45.158 +C In\smutex_w32.c,\smake\sinclusion\sof\sthe\sWindows\sheader\sfile\sdependent\son\sSQLITE_OS_WIN,\snot\sSQLITE_MUTEX_W32. +D 2014-05-12T15:37:03.806 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in dd2b1aba364ff9b05de41086f74407f285c57670 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -199,7 +199,7 @@ F src/mutex.c d3b66a569368015e0fcb1ac15f81c119f504d3bc F src/mutex.h 5bc526e19dccc412b7ff04642f6fdad3fdfdabea F src/mutex_noop.c 7682796b7d8d39bf1c138248858efcd10c9e1553 F src/mutex_unix.c c3a4e00f96ba068a8dbef34084465979aaf369cc -F src/mutex_w32.c ab08c0fc54b71979370ca7c8f42fc64a9f211ebb +F src/mutex_w32.c 9bcab6e699fdb20eae784237c36b299830fb3316 F src/notify.c 976dd0f6171d4588e89e874fcc765e92914b6d30 F src/os.c 1b147e4cf7cc39e618115c14a086aed44bc91ace F src/os.h 60d419395e32a8029fa380a80a3da2e9030f635e @@ -1170,7 +1170,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P c3dce2e7390eec3a337be1b99f80ad5f721cc647 -R 7cb8e1b3df65a486b753c19d33da3975 +P 0a4f59676bd0ab33b2c86c9a35a2ebbdbaf09ee7 +R 4aed61add01807e8cd6ee17e1b6f3cd9 U mistachkin -Z f2874f77f50d8a6763121ff9dede6833 +Z 68de491dda45b3ab2f8417b0d5d6b640 diff --git a/manifest.uuid b/manifest.uuid index ff047bf0ce..81a48e539c 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -0a4f59676bd0ab33b2c86c9a35a2ebbdbaf09ee7 \ No newline at end of file +93ffbcc0b1d207950851dbb16a8c101afb949d5f \ No newline at end of file diff --git a/src/mutex_w32.c b/src/mutex_w32.c index 2eb852413e..f43a152389 100644 --- a/src/mutex_w32.c +++ b/src/mutex_w32.c @@ -13,17 +13,19 @@ */ #include "sqliteInt.h" +#if SQLITE_OS_WIN +/* +** Include the header file for the Windows VFS. +*/ +#include "os_win.h" +#endif + /* ** The code in this file is only used if we are compiling multithreaded ** on a win32 system. */ #ifdef SQLITE_MUTEX_W32 -/* -** Include the header file for the Windows VFS. -*/ -#include "os_win.h" - /* ** Each recursive mutex is an instance of the following structure. */ From a5e2b50d0af831a525cd469c95f17b3acf797d2c Mon Sep 17 00:00:00 2001 From: mistachkin Date: Mon, 12 May 2014 22:36:50 +0000 Subject: [PATCH 8/9] Improve a comment in the MSVC makefile. No changes to code. FossilOrigin-Name: 0901dccedaf5679691ba803ec76d113de170185d --- Makefile.msc | 3 ++- manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Makefile.msc b/Makefile.msc index 218abe1f8c..3d9d9f2eb2 100644 --- a/Makefile.msc +++ b/Makefile.msc @@ -16,7 +16,8 @@ TOP = . USE_AMALGAMATION = 1 !ENDIF -# Set this non-0 to use the libraries necessary for Windows Phone 8.1. +# Set this non-0 to use the library paths and other options necessary for +# Windows Phone 8.1. # !IFNDEF USE_WP81_OPTS USE_WP81_OPTS = 0 diff --git a/manifest b/manifest index 02097b3c0a..b51b7ce0c3 100644 --- a/manifest +++ b/manifest @@ -1,9 +1,9 @@ -C Add\sVSIX\spackaging\ssupport\sfor\sWindows\sPhone\s8.1\susing\sVisual\sStudio\s2013\sUpdate\s2. -D 2014-05-12T21:12:04.686 +C Improve\sa\scomment\sin\sthe\sMSVC\smakefile.\s\sNo\schanges\sto\scode. +D 2014-05-12T22:36:50.007 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in dd2b1aba364ff9b05de41086f74407f285c57670 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 -F Makefile.msc 26164f8288a7380b05587534ca3974c3837e5bd0 +F Makefile.msc 52911c6bfeaf9b40f47ef4615ab66d98ab0f2b3d F Makefile.vxworks 034289efa9d591b04b1a73598623119c306cbba0 F README.md 64f270c43c38c46de749e419c22f0ae2f4499fe8 F VERSION 9f823c026c6a32fc5f84d212a8aae0a221dba45c @@ -1170,7 +1170,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 93ffbcc0b1d207950851dbb16a8c101afb949d5f f6237a5f190bd5693ceed0ca1f048c3ec2a4da67 -R c51ed0a7c3ef74dbf1467c7d22b0e47a +P 013738f3d531078fb47f9992c18a0d630e771a32 +R 50044157f65da46177a12dafd4a6afe2 U mistachkin -Z 837dec045ed2c03443718363cb8f5388 +Z 53f9d3afbf5bc14f8e3dfdbc370843ae diff --git a/manifest.uuid b/manifest.uuid index d3e843960e..7af790eea2 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -013738f3d531078fb47f9992c18a0d630e771a32 \ No newline at end of file +0901dccedaf5679691ba803ec76d113de170185d \ No newline at end of file From c007f61bb02c2f20a3a240daeb0f2c88d68df85e Mon Sep 17 00:00:00 2001 From: drh Date: Fri, 16 May 2014 14:17:01 +0000 Subject: [PATCH 9/9] Repurpose the SQLITE_TESTCTRL_FAULT_INSTALL test-control to register a callback to be invoked by sqlite3FaultSim(). That test-control has been unused since 2008-06-20 and was never used in any official release. FossilOrigin-Name: 0d43a7ad9abe821e33e0bf83a997aa4461b1e3f2 --- manifest | 24 +++++++------- manifest.uuid | 2 +- src/global.c | 13 ++++++-- src/main.c | 17 ++++++++++ src/sqliteInt.h | 13 ++++++-- src/test2.c | 88 +++++++++++++++++++++++++++++++++++++++++++++++-- src/util.c | 18 ++++++++++ test/misc1.test | 16 +++++++++ 8 files changed, 171 insertions(+), 20 deletions(-) diff --git a/manifest b/manifest index b51b7ce0c3..716155c3c3 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Improve\sa\scomment\sin\sthe\sMSVC\smakefile.\s\sNo\schanges\sto\scode. -D 2014-05-12T22:36:50.007 +C Repurpose\sthe\sSQLITE_TESTCTRL_FAULT_INSTALL\stest-control\sto\sregister\sa\ncallback\sto\sbe\sinvoked\sby\ssqlite3FaultSim().\s\sThat\stest-control\shas\sbeen\nunused\ssince\s2008-06-20\sand\swas\snever\sused\sin\sany\sofficial\srelease. +D 2014-05-16T14:17:01.206 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in dd2b1aba364ff9b05de41086f74407f285c57670 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -178,7 +178,7 @@ F src/expr.c 4f9e497c66e2f25a4d139357a778c84d5713207c F src/fault.c 160a0c015b6c2629d3899ed2daf63d75754a32bb F src/fkey.c 5269ef07b100763134f71b889327c333bd0989cf F src/func.c 2e16316ec3a6365a0dc3e553c586f91b20f7f6c8 -F src/global.c 1d7bb7ea8254ae6a68ed9bfaf65fcb3d1690b486 +F src/global.c 1e4bd956dc2f608f87d2a929abc4a20db65f30e4 F src/hash.c d139319967164f139c8d1bb8a11b14db9c4ba3cd F src/hash.h 8890a25af81fb85a9ad7790d32eedab4b994da22 F src/hwtime.h d32741c8f4df852c7d959236615444e2b1063b08 @@ -187,7 +187,7 @@ F src/journal.c b4124532212b6952f42eb2c12fa3c25701d8ba8d F src/legacy.c 0df0b1550b9cc1f58229644735e317ac89131f12 F src/lempar.c cdf0a000315332fc9b50b62f3b5e22e080a0952b F src/loadext.c 867c7b330b740c6c917af9956b13b81d0a048303 -F src/main.c 0a8cfb6b2899649880e5874ac9bfd1c6f7c6a4a3 +F src/main.c bf60d71edc33a48a6e4f7494da64aaf15e6542fd F src/malloc.c 0203ebce9152c6a0e5de520140b8ba65187350be F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645 F src/mem1.c c0c990fcaddff810ea277b4fb5d9138603dd5d4b @@ -225,13 +225,13 @@ F src/shell.c 2afe7a7154e97be0c74c5feacf09626bda8493be F src/sqlite.h.in 564fc23db33870b5096b20d72df7491ce0b8b74f F src/sqlite3.rc 11094cc6a157a028b301a9f06b3d03089ea37c3e F src/sqlite3ext.h 886f5a34de171002ad46fae8c36a7d8051c190fc -F src/sqliteInt.h b2947801eccefd7ba3e5f14e1353289351a83cf3 +F src/sqliteInt.h 1977f44283be0d3b40da315fb4fd9e21c79fadcc F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d F src/status.c 7ac05a5c7017d0b9f0b4bcd701228b784f987158 F src/table.c 2cd62736f845d82200acfa1287e33feb3c15d62e F src/tclsqlite.c e87c99e28a145943666b51b212dacae35fcea0bd F src/test1.c 899bddeb0c7fb2b8062de6f03af4a4e4f48f9df5 -F src/test2.c 7355101c085304b90024f2261e056cdff13c6c35 +F src/test2.c 98049e51a17dc62606a99a9eb95ee477f9996712 F src/test3.c 1c0e5d6f080b8e33c1ce8b3078e7013fdbcd560c F src/test4.c 9b32d22f5f150abe23c1830e2057c4037c45b3df F src/test5.c 5a34feec76d9b3a86aab30fd4f6cc9c48cbab4c1 @@ -279,7 +279,7 @@ F src/tokenize.c 6da2de6e12218ccb0aea5184b56727d011f4bee7 F src/trigger.c 66f3470b03b52b395e839155786966e3e037fddb F src/update.c 5b3e74a03b3811e586b4f2b4cbd7c49f01c93115 F src/utf.c 6dc9ec9f1b3db43ae8ba0365377f11df1ee4c01c -F src/util.c 2b5fb283a190aacdb286f7835a447c45b345b83c +F src/util.c 049fe1d3c0e2209c1bee107aec2fcff6285f909f F src/vacuum.c 3728d74919d4fb1356f9e9a13e27773db60b7179 F src/vdbe.c 7f359193bf2366cc914a9ece093ebf284e56acdc F src/vdbe.h 394464909ed682334aa3d5831aae0c2fe2abef94 @@ -698,7 +698,7 @@ F test/minmax.test 42fbad0e81afaa6e0de41c960329f2b2c3526efd F test/minmax2.test b44bae787fc7b227597b01b0ca5575c7cb54d3bc F test/minmax3.test cc1e8b010136db0d01a6f2a29ba5a9f321034354 F test/minmax4.test 536a3360470633a177e42fbc19660d146b51daef -F test/misc1.test 441a0fafc7087f841db09fbfca54e7aea9f5a84c +F test/misc1.test 1201a037c24f982cc0e956cdaa34fcaf6439c417 F test/misc2.test 00d7de54eda90e237fc9a38b9e5ccc769ebf6d4d F test/misc3.test cf3dda47d5dda3e53fc5804a100d3c82be736c9d F test/misc4.test 9c078510fbfff05a9869a0b6d8b86a623ad2c4f6 @@ -1170,7 +1170,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 013738f3d531078fb47f9992c18a0d630e771a32 -R 50044157f65da46177a12dafd4a6afe2 -U mistachkin -Z 53f9d3afbf5bc14f8e3dfdbc370843ae +P 0901dccedaf5679691ba803ec76d113de170185d +R 67689d62fcdc72fe4681824f9ba5e0cd +U drh +Z 053659c56a956daeb64b7fcb6d47db2b diff --git a/manifest.uuid b/manifest.uuid index 7af790eea2..e1375063e0 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -0901dccedaf5679691ba803ec76d113de170185d \ No newline at end of file +0d43a7ad9abe821e33e0bf83a997aa4461b1e3f2 \ No newline at end of file diff --git a/src/global.c b/src/global.c index 1ee3f6436f..2c14b58abd 100644 --- a/src/global.c +++ b/src/global.c @@ -173,15 +173,22 @@ SQLITE_WSD struct Sqlite3Config sqlite3Config = { 0, /* isMutexInit */ 0, /* isMallocInit */ 0, /* isPCacheInit */ - 0, /* pInitMutex */ 0, /* nRefInitMutex */ + 0, /* pInitMutex */ 0, /* xLog */ 0, /* pLogArg */ - 0, /* bLocaltimeFault */ #ifdef SQLITE_ENABLE_SQLLOG 0, /* xSqllog */ - 0 /* pSqllogArg */ + 0, /* pSqllogArg */ #endif +#ifdef SQLITE_VDBE_COVERAGE + 0, /* xVdbeBranch */ + 0, /* pVbeBranchArg */ +#endif +#ifndef SQLITE_OMIT_BUILTIN_TEST + 0, /* xTestCallback */ +#endif + 0 /* bLocaltimeFault */ }; /* diff --git a/src/main.c b/src/main.c index 65521f4466..b3bc66e849 100644 --- a/src/main.c +++ b/src/main.c @@ -3114,6 +3114,23 @@ int sqlite3_test_control(int op, ...){ break; } + /* + ** sqlite3_test_control(FAULT_INSTALL, xCallback) + ** + ** Arrange to invoke xCallback() whenever sqlite3FaultSim() is called, + ** if xCallback is not NULL. + ** + ** As a test of the fault simulator mechanism itself, sqlite3FaultSim(0) + ** is called immediately after installing the new callback and the return + ** value from sqlite3FaultSim(0) becomes the return from + ** sqlite3_test_control(). + */ + case SQLITE_TESTCTRL_FAULT_INSTALL: { + sqlite3Config.xTestCallback = va_arg(ap, int(*)(int)); + rc = sqlite3FaultSim(0); + break; + } + /* ** sqlite3_test_control(BENIGN_MALLOC_HOOKS, xBegin, xEnd) ** diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 4bd65a690f..bb8763ccbb 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -2709,11 +2709,10 @@ struct Sqlite3Config { int isMutexInit; /* True after mutexes are initialized */ int isMallocInit; /* True after malloc is initialized */ int isPCacheInit; /* True after malloc is initialized */ - sqlite3_mutex *pInitMutex; /* Mutex used by sqlite3_initialize() */ int nRefInitMutex; /* Number of users of pInitMutex */ + sqlite3_mutex *pInitMutex; /* Mutex used by sqlite3_initialize() */ void (*xLog)(void*,int,const char*); /* Function for logging */ void *pLogArg; /* First argument to xLog() */ - int bLocaltimeFault; /* True to fail localtime() calls */ #ifdef SQLITE_ENABLE_SQLLOG void(*xSqllog)(void*,sqlite3*,const char*, int); void *pSqllogArg; @@ -2725,6 +2724,10 @@ struct Sqlite3Config { void (*xVdbeBranch)(void*,int iSrcLine,u8 eThis,u8 eMx); /* Callback */ void *pVdbeBranchArg; /* 1st argument */ #endif +#ifndef SQLITE_OMIT_BUILTIN_TEST + int (*xTestCallback)(int); /* Invoked by sqlite3FaultSim() */ +#endif + int bLocaltimeFault; /* True to fail localtime() calls */ }; /* @@ -3026,6 +3029,12 @@ int sqlite3ParseUri(const char*,const char*,unsigned int*, Btree *sqlite3DbNameToBtree(sqlite3*,const char*); int sqlite3CodeOnce(Parse *); +#ifdef SQLITE_OMIT_BUILTIN_TEST +# define sqlite3FaultSim(X) SQLITE_OK +#else + int sqlite3FaultSim(int); +#endif + Bitvec *sqlite3BitvecCreate(u32); int sqlite3BitvecTest(Bitvec*, u32); int sqlite3BitvecSet(Bitvec*, u32); diff --git a/src/test2.c b/src/test2.c index d130e9d01b..58f271ff27 100644 --- a/src/test2.c +++ b/src/test2.c @@ -568,7 +568,90 @@ static int testPendingByte( rc = sqlite3_test_control(SQLITE_TESTCTRL_PENDING_BYTE, pbyte); Tcl_SetObjResult(interp, Tcl_NewIntObj(rc)); return TCL_OK; -} +} + +/* +** The sqlite3FaultSim() callback: +*/ +static Tcl_Interp *faultSimInterp = 0; +static int faultSimScriptSize = 0; +static char *faultSimScript; +static int faultSimCallback(int x){ + char zInt[30]; + int i; + int isNeg; + int rc; + if( x==0 ){ + memcpy(faultSimScript+faultSimScriptSize, "0", 2); + }else{ + /* Convert x to text without using any sqlite3 routines */ + if( x<0 ){ + isNeg = 1; + x = -x; + }else{ + isNeg = 0; + } + zInt[sizeof(zInt)-1] = 0; + for(i=sizeof(zInt)-2; i>0 && x>0; i--, x /= 10){ + zInt[i] = (x%10) + '0'; + } + if( isNeg ) zInt[i--] = '-'; + memcpy(faultSimScript+faultSimScriptSize, zInt+i+1, sizeof(zInt)-i); + } + rc = Tcl_Eval(faultSimInterp, faultSimScript); + if( rc ){ + fprintf(stderr, "fault simulator script failed: [%s]", faultSimScript); + rc = SQLITE_ERROR; + }else{ + rc = atoi(Tcl_GetStringResult(faultSimInterp)); + } + Tcl_ResetResult(faultSimInterp); + return rc; +} + +/* +** sqlite3_test_control_fault_install SCRIPT +** +** Arrange to invoke SCRIPT with the integer argument to sqlite3FaultSim() +** appended, whenever sqlite3FaultSim() is called. Or, if SCRIPT is the +** empty string, cancel the sqlite3FaultSim() callback. +*/ +static int faultInstallCmd( + void *NotUsed, + Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ + int argc, /* Number of arguments */ + const char **argv /* Text of each argument */ +){ + const char *zScript; + int nScript; + int rc; + if( argc!=1 && argc!=2 ){ + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], + " SCRIPT\"", (void*)0); + } + zScript = argc==2 ? argv[1] : ""; + nScript = (int)strlen(zScript); + if( faultSimScript ){ + free(faultSimScript); + faultSimScript = 0; + } + if( nScript==0 ){ + rc = sqlite3_test_control(SQLITE_TESTCTRL_FAULT_INSTALL, 0); + }else{ + faultSimScript = malloc( nScript+100 ); + if( faultSimScript==0 ){ + Tcl_AppendResult(interp, "out of memory", (void*)0); + return SQLITE_ERROR; + } + memcpy(faultSimScript, zScript, nScript); + faultSimScript[nScript] = ' '; + faultSimScriptSize = nScript+1; + faultSimInterp = interp; + rc = sqlite3_test_control(SQLITE_TESTCTRL_FAULT_INSTALL, faultSimCallback); + } + Tcl_SetObjResult(interp, Tcl_NewIntObj(rc)); + return SQLITE_OK; +} /* ** sqlite3BitvecBuiltinTest SIZE PROGRAM @@ -638,7 +721,8 @@ int Sqlitetest2_Init(Tcl_Interp *interp){ { "fake_big_file", (Tcl_CmdProc*)fake_big_file }, #endif { "sqlite3BitvecBuiltinTest",(Tcl_CmdProc*)testBitvecBuiltinTest }, - { "sqlite3_test_control_pending_byte", (Tcl_CmdProc*)testPendingByte }, + { "sqlite3_test_control_pending_byte", (Tcl_CmdProc*)testPendingByte }, + { "sqlite3_test_control_fault_install", (Tcl_CmdProc*)faultInstallCmd }, }; int i; for(i=0; i