From: stephan Date: Tue, 21 Jul 2026 20:18:16 +0000 (+0000) Subject: Random minor doc and formatting cleanups in the wasm makefile generator. X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=04ba5ef30bb994b0d1dd0c138427927201b85af1;p=thirdparty%2Fsqlite.git Random minor doc and formatting cleanups in the wasm makefile generator. FossilOrigin-Name: a24064919bcc187d5a4d9fa67cb1810fc4e7b9c92596fd2c8e6b0a66bc37e4b3 --- diff --git a/ext/wasm/mkwasmbuilds.c b/ext/wasm/mkwasmbuilds.c index d89aaf8529..db235611a6 100644 --- a/ext/wasm/mkwasmbuilds.c +++ b/ext/wasm/mkwasmbuilds.c @@ -53,7 +53,7 @@ enum BuildDefFlags { ** ** The only difference beween bundler-friendly and esm builds is ** that bundlers require static filename strings in a few places due - ** to limitations of bundler tooling, whereas vanilla and JS can + ** to limitations of bundler tooling, whereas vanilla and ESM can ** both work with dynamic strings. */ F_BUNDLER_FRIENDLY = 1<<1, @@ -105,7 +105,7 @@ enum BuildDefFlags { ** final build directory $(dir.dout). ** ** To keep parallel builds from stepping on each other, each distinct -** build goes into its own subdir $(dir.dout.$(BuildDef::zBaseName). +** build goes into its own subdir $(dir.dout)/$(BuildDef::zBaseName). ** Builds which produce deliverables we'd like to keep/distribute copy ** their final results into the build dir $(dir.dout). See the notes ** for the CP_JS enum entry for more details on that. @@ -136,7 +136,7 @@ enum BuildDefFlags { ** ** Each of those inputs has to be generated before passing them on to ** Emscripten so that any build-specific capabilities can get filtered -** in or out (using ./c-pp-lite.c). +** in or out (using ./c-pp). */ struct BuildDef { /* @@ -163,7 +163,7 @@ struct BuildDef { ** sqlite3.wasm file. In such cases we don't need the extra ** sqlite3-foo-bar.wasm which Emscripten (necessarily) creates when ** compiling the module, so we patch (at build-time) the JS file to - ** use this name instead sqlite3-foo-bar. + ** use this name instead of sqlite3-foo-bar. */ const char *zDotWasm; const char *zCmppD; /* Extra -D... flags for c-pp */ @@ -465,12 +465,12 @@ static void mk_prologue(void){ pf(zBanner "define b.do.emcc\n" /* $1 = build name */ - "$(bin.emcc) -o $@ $(emcc_opt_full) $(emcc.flags) " - "$(emcc.jsflags) -sENVIRONMENT=$(emcc.environment.$(1)) " - " $(pre-post.$(1).flags) " - " $(emcc.flags.$(1)) " - " $(cflags.common) $(cflags.$(1)) " - " $(SQLITE_OPT) " + "$(bin.emcc) -o $@ $(emcc_opt_full) $(emcc.flags)" + " $(emcc.jsflags) -sENVIRONMENT=$(emcc.environment.$(1))" + " $(pre-post.$(1).flags)" + " $(emcc.flags.$(1))" + " $(cflags.common) $(cflags.$(1))" + " $(SQLITE_OPT)" " $(cflags.wasm_extra_init) $(sqlite3-wasm.c.in)\n" "endef\n" ); @@ -603,8 +603,12 @@ static char const * BuildDef_basename(const BuildDef * pB){ static void mk_pre_post(char const *zBuildName, BuildDef const * pB){ char const * const zBaseName = pB ? BuildDef_basename(pB) : 0; + char const * const zDotWasm = pB + ? (pB->zDotWasm ? pB->zDotWasm : zBaseName) + : 0; - assert( zBuildName ); + assert( zBuildName + && "This function has not supported a null pB in a long time" ); pf("%s# Begin --pre/--post flags for %s\n", zBanner, zBuildName); ps("# --pre-js=..."); @@ -620,9 +624,6 @@ static void mk_pre_post(char const *zBuildName, BuildDef const * pB){ "))", zBuildName, zBuildName, zBuildName); }else{ - char const * const zDotWasm = pB - ? (pB->zDotWasm ? pB->zDotWasm : zBaseName) - : 0; /* ** See BuildDef::zDotWasm for _why_ we do this. _What_ we're doing ** is generate $(pre-js.BUILDNAME.js) as above, but: @@ -685,9 +686,7 @@ static void mk_pre_post(char const *zBuildName, BuildDef const * pB){ "$(extern-post-js.%s.js)," "$(c-pp.D.%s) --@policy=error -Dsqlite3.wasm=%s.wasm" "))", - zBuildName, zBuildName, zBuildName, - (pB->zDotWasm ? pB->zDotWasm : zBaseName) - ); + zBuildName, zBuildName, zBuildName, zDotWasm); }else{ pf("$(eval $(call b.c-pp.target," "%s," @@ -707,7 +706,6 @@ static void mk_pre_post(char const *zBuildName, BuildDef const * pB){ "--extern-post-js=$(extern-post-js.%s.js)\n", zBuildName, zBuildName, zBuildName, zBuildName); - /* Set up deps... */ pf("pre-post.%s.deps = " "$(pre-post-jses.common.deps) " @@ -978,7 +976,7 @@ static void mk_lib_mode(const char *zBuildName, const BuildDef * pB){ "endif\n", zBuildName, pB->zIfCond); } - pf("# End build [%s]%s", zBuildName, zBanner); + pf("# End build [%s%s]%s", pB->zEmo, zBuildName, zBanner); } @@ -1098,10 +1096,10 @@ int main(int argc, char const ** argv){ */ for( int i = 1; i < argc; ++i ){ char const * const zArg = argv[i]; -#define E(N) if(0==strcmp(#N, zArg)) {mk_lib_mode(# N, &oBuildDefs.N);} else /**/ +#define E(N) if(0==strcmp(#N, zArg)) {mk_lib_mode(# N, &oBuildDefs.N);} else BuildDefs_map(E) if( 0==strcmp("prologue",zArg) ){ mk_prologue(); - }else { + }else{ fprintf(stderr,"Unknown build name: %s\n", zArg); rc = 1; break; diff --git a/manifest b/manifest index b17b5bf6ec..ce43c4aa74 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Restructure\san\serrant\sgoto\swhich\sonly\saccidentally\snever\sbroke\sanything.\sAdd\ssome\sdebug\soutput\sto\smkwasmbuilds.c. -D 2026-07-21T19:12:38.601 +C Random\sminor\sdoc\sand\sformatting\scleanups\sin\sthe\swasm\smakefile\sgenerator. +D 2026-07-21T20:18:16.981 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -638,7 +638,7 @@ F ext/wasm/jaccwabyt/jaccwabyt.js 4e2b797dc170851c9c530c3567679f4aa509eec0fab73b F ext/wasm/jaccwabyt/jaccwabyt.md 6aa90fa1a973d0ad10d077088bea163b241d8470c75eafdef87620a1de1dea41 F ext/wasm/libcmpp.c 58ca45c18bc68710fa8f37bd11aa49a0ea937b9d95580c40b5ad89174aa07976 F ext/wasm/mkdist.sh f8883b077a2ca47cf92e6f0ce305fbf72ca648c3501810125056c4b09c2d5554 x -F ext/wasm/mkwasmbuilds.c 3c5ccccd974403fc8317a3b2a2c905aad929187244703b07cf2736111dee65e2 +F ext/wasm/mkwasmbuilds.c d4648ef369df6ea3b4e046494b3077f0baa5732282301a7418fdda39ec505a0f F ext/wasm/module-symbols.html e54f42112e0aac2a31f850ab33e7f2630a2ea4f63496f484a12469a2501e07e2 F ext/wasm/scratchpad-wasmfs.html a3d7388f3c4b263676b58b526846e9d02dfcb4014ff29d3a5040935286af5b96 F ext/wasm/scratchpad-wasmfs.mjs 66034b9256b218de59248aad796760a1584c1dd842231505895eff00dbd57c63 @@ -2217,8 +2217,8 @@ F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee F tool/warnings.sh a554d13f6e5cf3760f041b87939e3d616ec6961859c3245e8ef701d1eafc2ca2 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f F tool/winmain.c 00c8fb88e365c9017db14c73d3c78af62194d9644feaf60e220ab0f411f3604c -P 7a06190b712e0634dfc9ac53ab7632c2f46186cd280afd2da4af35df433bc3ed -R bc464bf49e508da49f58a8c6427d14f3 +P 0ca4e748e1682046f2e060876bcf7e8d249aa5611d939d32dc1365d3bcf12b48 +R 75875ffe22b4164244371e2436934478 U stephan -Z c9ad94aef282f3d56a8d2e88706fbe9f +Z 465d77400562fefe0f751887e6dd19fe # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 2af2f1b610..c7a1f2dffd 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -0ca4e748e1682046f2e060876bcf7e8d249aa5611d939d32dc1365d3bcf12b48 +a24064919bcc187d5a4d9fa67cb1810fc4e7b9c92596fd2c8e6b0a66bc37e4b3