Compare commits

...

2 Commits

Author SHA1 Message Date
larrybr 4961fd900a Make conglomerateur help with extension packaging. Otherwise a WIP check-in.
FossilOrigin-Name: c4214d8d3ccc00669d69e7973213fabf111a0e95598911d8cc896a384fc18d66
2022-12-03 17:19:11 +00:00
larrybr 98f14f5fad Experimental branch for more flexible selection of extensions and localization of details of incorporation by host. A WIP for now.
FossilOrigin-Name: 98be19ba839779e6d5a22850fe82fb3d5d7ed156baf8074a4d4b74f4e49f3f61
2022-12-02 03:35:28 +00:00
5 changed files with 126 additions and 43 deletions
+9 -8
View File
@@ -1,5 +1,5 @@
C sqlite3_js_create_file()\snow\saccepts\san\sArrayBuffer\sdata\ssource.\sAdd\stest\sfor\sOPFS-based\sexport/re-import.\sThe\s(sqlite3*)\sargument\sconverter\snow\soptionally\saccepts\ssqlite3.oo1.DB\sinstances.
D 2022-12-01T15:22:03.961
C Make\sconglomerateur\shelp\swith\sextension\spackaging.\sOtherwise\sa\sWIP\scheck-in.
D 2022-12-03T17:19:11.144
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@@ -589,6 +589,7 @@ F src/btree.h 49da925329574798be3cbb745a49d069a9e67c99900d8a0d04b1e934d60394ea
F src/btreeInt.h 88ad499c92b489afedbfefc3f067c4d15023ec021afe622db240dc9d2277cfa5
F src/build.c d3e43e950e4e377c1d451a4862556792acdef1faba14a03f899d30d09731c48b
F src/callback.c 4cd7225b26a97f7de5fee5ae10464bed5a78f2adefe19534cc2095b3a8ca484a
F src/cli_extend.c 210ac37240461f40449dbffba65f5d5ab3023322f19f3e333a97de8df324d520
F src/complete.c a3634ab1e687055cd002e11b8f43eb75c17da23e
F src/ctime.c 20507cc0b0a6c19cd882fcd0eaeda32ae6a4229fb4b024cfdf3183043d9b703d
F src/date.c 94ce83b4cd848a387680a5f920c9018c16655db778c4d36525af0a0f34679ac5
@@ -646,7 +647,7 @@ F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c
F src/resolve.c efea4e5fbecfd6d0a9071b0be0d952620991673391b6ffaaf4c277b0bb674633
F src/rowset.c ba9515a922af32abe1f7d39406b9d35730ed65efab9443dc5702693b60854c92
F src/select.c 6983de0e6b8b68c97f82f9fca27ffb8f17161cff4d0d48fdf9eb40b213da0cc6
F src/shell.c.in 9fda74d40b206a707aaa69fc5dc38e2c6a9137a3f4a1dcd7af581d59d92c063c
F src/shell.c.in 2fa0db2a2ba3de11a7fe4cfdff78bf9d56ebd61b668fc6a93fa0577b3b1540ac
F src/sqlite.h.in 3439711b72cf1a541716da3671ac40f8d5957cdecfc192d47d32f7aed94207c2
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
F src/sqlite3ext.h c4b9fa7a7e2bcdf850cfeb4b8a91d5ec47b7a00033bc996fd2ee96cbf2741f5f
@@ -1997,7 +1998,7 @@ F tool/mkopcodec.tcl 33d20791e191df43209b77d37f0ff0904620b28465cca6990cf8d60da61
F tool/mkopcodeh.tcl bcb2bd5affb545fd219ef0304c7978e2a356407ab723f45ec8569235892c1c3f
F tool/mkopts.tcl 680f785fdb09729fd9ac50632413da4eadbdf9071535e3f26d03795828ab07fa
F tool/mkpragmatab.tcl bd07bd59d45d0f3448e123d6937e9811195f9908a51e09d774609883055bfd3d
F tool/mkshellc.tcl 02d0de8349ef830c0fb20d29680320bde2466e2ec422e5bd94c4317a7a7e8cc9
F tool/mkshellc.tcl d5fcc4fa9a64fe3c653a9075d61d1142b1102d9f58bcae8a67c63c20632cd4b6
F tool/mksourceid.c 36aa8020014aed0836fd13c51d6dc9219b0df1761d6b5f58ff5b616211b079b9
F tool/mkspeedsql.tcl a1a334d288f7adfe6e996f2e712becf076745c97
F tool/mksqlite3c-noext.tcl 4f7cfef5152b0c91920355cbfc1d608a4ad242cb819f1aea07f6d0274f584a7f
@@ -2065,8 +2066,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P 9ea2d3dcf798393a7fd231e199c0e2c6302949fe2a7f2573178fb0e50c78a2f4
R 03a40b38b5a233d1d5761f06f6f34dbb
U stephan
Z 343e90b1bb6c198c8661d1f234560b23
P 98be19ba839779e6d5a22850fe82fb3d5d7ed156baf8074a4d4b74f4e49f3f61
R 56ba96a421073123171ddb2df531b291
U larrybr
Z ef5df7251890b11b9fa9497cbe1cc5e4
# Remove this line to create a well-formed Fossil manifest.
+1 -1
View File
@@ -1 +1 @@
14a84b67fb17e16a5691ea4bf7f374123ac73a361a5d3d0efca53788d2001e3a
c4214d8d3ccc00669d69e7973213fabf111a0e95598911d8cc896a384fc18d66
+28
View File
@@ -0,0 +1,28 @@
/*
** 2022-12-01
**
** The author disclaims copyright to this source code. In place of
** a legal notice, here is a blessing:
**
** May you do good and not evil.
** May you find forgiveness for yourself and forgive others.
** May you share freely, never taking more than you give.
**
*************************************************************************
**
** This source allows multiple SQLite extensions to be either: (a) combined
** into a single runtime-loadable library; (b) built into the SQLite shell
** using a preprocessing convention set by src/shell.c.in (and shell.c), or
** (b) statically linked with a customized SQLite3 library build.
**
** The customized library build may be effected by appending this source
** to the sqlite3.c amalgamation to form a modified translation unit. How
** this concatenation is accomplished is immaterial.
*/
#ifndef INCLUDE
# define INCLUDE(fn)
#endif
INCLUDE(cli_extend.c)
#include "cli_extend.c"
+22
View File
@@ -1072,6 +1072,28 @@ INCLUDE ../ext/recover/dbdata.c
INCLUDE ../ext/recover/sqlite3recover.c
# endif
#endif
/*
** Provide for incorporating more or fewer extensions in custom builds.
**
** A build with PP symbol SQLITE_OMIT_STOCK_EXTENSIONS defined will not
** have the project's extensions that are built into the pre-built and
** published shell for the convenience of its users.
**
** A build with PP symbol SQLITE_SHELL_EXTSRC defined, with its value
** naming an extension source, will have that extension built in. And
** provided certain macro conventions are followed, its functionality
** will be available as for the regularly built-in extensions.
*/
/* The standard shell extensions come in here, but are optionally compiled.*/
#ifndef SQLITE_OMIT_STOCK_EXTENSIONS
#define INCLUDE
INCLUDE cli_extend.c
/* */
#endif /* !defined(SQLITE_OMIT_STOCK_EXTENSIONS) */
/* Customized shell extensions may come in here, adding or in lieu of above.*/
#ifdef SQLITE_SHELL_EXTSRC
# include SHELL_STRINGIFY(SQLITE_SHELL_EXTSRC)
#endif
+66 -34
View File
@@ -9,10 +9,13 @@
# the script is $DIR, then the component parts are located in $DIR/../src
# and $DIR/../ext/misc.
#
set topdir [file dir [file dir [file normal $argv0]]]
set out stdout
set ::topdir [file dir [file dir [file normal $argv0]]]
set ::out stdout
fconfigure stdout -translation binary
puts $out {/* DO NOT EDIT!
if {$argc == 0} {
set inSources [list shell.c.in]
puts $::out {/* DO NOT EDIT!
** This file is automatically generated by the script in the canonical
** SQLite source tree at tool/mkshellc.tcl. That script combines source
** code from various constituent source files of SQLite into this single
@@ -27,11 +30,15 @@ puts $out {/* DO NOT EDIT!
** source file to help make the command-line program easier to compile.
**
** To modify this program, get a copy of the canonical SQLite source tree,
** edit the src/shell.c.in" and/or some of the other files that are included
** edit "src/shell.c.in" and/or some of the other files that are included
** by "src/shell.c.in", then rerun the tool/mkshellc.tcl script.
*/}
set in [open $topdir/src/shell.c.in]
fconfigure $in -translation binary
} else {
set inSources $argv
}
array set ::filesInput {}
proc omit_redundant_typedefs {line} {
global typedef_seen
if {[regexp {^typedef .*\y([a-zA-Z0-9_]+);} $line all typename]} {
@@ -42,34 +49,59 @@ proc omit_redundant_typedefs {line} {
}
return $line
}
set iLine 0
while {1} {
set lx [omit_redundant_typedefs [gets $in]]
if {[eof $in]} break;
incr iLine
if {[regexp {^INCLUDE } $lx]} {
set cfile [lindex $lx 1]
puts $out "/************************* Begin $cfile ******************/"
# puts $out "#line 1 \"$cfile\""
set in2 [open $topdir/src/$cfile]
fconfigure $in2 -translation binary
while {![eof $in2]} {
set lx [omit_redundant_typedefs [gets $in2]]
if {[regexp {^#include "sqlite} $lx]} {
set lx "/* $lx */"
}
if {[regexp {^# *include "test_windirent.h"} $lx]} {
set lx "/* $lx */"
}
set lx [string map [list __declspec(dllexport) {}] $lx]
puts $out $lx
# For INCLUDED files, suppress redundant #include directives and
# eliminate a Windows-specific attribute not needed for the shell.
proc misc_sieve {line} {
if {[regexp {^# *include "([^"]+)"} $line _ finc]} {
set finc [regsub {".*$} $finc ""]
# Project headers #include'd at top level (by shell.c.in), or
# files already the object of INCLUDE, need not be #include'd.
if {[regexp {^sqlite} $finc] || [info exists ::filesInput($finc)]} {
return "/* $line */"
}
close $in2
puts $out "/************************* End $cfile ********************/"
# puts $out "#line [expr $iLine+1] \"shell.c.in\""
continue
}
puts $out $lx
return [string map [list __declspec(dllexport) {}] $line]
}
close $in
close $out
# Read, process and emit the named file, and track recursion level.
proc include_file {fname rlevel} {
if {[info exists ::filesInput($fname)]} return ;# Block revisits.
set in [open $::topdir/src/$fname]
fconfigure $in -translation binary
set ::filesInput($fname) 1
if {$rlevel > 0} {
puts $::out "/************************* Begin $fname ******************/"
}
set iLine 0
# puts $::out "#line 1 \"$fname\""
while {![eof $in]} {
set lx [omit_redundant_typedefs [gets $in]]
incr iLine
if {[regexp {^INCLUDE( |\()} $lx _ sep]} {
if {$sep eq " "} {
set ifn [lindex $lx 1]
} elseif {![regexp {^INCLUDE\( *([^ ]+) *\)} $lx _ ifn]} {
puts stderr "Bad INCLUDE at $iLine in $fname"
exit 1
}
include_file $ifn [expr $rlevel + 1]
# puts $::out "#line [expr $iLine+1] \"$fname\""
} else {
if {$rlevel > 0} {
puts $::out [misc_sieve $lx]
} elseif {$lx ne "" || ![eof $in]} {
puts $::out $lx
}
}
}
close $in
if {$rlevel > 0} {
puts $::out "/************************* End $fname ********************/"
}
}
foreach {source} $inSources {
include_file $source 0
}
close $::out