From: larrybr Date: Sat, 3 Dec 2022 17:19:11 +0000 (+0000) Subject: Make conglomerateur help with extension packaging. Otherwise a WIP check-in. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fheads%2Fextension_opts;p=thirdparty%2Fsqlite.git Make conglomerateur help with extension packaging. Otherwise a WIP check-in. FossilOrigin-Name: c4214d8d3ccc00669d69e7973213fabf111a0e95598911d8cc896a384fc18d66 --- diff --git a/manifest b/manifest index 37fac3b8f2..345116146b 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Experimental\sbranch\sfor\smore\sflexible\sselection\sof\sextensions\sand\slocalization\sof\sdetails\sof\sincorporation\sby\shost.\sA\sWIP\sfor\snow. -D 2022-12-02T03:35:28.370 +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,7 +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 fbfe60880fbde5b0c2806d2e983d86db1d6fa7fcc2f2e3f350a290a71540507e +F src/cli_extend.c 210ac37240461f40449dbffba65f5d5ab3023322f19f3e333a97de8df324d520 F src/complete.c a3634ab1e687055cd002e11b8f43eb75c17da23e F src/ctime.c 20507cc0b0a6c19cd882fcd0eaeda32ae6a4229fb4b024cfdf3183043d9b703d F src/date.c 94ce83b4cd848a387680a5f920c9018c16655db778c4d36525af0a0f34679ac5 @@ -647,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 c6be18e6a6c420070ff36c1d238aeba21c6ef3ad4d51e49646cec0b8d5c90bd3 +F src/shell.c.in 2fa0db2a2ba3de11a7fe4cfdff78bf9d56ebd61b668fc6a93fa0577b3b1540ac F src/sqlite.h.in 3439711b72cf1a541716da3671ac40f8d5957cdecfc192d47d32f7aed94207c2 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h c4b9fa7a7e2bcdf850cfeb4b8a91d5ec47b7a00033bc996fd2ee96cbf2741f5f @@ -1998,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 79f47c7903bcb7d32fd0f0b3b589302fa55cff649eed1b6ac353f06f9593d6d5 +F tool/mkshellc.tcl d5fcc4fa9a64fe3c653a9075d61d1142b1102d9f58bcae8a67c63c20632cd4b6 F tool/mksourceid.c 36aa8020014aed0836fd13c51d6dc9219b0df1761d6b5f58ff5b616211b079b9 F tool/mkspeedsql.tcl a1a334d288f7adfe6e996f2e712becf076745c97 F tool/mksqlite3c-noext.tcl 4f7cfef5152b0c91920355cbfc1d608a4ad242cb819f1aea07f6d0274f584a7f @@ -2066,11 +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 14a84b67fb17e16a5691ea4bf7f374123ac73a361a5d3d0efca53788d2001e3a -R 9f43e273f35904337d993bcd41e54bfb -T *branch * extension_opts -T *sym-extension_opts * -T -sym-trunk * +P 98be19ba839779e6d5a22850fe82fb3d5d7ed156baf8074a4d4b74f4e49f3f61 +R 56ba96a421073123171ddb2df531b291 U larrybr -Z 177a05c2fff7614fb99cda37f3a71700 +Z ef5df7251890b11b9fa9497cbe1cc5e4 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 1e63f19093..298517b9f3 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -98be19ba839779e6d5a22850fe82fb3d5d7ed156baf8074a4d4b74f4e49f3f61 \ No newline at end of file +c4214d8d3ccc00669d69e7973213fabf111a0e95598911d8cc896a384fc18d66 \ No newline at end of file diff --git a/src/cli_extend.c b/src/cli_extend.c index a33f054b90..f52db197e1 100644 --- a/src/cli_extend.c +++ b/src/cli_extend.c @@ -13,12 +13,16 @@ ** 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 -** built into and statically linked with a customized SQLite3 library build. +** (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. */ -INCLUDE cli_extend.c +#ifndef INCLUDE +# define INCLUDE(fn) +#endif + +INCLUDE(cli_extend.c) #include "cli_extend.c" diff --git a/src/shell.c.in b/src/shell.c.in index d0a1a6db61..df8130e883 100644 --- a/src/shell.c.in +++ b/src/shell.c.in @@ -1075,8 +1075,25 @@ INCLUDE ../ext/recover/sqlite3recover.c /* ** 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 diff --git a/tool/mkshellc.tcl b/tool/mkshellc.tcl index 034028d122..727fac459c 100644 --- a/tool/mkshellc.tcl +++ b/tool/mkshellc.tcl @@ -12,7 +12,10 @@ 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 @@ -30,6 +33,9 @@ puts $::out {/* DO NOT EDIT! ** 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. */} +} else { + set inSources $argv +} array set ::filesInput {} @@ -72,9 +78,14 @@ proc include_file {fname rlevel} { while {![eof $in]} { set lx [omit_redundant_typedefs [gets $in]] incr iLine - if {[regexp {^INCLUDE } $lx]} { - set cfile [lindex $lx 1] - include_file $cfile [expr $rlevel + 1] + 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} { @@ -90,6 +101,7 @@ proc include_file {fname rlevel} { } } -include_file shell.c.in 0 - +foreach {source} $inSources { + include_file $source 0 +} close $::out