1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Add a top-level license and build-time version info header to generated sqlite3*.js. Correct a broken link in ext/wasm/index.html.

FossilOrigin-Name: 0f1a06e8e39a1fbc74f1aff9cc59787282dfbf847d6c5c7edb3f7d410db0e4b7
This commit is contained in:
stephan
2022-10-16 15:38:03 +00:00
parent 879164ed74
commit 956392694a
10 changed files with 88 additions and 35 deletions

View File

@ -49,6 +49,7 @@ dir.fiddle := fiddle
CLEAN_FILES := *~ $(dir.jacc)/*~ $(dir.api)/*~ $(dir.common)/*~ CLEAN_FILES := *~ $(dir.jacc)/*~ $(dir.api)/*~ $(dir.common)/*~
emcc_enable_bigint ?= 1 emcc_enable_bigint ?= 1
sqlite3.c := $(dir.top)/sqlite3.c sqlite3.c := $(dir.top)/sqlite3.c
sqlite3.h := $(dir.top)/sqlite3.h
SQLITE_OPT = \ SQLITE_OPT = \
-DSQLITE_ENABLE_FTS4 \ -DSQLITE_ENABLE_FTS4 \
-DSQLITE_ENABLE_RTREE \ -DSQLITE_ENABLE_RTREE \
@ -109,7 +110,7 @@ emcc_opt_full := $(emcc_opt) -g3
######################################################################## ########################################################################
$(sqlite3.c): $(sqlite3.c) $(sqlite3.h):
$(MAKE) -C $(dir.top) sqlite3.c $(MAKE) -C $(dir.top) sqlite3.c
clean: clean:
@ -130,7 +131,10 @@ EXPORTED_FUNCTIONS.api: $(EXPORTED_FUNCTIONS.api.in) $(MAKEFILE)
cat $(EXPORTED_FUNCTIONS.api.in) > $@ cat $(EXPORTED_FUNCTIONS.api.in) > $@
CLEAN_FILES += EXPORTED_FUNCTIONS.api CLEAN_FILES += EXPORTED_FUNCTIONS.api
sqlite3-api.jses := $(dir.api)/sqlite3-api-prologue.js sqlite3-license-version.js := sqlite3-license-version.js
sqlite3-license-version-header.js := $(dir.api)/sqlite3-license-version-header.js
sqlite3-api.jses := $(sqlite3-license-version.js)
sqlite3-api.jses += $(dir.api)/sqlite3-api-prologue.js
sqlite3-api.jses += $(dir.common)/whwasmutil.js sqlite3-api.jses += $(dir.common)/whwasmutil.js
sqlite3-api.jses += $(dir.jacc)/jaccwabyt.js sqlite3-api.jses += $(dir.jacc)/jaccwabyt.js
sqlite3-api.jses += $(dir.api)/sqlite3-api-glue.js sqlite3-api.jses += $(dir.api)/sqlite3-api-glue.js
@ -141,6 +145,7 @@ sqlite3-api.jses += $(dir.api)/sqlite3-api-cleanup.js
sqlite3-api.js := sqlite3-api.js sqlite3-api.js := sqlite3-api.js
CLEAN_FILES += $(sqlite3-api.js) CLEAN_FILES += $(sqlite3-api.js)
CLEAN_FILES += $(sqlite3-license-version.js)
$(sqlite3-api.js): $(sqlite3-api.jses) $(MAKEFILE) $(sqlite3-api.js): $(sqlite3-api.jses) $(MAKEFILE)
@echo "Making $@..." @echo "Making $@..."
@for i in $(sqlite3-api.jses); do \ @for i in $(sqlite3-api.jses); do \
@ -171,9 +176,20 @@ extern-pre-js.js := $(dir.api)/extern-pre-js.js
pre-post-common.flags := \ pre-post-common.flags := \
--post-js=$(post-js.js) \ --post-js=$(post-js.js) \
--extern-post-js=$(extern-post-js.js) \ --extern-post-js=$(extern-post-js.js) \
--extern-pre-js=$(extern-pre-js.js) --extern-pre-js=$(dir.wasm)/$(sqlite3-license-version.js)
pre-post-jses.deps := $(post-js.js) \ pre-post-jses.deps := $(post-js.js) \
$(extern-post-js.js) $(extern-pre-js.js) $(extern-post-js.js) $(extern-pre-js.js) $(sqlite3-license-version.js)
$(sqlite3-license-version.js): $(sqlite3.h) $(sqlite3-license-version-header.js) $(MAKEFILE)
@echo "Making $@..."; { \
cat $(sqlite3-license-version-header.js); \
echo '/*'; \
echo '** This code was built from sqlite3 version...'; \
echo "** "; \
awk -e '/define SQLITE_VERSION/{$$1=""; print "**" $$0}' \
-e '/define SQLITE_SOURCE_ID/{$$1=""; print "**" $$0}' $(sqlite3.h); \
echo '*/'; \
} > $@
######################################################################## ########################################################################
# call-make-pre-js creates rules for pre-js-$(1).js. $1 = the base # call-make-pre-js creates rules for pre-js-$(1).js. $1 = the base
# name of the JS file on whose behalf this pre-js is for. # name of the JS file on whose behalf this pre-js is for.

View File

@ -1,5 +1,6 @@
/* extern-post-js.js must be appended to the resulting sqlite3.js /* extern-post-js.js must be appended to the resulting sqlite3.js
file. */ file. It gets its name from being used as the value for
the --extern-post-js=... Emscripten flag. */
(function(){ (function(){
/** /**
In order to hide the sqlite3InitModule()'s resulting Emscripten In order to hide the sqlite3InitModule()'s resulting Emscripten

View File

@ -1,4 +1,7 @@
/* extern-pre-js.js must be prepended to the resulting sqlite3.js /* extern-pre-js.js must be prepended to the resulting sqlite3.js
file. This file is currently only used for holding snippets during file. This file is currently only used for holding snippets during
test and development. test and development.
It gets its name from being used as the value for the
--extern-pre-js=... Emscripten flag.
*/ */

View File

@ -1,3 +1,4 @@
/* The current function scope was opened via post-js-header.js, which /* The current function scope was opened via post-js-header.js, which
gets prepended to this at build-time. */ gets prepended to this at build-time. This file closes that
scope. */
})/*postRun.push(...)*/; })/*postRun.push(...)*/;

View File

@ -1,3 +1,9 @@
/**
BEGIN FILE: api/pre-js.js
This file is intended to be prepended to the sqlite3.js build using
Emscripten's --pre-js=THIS_FILE flag (or equivalent).
*/
Module['locateFile'] = function(path, prefix) { Module['locateFile'] = function(path, prefix) {
return prefix + path; return prefix + path;
}; };
@ -39,3 +45,4 @@ Module[xInstantiateWasm] = function callee(imports,onSuccess){
scripts. scripts.
*/ */
Module[xInstantiateWasm].uri = 'sqlite3.wasm'; Module[xInstantiateWasm].uri = 'sqlite3.wasm';
/* END FILE: api/pre-js.js */

View File

@ -20,17 +20,15 @@ if('undefined' !== typeof Module){ // presumably an Emscripten build
/** /**
Install a suitable default configuration for sqlite3ApiBootstrap(). Install a suitable default configuration for sqlite3ApiBootstrap().
*/ */
const SABC = self.sqlite3ApiConfig || Object.create(null); const SABC = Object.assign(
if(undefined===SABC.Module){ Object.create(null), {
SABC.Module = Module /* ==> Currently needs to be exposed here for Module: Module /* ==> Currently needs to be exposed here for
test code. NOT part of the public API. */; test code. NOT part of the public API. */,
} exports: Module['asm'],
if(undefined===SABC.exports){ memory: Module.wasmMemory /* gets set if built with -sIMPORT_MEMORY */
SABC.exports = Module['asm']; },
} self.sqlite3ApiConfig || Object.create(null)
if(undefined===SABC.memory){ );
SABC.memory = Module.wasmMemory /* gets set if built with -sIMPORT_MEMORY */;
}
/** /**
For current (2022-08-22) purposes, automatically call For current (2022-08-22) purposes, automatically call
@ -38,10 +36,11 @@ if('undefined' !== typeof Module){ // presumably an Emscripten build
point, as we really want client code to be able to call this to point, as we really want client code to be able to call this to
configure certain parts. Clients may modify configure certain parts. Clients may modify
self.sqlite3ApiBootstrap.defaultConfig to tweak the default self.sqlite3ApiBootstrap.defaultConfig to tweak the default
configuration used by a no-args call to sqlite3ApiBootstrap(). configuration used by a no-args call to sqlite3ApiBootstrap(),
but must have first loaded their WASM module in order to be
able to provide the necessary configuration state.
*/ */
//console.warn("self.sqlite3ApiConfig = ",self.sqlite3ApiConfig); //console.warn("self.sqlite3ApiConfig = ",self.sqlite3ApiConfig);
const rmApiConfig = (SABC !== self.sqlite3ApiConfig);
self.sqlite3ApiConfig = SABC; self.sqlite3ApiConfig = SABC;
let sqlite3; let sqlite3;
try{ try{
@ -51,7 +50,7 @@ if('undefined' !== typeof Module){ // presumably an Emscripten build
throw e; throw e;
}finally{ }finally{
delete self.sqlite3ApiBootstrap; delete self.sqlite3ApiBootstrap;
if(rmApiConfig) delete self.sqlite3ApiConfig; delete self.sqlite3ApiConfig;
} }
if(self.location && +self.location.port > 1024){ if(self.location && +self.location.port > 1024){

View File

@ -0,0 +1,25 @@
/*
** LICENSE for the sqlite3 WebAssembly/JavaScript APIs.
**
** This bundle (typically released as sqlite3.js or sqlite3-wasmfs.js)
** is an amalgamation of JavaScript source code from two projects:
**
** 1) https://emscripten.org: the Emscripten "glue code" is covered by
** the terms of the MIT license and University of Illinois/NCSA
** Open Source License, as described at:
**
** https://emscripten.org/docs/introducing_emscripten/emscripten_license.html
**
** 2) https://sqlite.org: all code and documentation labeled as being
** from this source are released under the same terms as the sqlite3
** C library:
**
** 2022-10-16
**
** 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.
*/

View File

@ -46,7 +46,7 @@
<li><a href='tester1.html'>tester1</a>: Core unit and <li><a href='tester1.html'>tester1</a>: Core unit and
regression tests for the various APIs and surrounding regression tests for the various APIs and surrounding
utility code.</li> utility code.</li>
<li><a href='tester1.html'>tester1-worker</a>: same thing <li><a href='tester1-worker.html'>tester1-worker</a>: same thing
but running in a Worker.</li> but running in a Worker.</li>
</ul> </ul>
</li> </li>

View File

@ -1,5 +1,5 @@
C Fix\sa\sproblem\swith\susing\sthe\spush-down\soptimization\son\scompound\sSELECTs\swhere\scomponent\sSELECTs\suse\sdifferent\scollation\ssequences.\sdbsqlfuzz\s11516f050100243e5a845f5a2b48a90ed2efaf2e. C Add\sa\stop-level\slicense\sand\sbuild-time\sversion\sinfo\sheader\sto\sgenerated\ssqlite3*.js.\sCorrect\sa\sbroken\slink\sin\sext/wasm/index.html.
D 2022-10-14T19:30:34.777 D 2022-10-16T15:38:03.833
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@ -473,22 +473,23 @@ F ext/userauth/user-auth.txt e6641021a9210364665fe625d067617d03f27b04
F ext/userauth/userauth.c 7f00cded7dcaa5d47f54539b290a43d2e59f4b1eb5f447545fa865f002fc80cb F ext/userauth/userauth.c 7f00cded7dcaa5d47f54539b290a43d2e59f4b1eb5f447545fa865f002fc80cb
F ext/wasm/EXPORTED_FUNCTIONS.fiddle.in 27450c8b8c70875a260aca55435ec927068b34cef801a96205adb81bdcefc65c F ext/wasm/EXPORTED_FUNCTIONS.fiddle.in 27450c8b8c70875a260aca55435ec927068b34cef801a96205adb81bdcefc65c
F ext/wasm/EXPORTED_RUNTIME_METHODS.fiddle 0e88c8cfc3719e4b7e74980d9da664c709e68acf863e48386cda376edfd3bfb0 F ext/wasm/EXPORTED_RUNTIME_METHODS.fiddle 0e88c8cfc3719e4b7e74980d9da664c709e68acf863e48386cda376edfd3bfb0
F ext/wasm/GNUmakefile 4ec270532b921c7c4b437fbdb06f6a0ce41f3bd874395ce70dbc933c8553efa9 F ext/wasm/GNUmakefile e298b8a91fab19b758fc9e843601d50129afec1e5a6fcf4328affe3f34f40b3e
F ext/wasm/README.md 1e5b28158b74ab3ffc9d54fcbc020f0bbeb82c2ff8bbd904214c86c70e8a3066 F ext/wasm/README.md 1e5b28158b74ab3ffc9d54fcbc020f0bbeb82c2ff8bbd904214c86c70e8a3066
F ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-api 89983a8d122c35a90c65ec667844b95a78bcd04f3198a99c1e0c8368c1a0b03a F ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-api 89983a8d122c35a90c65ec667844b95a78bcd04f3198a99c1e0c8368c1a0b03a
F ext/wasm/api/EXPORTED_RUNTIME_METHODS.sqlite3-api 1ec3c73e7d66e95529c3c64ac3de2470b0e9e7fbf7a5b41261c367cf4f1b7287 F ext/wasm/api/EXPORTED_RUNTIME_METHODS.sqlite3-api 1ec3c73e7d66e95529c3c64ac3de2470b0e9e7fbf7a5b41261c367cf4f1b7287
F ext/wasm/api/README.md 62758e8dd98741d41505f69130cc767013d2e871ebb9e4313d8f8b97d95071d8 F ext/wasm/api/README.md 62758e8dd98741d41505f69130cc767013d2e871ebb9e4313d8f8b97d95071d8
F ext/wasm/api/extern-post-js.js dc68cbf552d8ea085181400a6963907c32e0b088b03ffd8969b1869fea246629 F ext/wasm/api/extern-post-js.js dfae3a5f621ae94f1fae671f8013ed6464355f11e2adda38ed8b10bf1929f337
F ext/wasm/api/extern-pre-js.js 20143b16b672d0a576fbf768a786d12ee1f84e222126477072389b992542a5b2 F ext/wasm/api/extern-pre-js.js cc61c09c7a24a07dbecb4c352453c3985170cec12b4e7e7e7a4d11d43c5c8f41
F ext/wasm/api/post-js-footer.js b64319261d920211b8700004d08b956a6c285f3b0bba81456260a713ed04900c F ext/wasm/api/post-js-footer.js cd0a8ec768501d9bd45d325ab0442037fb0e33d1f3b4f08902f15c34720ee4a1
F ext/wasm/api/post-js-header.js 2e5c886398013ba2af88028ecbced1e4b22dc96a86467f1ecc5ba9e64ef90a8b F ext/wasm/api/post-js-header.js 2e5c886398013ba2af88028ecbced1e4b22dc96a86467f1ecc5ba9e64ef90a8b
F ext/wasm/api/pre-js.js 2db711eb637991b383fc6b5c0f3df65ec48a7201e5730e304beba8de2d3f9b0b F ext/wasm/api/pre-js.js 5b550904322d73127badd4347ca967ea525b901573559736f92d326ad9b7bb76
F ext/wasm/api/sqlite3-api-cleanup.js 5d22d1d3818ecacb23bfa223d5970cd0617d8cdbb48c8bc4bbd463f05b021a99 F ext/wasm/api/sqlite3-api-cleanup.js 4d07a7524dc9b7b050acfde57163e839243ad2383bd7ee0de0178b1b3e988588
F ext/wasm/api/sqlite3-api-glue.js 842dc03783aecc951a543a209523343a6fda9af258fb0bee08e8cc2dc3c4d8ae F ext/wasm/api/sqlite3-api-glue.js 842dc03783aecc951a543a209523343a6fda9af258fb0bee08e8cc2dc3c4d8ae
F ext/wasm/api/sqlite3-api-oo1.js 00f5cfce0989d2e08d7b21765d703c69234245d03a0cce8fcb32ccfcd53ffdbb F ext/wasm/api/sqlite3-api-oo1.js 00f5cfce0989d2e08d7b21765d703c69234245d03a0cce8fcb32ccfcd53ffdbb
F ext/wasm/api/sqlite3-api-opfs.js 5a8ab3b76880c8ada8710ca9ba1ca5b160872edfd8bd5322e4f179a7f41cc616 F ext/wasm/api/sqlite3-api-opfs.js 5a8ab3b76880c8ada8710ca9ba1ca5b160872edfd8bd5322e4f179a7f41cc616
F ext/wasm/api/sqlite3-api-prologue.js b7c82a22d50658a48463fa646a23135273bc2cfa843aedda32627ff281c12e4d F ext/wasm/api/sqlite3-api-prologue.js b7c82a22d50658a48463fa646a23135273bc2cfa843aedda32627ff281c12e4d
F ext/wasm/api/sqlite3-api-worker1.js 7f4f46cb6b512a48572d7567233896e6a9c46570c44bdc3d13419730c7c221c8 F ext/wasm/api/sqlite3-api-worker1.js 7f4f46cb6b512a48572d7567233896e6a9c46570c44bdc3d13419730c7c221c8
F ext/wasm/api/sqlite3-license-version-header.js a661182fc93fc2cf212dfd0b987f8e138a3ac98f850b1112e29b5fbdaecc87c3
F ext/wasm/api/sqlite3-wasi.h 25356084cfe0d40458a902afb465df8c21fc4152c1d0a59b563a3fba59a068f9 F ext/wasm/api/sqlite3-wasi.h 25356084cfe0d40458a902afb465df8c21fc4152c1d0a59b563a3fba59a068f9
F ext/wasm/api/sqlite3-wasm.c 4c131945ced4b08a694d287abcdb066b896d961ef79ee5241805ecc37e83d63a F ext/wasm/api/sqlite3-wasm.c 4c131945ced4b08a694d287abcdb066b896d961ef79ee5241805ecc37e83d63a
F ext/wasm/batch-runner.html cf1a410c92bad50fcec2ddc71390b4e9df63a6ea1bef12a5163a66a0af4d78d9 F ext/wasm/batch-runner.html cf1a410c92bad50fcec2ddc71390b4e9df63a6ea1bef12a5163a66a0af4d78d9
@ -507,7 +508,7 @@ F ext/wasm/fiddle/emscripten.css 3d253a6fdb8983a2ac983855bfbdd4b6fa1ff267c28d695
F ext/wasm/fiddle/fiddle-worker.js 531859a471924a0ea48afa218e6877f0c164ca324d51e15843ed6ecc1c65c7ee F ext/wasm/fiddle/fiddle-worker.js 531859a471924a0ea48afa218e6877f0c164ca324d51e15843ed6ecc1c65c7ee
F ext/wasm/fiddle/fiddle.html 5daf54e8f3d7777cbb1ca4f93affe28858dbfff25841cb4ab81d694efed28ec2 F ext/wasm/fiddle/fiddle.html 5daf54e8f3d7777cbb1ca4f93affe28858dbfff25841cb4ab81d694efed28ec2
F ext/wasm/fiddle/fiddle.js 974b995119ac443685d7d94d3b3c58c6a36540e9eb3fed7069d5653284071715 F ext/wasm/fiddle/fiddle.js 974b995119ac443685d7d94d3b3c58c6a36540e9eb3fed7069d5653284071715
F ext/wasm/index.html 9ae9f9629310ed3ee88901aa14e20195815583806af245da08c2ecb43ced2243 F ext/wasm/index.html f41ff0b3cef07196b18f3f917c46560a0d5289064d344b438b254c41ed0f2c76
F ext/wasm/jaccwabyt/jaccwabyt.js 0d7f32817456a0f3937fcfd934afeb32154ca33580ab264dab6c285e6dbbd215 F ext/wasm/jaccwabyt/jaccwabyt.js 0d7f32817456a0f3937fcfd934afeb32154ca33580ab264dab6c285e6dbbd215
F ext/wasm/jaccwabyt/jaccwabyt.md 9aa6951b529a8b29f578ec8f0355713c39584c92cf1708f63ba0cf917cb5b68e F ext/wasm/jaccwabyt/jaccwabyt.md 9aa6951b529a8b29f578ec8f0355713c39584c92cf1708f63ba0cf917cb5b68e
F ext/wasm/scratchpad-wasmfs-main.html 20cf6f1a8f368e70d01e8c17200e3eaa90f1c8e1029186d836d14b83845fbe06 F ext/wasm/scratchpad-wasmfs-main.html 20cf6f1a8f368e70d01e8c17200e3eaa90f1c8e1029186d836d14b83845fbe06
@ -2031,8 +2032,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P 565d74c36f2dd4612860c7ee561682c50db28cfa5384346528292019dbfdf86c P ed14863dd72e35fa3a23320c3d5a8166515faea39a555c28a27b2d35e701eac4
R 75e7f9b91b017a681d1ae11ac5186379 R 664fdd2b5e755302311ec6a1ceb0cf59
U dan U stephan
Z 42c84fae9e00b1c8a3d198c324edcd95 Z 70648a34d9cd28a66a6a4694b2eeaced
# Remove this line to create a well-formed Fossil manifest. # Remove this line to create a well-formed Fossil manifest.

View File

@ -1 +1 @@
ed14863dd72e35fa3a23320c3d5a8166515faea39a555c28a27b2d35e701eac4 0f1a06e8e39a1fbc74f1aff9cc59787282dfbf847d6c5c7edb3f7d410db0e4b7