From b6503f14449a43b68b73126eaa5abb14cd825555 Mon Sep 17 00:00:00 2001 From: stephan Date: Thu, 6 Mar 2025 13:38:07 +0000 Subject: [PATCH 001/120] Cygwin-centric fixes from Jan Nijtmans. FossilOrigin-Name: 205979813c7300debb5f1ba270583ef2f08e069d6d01865b5910702889a5c1ed --- ext/expert/test_expert.c | 2 +- ext/fts3/fts3_test.c | 6 +-- ext/rbu/test_rbu.c | 4 +- ext/recover/test_recover.c | 2 +- ext/session/test_session.c | 14 ++--- manifest | 69 ++++++++++++------------ manifest.uuid | 2 +- src/os_win.h | 2 + src/tclsqlite.c | 4 +- src/test1.c | 106 ++++++++++++++++++------------------- src/test2.c | 36 ++++++------- src/test3.c | 40 +++++++------- src/test4.c | 50 ++++++++--------- src/test5.c | 2 +- src/test6.c | 4 +- src/test9.c | 6 +-- src/test_backup.c | 2 +- src/test_blob.c | 2 +- src/test_fs.c | 13 ++--- src/test_hexio.c | 8 +-- src/test_malloc.c | 2 +- src/test_multiplex.c | 4 +- src/test_mutex.c | 4 +- src/test_osinst.c | 27 +++++----- src/test_quota.c | 54 +++++++++---------- src/test_sqllog.c | 2 +- src/test_superlock.c | 2 +- src/test_syscall.c | 4 +- src/test_thread.c | 10 ++-- src/test_vfs.c | 8 +-- 30 files changed, 244 insertions(+), 247 deletions(-) diff --git a/ext/expert/test_expert.c b/ext/expert/test_expert.c index cae5d0f258..4383d7c7bb 100644 --- a/ext/expert/test_expert.c +++ b/ext/expert/test_expert.c @@ -28,7 +28,7 @@ static int dbHandleFromObj(Tcl_Interp *interp, Tcl_Obj *pObj, sqlite3 **pDb){ Tcl_CmdInfo info; if( 0==Tcl_GetCommandInfo(interp, Tcl_GetString(pObj), &info) ){ - Tcl_AppendResult(interp, "no such handle: ", Tcl_GetString(pObj), 0); + Tcl_AppendResult(interp, "no such handle: ", Tcl_GetString(pObj), NULL); return TCL_ERROR; } diff --git a/ext/fts3/fts3_test.c b/ext/fts3/fts3_test.c index 3c42a7bf02..70bccf0c52 100644 --- a/ext/fts3/fts3_test.c +++ b/ext/fts3/fts3_test.c @@ -219,7 +219,7 @@ static int SQLITE_TCLAPI fts3_near_match_cmd( rc = Tcl_ListObjGetElements(interp, pPhrase, &nToken, &apToken); if( rc!=TCL_OK ) goto near_match_out; if( nToken>NM_MAX_TOKEN ){ - Tcl_AppendResult(interp, "Too many tokens in phrase", 0); + Tcl_AppendResult(interp, "Too many tokens in phrase", NULL); rc = TCL_ERROR; goto near_match_out; } @@ -547,7 +547,7 @@ static int SQLITE_TCLAPI fts3_test_varint_cmd( if( w!=w2 || nByte!=nByte2 ){ char *zErr = sqlite3_mprintf("error testing %lld", w); Tcl_ResetResult(interp); - Tcl_AppendResult(interp, zErr, 0); + Tcl_AppendResult(interp, zErr, NULL); return TCL_ERROR; } @@ -557,7 +557,7 @@ static int SQLITE_TCLAPI fts3_test_varint_cmd( if( (int)w!=i || nByte!=nByte2 ){ char *zErr = sqlite3_mprintf("error testing %lld (32-bit)", w); Tcl_ResetResult(interp); - Tcl_AppendResult(interp, zErr, 0); + Tcl_AppendResult(interp, zErr, NULL); return TCL_ERROR; } } diff --git a/ext/rbu/test_rbu.c b/ext/rbu/test_rbu.c index 969d6208d8..6b933cdb23 100644 --- a/ext/rbu/test_rbu.c +++ b/ext/rbu/test_rbu.c @@ -139,7 +139,7 @@ static int SQLITE_TCLAPI test_sqlite3rbu_cmd( }else{ Tcl_SetObjResult(interp, Tcl_NewStringObj(sqlite3ErrName(rc), -1)); if( zErrmsg ){ - Tcl_AppendResult(interp, " - ", zErrmsg, 0); + Tcl_AppendResult(interp, " - ", zErrmsg, NULL); sqlite3_free(zErrmsg); } ret = TCL_ERROR; @@ -399,7 +399,7 @@ static int SQLITE_TCLAPI test_sqlite3rbu_internal_test( db = sqlite3rbu_db(0, 0); if( db!=0 ){ - Tcl_AppendResult(interp, "sqlite3rbu_db(0, 0)!=0", 0); + Tcl_AppendResult(interp, "sqlite3rbu_db(0, 0)!=0", NULL); return TCL_ERROR; } diff --git a/ext/recover/test_recover.c b/ext/recover/test_recover.c index c1c0d88386..f8ab41dc28 100644 --- a/ext/recover/test_recover.c +++ b/ext/recover/test_recover.c @@ -58,7 +58,7 @@ static int xSqlCallback(void *pSqlArg, const char *zSql){ static int getDbPointer(Tcl_Interp *interp, Tcl_Obj *pObj, sqlite3 **pDb){ Tcl_CmdInfo info; if( 0==Tcl_GetCommandInfo(interp, Tcl_GetString(pObj), &info) ){ - Tcl_AppendResult(interp, "no such handle: ", Tcl_GetString(pObj), 0); + Tcl_AppendResult(interp, "no such handle: ", Tcl_GetString(pObj), NULL); return TCL_ERROR; } *pDb = *(sqlite3 **)info.objClientData; diff --git a/ext/session/test_session.c b/ext/session/test_session.c index 41d6aaa109..e167cb8fb0 100644 --- a/ext/session/test_session.c +++ b/ext/session/test_session.c @@ -34,7 +34,7 @@ struct TestStreamInput { static int dbHandleFromObj(Tcl_Interp *interp, Tcl_Obj *pObj, sqlite3 **pDb){ Tcl_CmdInfo info; if( 0==Tcl_GetCommandInfo(interp, Tcl_GetString(pObj), &info) ){ - Tcl_AppendResult(interp, "no such handle: ", Tcl_GetString(pObj), 0); + Tcl_AppendResult(interp, "no such handle: ", Tcl_GetString(pObj), NULL); return TCL_ERROR; } @@ -130,7 +130,7 @@ static int SQLITE_TCLAPI test_sql_exec_changeset( rc = sql_exec_changeset(db, zSql, &nChangeset, &pChangeset); if( rc!=SQLITE_OK ){ Tcl_ResetResult(interp); - Tcl_AppendResult(interp, "error in sql_exec_changeset()", 0); + Tcl_AppendResult(interp, "error in sql_exec_changeset()", NULL); return TCL_ERROR; } @@ -166,7 +166,7 @@ static int test_session_error(Tcl_Interp *interp, int rc, char *zErr){ extern const char *sqlite3ErrName(int); Tcl_SetObjResult(interp, Tcl_NewStringObj(sqlite3ErrName(rc), -1)); if( zErr ){ - Tcl_AppendResult(interp, " - ", zErr, 0); + Tcl_AppendResult(interp, " - ", zErr, NULL); sqlite3_free(zErr); } return TCL_ERROR; @@ -435,7 +435,7 @@ static int SQLITE_TCLAPI test_sqlite3session( } if( 0==Tcl_GetCommandInfo(interp, Tcl_GetString(objv[2]), &info) ){ - Tcl_AppendResult(interp, "no such handle: ", Tcl_GetString(objv[2]), 0); + Tcl_AppendResult(interp, "no such handle: ", Tcl_GetString(objv[2]), NULL); return TCL_ERROR; } db = *(sqlite3 **)info.objClientData; @@ -832,7 +832,7 @@ static int SQLITE_TCLAPI testSqlite3changesetApply( return TCL_ERROR; } if( 0==Tcl_GetCommandInfo(interp, Tcl_GetString(objv[1]), &info) ){ - Tcl_AppendResult(interp, "no such handle: ", Tcl_GetString(objv[1]), 0); + Tcl_AppendResult(interp, "no such handle: ", Tcl_GetString(objv[1]), NULL); return TCL_ERROR; } db = *(sqlite3 **)info.objClientData; @@ -924,7 +924,7 @@ static int SQLITE_TCLAPI test_sqlite3changeset_apply_replace_all( return TCL_ERROR; } if( 0==Tcl_GetCommandInfo(interp, Tcl_GetString(objv[1]), &info) ){ - Tcl_AppendResult(interp, "no such handle: ", Tcl_GetString(objv[2]), 0); + Tcl_AppendResult(interp, "no such handle: ", Tcl_GetString(objv[2]), NULL); return TCL_ERROR; } db = *(sqlite3 **)info.objClientData; @@ -1551,7 +1551,7 @@ static int SQLITE_TCLAPI test_changegroup_cmd( TestChangeIter *pIter = 0; const char *zIter = Tcl_GetString(objv[2]); if( 0==Tcl_GetCommandInfo(interp, zIter, &cmdInfo) ){ - Tcl_AppendResult(interp, "no such iter: ", Tcl_GetString(objv[2]), 0); + Tcl_AppendResult(interp, "no such iter: ", Tcl_GetString(objv[2]), NULL); return TCL_ERROR; } diff --git a/manifest b/manifest index 7ffe563f07..c67c275604 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Additional\s'array\sindex\sis\ssigned\schar'\swarning\scleanups\sfor\sthe\sshell\sand\sits\sembedded\sextensions,\sanalog\sto\s[44bd44532d]. -D 2025-03-06T07:48:45.490 +C Cygwin-centric\sfixes\sfrom\sJan\sNijtmans. +D 2025-03-06T13:38:07.006 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -73,7 +73,7 @@ F ext/expert/expert.c d548d603a4cc9e61f446cc179c120c6713511c413f82a4a32b1e1e69d3 F ext/expert/expert1.test 1d2da6606623b57bb47064e02140823ce1daecd4cacbf402c73ad3473d7f000c F ext/expert/sqlite3expert.c cf4b1e5584862f486a4c6014ddb081831f1c512065dcf35644638d57179979d6 F ext/expert/sqlite3expert.h ca81efc2679a92373a13a3e76a6138d0310e32be53d6c3bfaedabd158ea8969b -F ext/expert/test_expert.c b767b2039a0df707eb3147e86bcf68b252d8455d9a41774b1a836cd052ceca70 +F ext/expert/test_expert.c c395134bd6d4efa594a7d26578a1cb624c4027b79b4b5fcd44736c5ef1f5f725 F ext/fts3/README.content b9078d0843a094d86af0d48dffbff13c906702b4c3558012e67b9c7cc3bf59ee F ext/fts3/README.syntax 6d0cbd8caa7ea34ecb0f0ae8278217180a8b7f24a1ea50ddf765383669f494a9 F ext/fts3/README.tokenizers b92bdeb8b46503f0dd301d364efc5ef59ef9fa8e2758b8e742f39fa93a2e422d @@ -89,7 +89,7 @@ F ext/fts3/fts3_icu.c 305ce7fb6036484085b5556a9c8e62acdc7763f0f4cdf5fd538212a9f3 F ext/fts3/fts3_porter.c 024417020c57dd1ab39816f5fe6cf45222a857b78a1f6412f040ada1ceabd4ff F ext/fts3/fts3_snippet.c ac402ba81ce9503a54238f975d870384f8b9fb3680f6b86eb7a1be44829a1cee F ext/fts3/fts3_term.c 6a96027ad364001432545fe43322b6af04ed28bb5619ec51af1f59d0710d6d69 -F ext/fts3/fts3_test.c 7a9cb3d61774134211bf4bfdf1adcb581a1a0377f2d050a121ae7ab44baef0e3 +F ext/fts3/fts3_test.c cc329471e573f95a6ea9fbca87e89dcfa1d355591c80172ffcd759ac521d25d8 F ext/fts3/fts3_tokenize_vtab.c 7fd9ef364f257b97218b9c331f2378e307375c592f70fd541f714e747d944962 F ext/fts3/fts3_tokenizer.c defede96b5dd5d658edfae77355b9c31ea65236eedc7bbe1adbc50d645cca5bc F ext/fts3/fts3_tokenizer.h 64c6ef6c5272c51ebe60fc607a896e84288fcbc3 @@ -506,7 +506,7 @@ F ext/rbu/rbuvacuum3.test 3ce42695fdf21aaa3499e857d7d4253bc499ad759bcd6c9362042c F ext/rbu/rbuvacuum4.test ffccd22f67e2d0b380d2889685742159dfe0d19a3880ca3d2d1d69eefaebb205 F ext/rbu/sqlite3rbu.c c208f72f20784bf2f39244b6cdf8019724a706e1246be289e7621c42aad54695 F ext/rbu/sqlite3rbu.h e3a5bf21e09ca93ce4e8740e00d6a853e90a697968ec0ea98f40826938bdb68e -F ext/rbu/test_rbu.c b9727c3394307d058e806c1da0f8bb7b24daf3c6bb94cb10cca88ea4d5c806c0 +F ext/rbu/test_rbu.c 8b6e64e486c28c41ef29f6f4ea6be7b3091958987812784904f5e903f6b56418 F ext/recover/dbdata.c 5295f4f922b60d7035b6b9fd5846b13071b9d97ed7fad8496837bb7640d24771 F ext/recover/recover1.test e16d78e94183562abff569967b18b7c77451d7044365516cd0fe14713a284851 F ext/recover/recover_common.tcl a61306c1eb45c0c3fc45652c35b2d4ec19729e340bdf65a272ce4c229cefd85a @@ -525,7 +525,7 @@ F ext/recover/recoverslowidx.test c90d59c46bb8924a973ac6fbc38f3163cee38cc240256a F ext/recover/recoversql.test e66d01f95302a223bcd3fd42b5ee58dc2b53d70afa90b0d00e41e4b8eab20486 F ext/recover/sqlite3recover.c 0ecdcb4df8967c84aa4dfe786816998bf2ef5cce55f4ac85ad4079e76f271027 F ext/recover/sqlite3recover.h 011c799f02deb70ab685916f6f538e6bb32c4e0025e79bfd0e24ff9c74820959 -F ext/recover/test_recover.c 072260d7452a3b81aba995b2b3269e7ec2aa7f06725544ba4c25b1b0a1dbc61a +F ext/recover/test_recover.c 3d0fb1df7823f5bc22a0b93955034d16a2dfa2eb1e443e9a0123a77f120599a3 F ext/repair/README.md 92f5e8aae749a4dae14f02eea8e1bb42d4db2b6ce5e83dbcdd6b1446997e0c15 F ext/repair/checkfreelist.c e21f06995ff4efdc1622dcceaea4dcba2caa83ca2f31a1607b98a8509168a996 F ext/repair/checkindex.c 7639b4f8928f82c10b950169e60cc45a7f6798df0b299771d17bef025736f657 @@ -617,7 +617,7 @@ F ext/session/sessionstat1.test 5e718d5888c0c49bbb33a7a4f816366db85f59f6a4f97544 F ext/session/sessionwor.test 6fd9a2256442cebde5b2284936ae9e0d54bde692d0f5fd009ecef8511f4cf3fc F ext/session/sqlite3session.c 8011b9531c7dd8dce55226def022f3303ce40d0b45966877f2c35185f4b1c3fc F ext/session/sqlite3session.h aa5de3ec8ef0e5313e9f65dafd69e8ba292d170f07b57da9200c040068dab061 -F ext/session/test_session.c 12e0a2c15fd60f92da4bb29c697c9177ff0c0dbcdc5129a54c47e999f147937a +F ext/session/test_session.c af162108e8dc40cb9fe0e876e0155cecabcb49e82e5939677d21451e36160283 F ext/wasm/EXPORTED_FUNCTIONS.fiddle.in 27450c8b8c70875a260aca55435ec927068b34cef801a96205adb81bdcefc65c F ext/wasm/GNUmakefile 24d7e6f446528fa67f5ade6c3c7d7e46e1ac52649d6264cbe24539c1dab608e1 F ext/wasm/README-dist.txt f01081a850ce38a56706af6b481e3a7878e24e42b314cfcd4b129f0f8427066a @@ -768,7 +768,7 @@ F src/os_kv.c 4d39e1f1c180b11162c6dc4aa8ad34053873a639bac6baae23272fc03349986a F src/os_setup.h 6011ad7af5db4e05155f385eb3a9b4470688de6f65d6166b8956e58a3d872107 F src/os_unix.c 410185df4900817c218c0efdb8064b3481af88cb3f7cea7392f820b6eebc7889 F src/os_win.c ab9912a2c1cb39a6429b8de919a5b63ad1c7775e511d748391c57bf9ad03bd29 -F src/os_win.h 7b073010f1451abe501be30d12f6bc599824944a +F src/os_win.h 4c247cdb6d407c75186c94a1e84d5a22cbae4adcec93fcae8d2bc1f956fd1f19 F src/pager.c 9fbb541b46125dfa8914827575e6bb4d15048caa008073b1709112d495d7983b F src/pager.h 6137149346e6c8a3ddc1eeb40aee46381e9bc8b0fcc6dda8a1efde993c2275b8 F src/parse.y e426d7323311554c75b0aebc426d0fe3c88d9777ffefed236f343ad9e661dc4c @@ -790,53 +790,53 @@ F src/sqliteInt.h 130217107c0425ab43d098c6eadf8aa2e1a037e26d79384127e2d950b27eec F src/sqliteLimit.h 6d817c28a8f19af95e6f4921933b7fbbca48a962bce0eb0ec81e8bb3ef38e68b F src/status.c 0e72e4f6be6ccfde2488eb63210297e75f569f3ce9920f6c3d77590ec6ce5ffd F src/table.c 0f141b58a16de7e2fbe81c308379e7279f4c6b50eb08efeec5892794a0ba30d1 -F src/tclsqlite.c 254e69d6b4bc185ca2a3b186a92bda186aec9038063ebb9247b9b3181d4b4d4f +F src/tclsqlite.c 5875b959c3262d93b32893540c40d4ebb111495adc80db3ee0ddd440966ddcd5 F src/tclsqlite.h 65e2c761446e1c9fa0342b7d2612a703483643c8b6a316d12a65b745a4727395 -F src/test1.c ba7b93478a6a7a3f48ec5507f28bc662636ac5d9f9791700d3648a8e788f0bb2 -F src/test2.c 7ebc518e6735939d8979273a6f7b1d9b5702babf059f6ad62499f7f60a9eb9a3 -F src/test3.c e7573aa0f78ee4e070a4bc8c3493941c1aa64d5c66d4825c74c0f055451f432b -F src/test4.c 13e57ae7ec7a959ee180970aef09deed141252fe9bb07c61054f0dfa4f1dfd5d -F src/test5.c bb87279ed12e199486894e6c83e58dc8cd1de9524ace171d59219d3ab696a0c1 -F src/test6.c 763b92489f11f4a77b773f0d3b8369ab0edd5292ac794043062c337019f12d8a +F src/test1.c 4e3dbca39c1728e45f8bf9aacb5a02290f84bf845af138337a83293ff6e228db +F src/test2.c 1659a6ac3798fdf950d5edb4b3ec621553e903eb0d3ec6ef3016cb8fcacee939 +F src/test3.c 4a151b3db6cf6623515ea0888b06f6ef322a77e2f9589aa227ab2ce56f59aa1e +F src/test4.c ba4656d94dc2a8ea0ca5dd30d9cfec2a3cc729ab46fb5468663a34d32ce7d2f1 +F src/test5.c 238495115aeee18b11e825064bb51f2c0378bc724d9f47b92cf87dedb711104f +F src/test6.c 3e489ba6855e08d2b33b5e80e490923712f4f17751e61e2d19e31ad8a2757a2f F src/test8.c 206d8f3cc73950d252906656e2646b5de0d580b07187b635fcb3edd8c2c5fbc0 -F src/test9.c 7a708ad27f8fda79113e5e15de66632710958c401e64c2f22bc04e2f5a7a1b62 +F src/test9.c df9ddc7db6ef1b8cf745866ee229090779728bcbe660c7f297d3127ab21d92af F src/test_autoext.c 14d4bbd3d0bd1eec0f6d16b29e28cf1e2d0b020d454835f0721a5f68121ac10f -F src/test_backup.c bd901e3c116c7f3b3bbbd4aae4ce87d99b400c9cbb0a9e7b4610af451d9719a7 +F src/test_backup.c a2bfd90d2ff2511b8635507bdb30fa9b605ade19c16b533066cae3077f5bdb72 F src/test_bestindex.c 3401bee51665cbf7f9ed2552b5795452a8b86365e4c9ece745b54155a55670c6 -F src/test_blob.c bcdf6a6c22d0bcc13c41479d63692ef413add2a4d30e1e26b9f74ab85b9fb4d5 +F src/test_blob.c 77b994e17f2c87055f44fd96c9a206c5a7155bae2cda2769af60c2f3582f962c F src/test_btree.c 28283787d32b8fa953eb77412ad0de2c9895260e4e5bd5a94b3c7411664f90d5 F src/test_config.c 7f412406592794636d6226268e26d413850a9f799bc5f3c01afc2820b165fca8 F src/test_delete.c e2fe07646dff6300b48d49b2fee2fe192ed389e834dd635e3b3bac0ce0bf9f8f F src/test_demovfs.c 3efa2adf4f21e10d95521721687d5ca047aea91fa62dd8cc22ac9e5a9c942383 F src/test_devsym.c 649434ed34d0b03fbd5a6b42df80f0f9a7e53f94dd1710aad5dd8831e91c4e86 -F src/test_fs.c c411c40baba679536fc34e2679349f59d8225570aed3488b5b3ef1908525a3d5 +F src/test_fs.c 6711fd4c6c05914b613cfc99918a24978452f999ce03fc8f89c9794c03b20a5b F src/test_func.c 858d4dddb7acf88222ebcba7cffb585f6dde83e4a15b838c0d05ccdf8d5219b9 -F src/test_hexio.c 7449504e4bde876ba91b202617a9228c7c8c2e7bd8b957302f3803ac0e9e353c +F src/test_hexio.c 3fa6b830863872a89ad0e175ea5dcc1ac29fedc257687bc27fb6a4f873e70d92 F src/test_init.c 17313332d58e90defc527129d5eda4a08bd6b6e8de7207a231523c8d98fb445e F src/test_intarray.c 3fcf8ca7bb5c8776ea83f6aa9b66f8df0d1f37a99207b0097c8486f9c15cedbf F src/test_intarray.h 6c3534641108cd1bea517a8e117dcba237081310a29a4c35bd2190caa8972293 F src/test_journal.c a0b9709b2f12b1ec819eea8a1176f283bca6d688a6d4a502bd6fd79786f4e287 F src/test_loadext.c 337056bae59f80b9eb00ba82088b39d0f4fe6dfd -F src/test_malloc.c 4954125ee89aa51d9f641d5cb272cc93ca4cb03dcc7c9c941d70210354c69567 +F src/test_malloc.c f1901a7a32fadff1978d6aca8e3bd2c6cc1e41b790ff19d369cc0367116a1828 F src/test_md5.c 811a45330c9391933360f998156a8907ee29909c828ab83ac05d329942cbea8f -F src/test_multiplex.c b99d7f43ec859e6b93a40aaa5455420b3ad133053cce3db739498d29ea30735f +F src/test_multiplex.c 82f0aa8eee629b6949782cfab8782ed35a9b56dc80d12877af52147f304d22b8 F src/test_multiplex.h f0ff5b6f4462bfd46dac165d6375b9530d08089b7bcbe75e88e0926110db5363 -F src/test_mutex.c f10fcbc2086b19c7b0ddf2752caf2095e42be74d8d7f6093619445b43b1f777b +F src/test_mutex.c dacae6790956c0d4e705aaed2090227792e291b0496cccd688e9994c1e21f740 F src/test_onefile.c f31e52e891c5fef6709b9fcef54ce660648a34172423a9cbdf4cbce3ba0049f4 -F src/test_osinst.c 7aa3feaa3a1da1b5f75bde2ce958dbfe14ec484f065bb2b5b9727d8851fa089b +F src/test_osinst.c 269039d9c0820a02ee928014c30860d57ee757ecda54df42e463d0ca1377b835 F src/test_pcache.c 496da3f7e2ca66aefbc36bbf22138b1eff43ba0dff175c228b760fa020a37bd0 -F src/test_quota.c 744552848d9c5c5de3920d1c44b03d425a4123a223310567a199c7e0d3fe80bf +F src/test_quota.c 180e87437250bed7e17e4e61c106730939e39fec9be73d28961f27f579a92078 F src/test_quota.h 2a8ad1952d1d2ca9af0ce0465e56e6c023b5e15d F src/test_rtree.c d844d746a3cc027247318b970025a927f14772339c991f40e7911583ea5ed0d9 F src/test_schema.c b06d3ddc3edc173c143878f3edb869dd200d57d918ae2f38820534f9a5e3d7d9 -F src/test_sqllog.c 540feaea7280cd5f926168aee9deb1065ae136d0bbbe7361e2ef3541783e187a -F src/test_superlock.c 18355ca274746aa6909e3744163e5deb1196a85d5bc64b9cd377273cef626da7 -F src/test_syscall.c 9ad7ab39910c16d29411678d91b0d27a7a996a718df5ee93dcd635e846d0275c +F src/test_sqllog.c 5abf04865758c0a3915b4ec2b2ee5ab75f74c00e2f05bf503b9083e0ab6829d7 +F src/test_superlock.c 3387fc794a68d8c6b6ed059aabacbfe870dc502c5cf65562f36aac78b4a4d629 +F src/test_syscall.c c5bf039261973135068aa68f4d185a6147333dcf266977989f8245b3a1968f1b F src/test_tclsh.c c01706ac60bd3176754d3ccd37da74c6ad97c2e14489f8ed71b497c1c0ac0dd4 F src/test_tclvar.c ae873248a0188459b1c16ca7cc431265dacce524399e8b46725c2b3b7e048424 -F src/test_thread.c d7a8bcea7445f37cc2a1f7f81dd6059634f45e0c61bfe80182b02872fb0328bb +F src/test_thread.c 3edb4a5b5aeb1a6e9a275dccc848ac95acab7f496b3e9230f6d2d04953a2b862 F src/test_vdbecov.c 5c426d9cd2b351f5f9ceb30cabf8c64a63bfcad644c507e0bd9ce2f6ae1a3bf3 -F src/test_vfs.c a19728c5930b5f5f415c664c57b029cba98c459fe70639aefcbfc4f70d544335 +F src/test_vfs.c 0280aa8ada70e8b23b258e28afb1d49b8228b057fbae0bcde11db099b790b318 F src/test_windirent.c a895e2c068a06644eef91a7f0a32182445a893b9a0f33d0cdb4283dca2486ac1 F src/test_windirent.h da2e5b73c32d09905fbdd00f27cd802212a32a58ead882736fe4f5eb775ebc50 F src/test_window.c 6d80e11fba89a1796525e6f0048ff0c7789aa2c6b0b11c80827dc1437bd8ea72 @@ -2213,8 +2213,11 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 646c2821ad434058db7760e699d21a47c7feb5976199cbe4b58d54c902720cbf -R 67dd6bb095c5f2b086dad74a4db7fec9 +P f31042595b8f8a378db9778c9a8223b07ec02cf2f528581ba43bf72b5b03c964 +R e2636937135f5b30145a26001dbda091 +T *branch * cygwin-fixes +T *sym-cygwin-fixes * +T -sym-trunk * U stephan -Z e25cfbe93e0978fd4ecc97c073e66d34 +Z a07a11eb75fd35bca8f25a9808dd0343 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 518f8878dc..c2a7b0c1e2 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -f31042595b8f8a378db9778c9a8223b07ec02cf2f528581ba43bf72b5b03c964 +205979813c7300debb5f1ba270583ef2f08e069d6d01865b5910702889a5c1ed diff --git a/src/os_win.h b/src/os_win.h index 27714ed079..a0845f0038 100644 --- a/src/os_win.h +++ b/src/os_win.h @@ -22,6 +22,8 @@ #ifdef __CYGWIN__ # include +# include /* amalgamator: dontcache */ +# include /* amalgamator: dontcache */ # include /* amalgamator: dontcache */ #endif diff --git a/src/tclsqlite.c b/src/tclsqlite.c index c619ffca4b..dfc2ecfb4e 100644 --- a/src/tclsqlite.c +++ b/src/tclsqlite.c @@ -76,7 +76,9 @@ # define SQLITE_PTRSIZE 8 # endif # endif /* SQLITE_PTRSIZE */ -# if defined(HAVE_STDINT_H) +# if defined(HAVE_STDINT_H) || (defined(__STDC_VERSION__) && \ + (__STDC_VERSION__ >= 199901L)) +# include typedef uintptr_t uptr; # elif SQLITE_PTRSIZE==4 typedef unsigned int uptr; diff --git a/src/test1.c b/src/test1.c index e45a05fe47..ac3070886e 100644 --- a/src/test1.c +++ b/src/test1.c @@ -102,7 +102,7 @@ static int SQLITE_TCLAPI get_sqlite_pointer( } p = (struct SqliteDb*)cmdInfo.objClientData; sqlite3_snprintf(sizeof(zBuf), zBuf, "%p", p->db); - Tcl_AppendResult(interp, zBuf, 0); + Tcl_AppendResult(interp, zBuf, NULL); return TCL_OK; } @@ -153,7 +153,7 @@ int sqlite3TestErrCode(Tcl_Interp *interp, sqlite3 *db, int rc){ "error code %s (%d) does not match sqlite3_errcode %s (%d)", t1ErrorName(rc), rc, t1ErrorName(r2), r2); Tcl_ResetResult(interp); - Tcl_AppendResult(interp, zBuf, 0); + Tcl_AppendResult(interp, zBuf, NULL); return 1; } return 0; @@ -504,7 +504,7 @@ static int SQLITE_TCLAPI test_mprintf_z( for(i=2; isizeof(zStr) ) n = sizeof(zStr); sqlite3_snprintf(sizeof(zStr), zStr, "abcdefghijklmnopqrstuvwxyz"); sqlite3_snprintf(n, zStr, zFormat, a1); - Tcl_AppendResult(interp, zStr, 0); + Tcl_AppendResult(interp, zStr, NULL); return TCL_OK; } @@ -639,12 +639,12 @@ static int SQLITE_TCLAPI test_last_rowid( char zBuf[30]; if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " DB\"", 0); + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " DB\"", NULL); return TCL_ERROR; } if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR; sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", sqlite3_last_insert_rowid(db)); - Tcl_AppendResult(interp, zBuf, 0); + Tcl_AppendResult(interp, zBuf, NULL); return SQLITE_OK; } @@ -1385,7 +1385,7 @@ static int SQLITE_TCLAPI sqlite3_mprintf_int( if( Tcl_GetInt(interp, argv[i], &a[i-2]) ) return TCL_ERROR; } z = sqlite3_mprintf(argv[1], a[0], a[1], a[2]); - Tcl_AppendResult(interp, z, 0); + Tcl_AppendResult(interp, z, NULL); sqlite3_free(z); return TCL_OK; } @@ -1411,12 +1411,12 @@ static int SQLITE_TCLAPI sqlite3_mprintf_int64( } for(i=2; i<5; i++){ if( sqlite3Atoi64(argv[i], &a[i-2], sqlite3Strlen30(argv[i]), SQLITE_UTF8) ){ - Tcl_AppendResult(interp, "argument is not a valid 64-bit integer", 0); + Tcl_AppendResult(interp, "argument is not a valid 64-bit integer", NULL); return TCL_ERROR; } } z = sqlite3_mprintf(argv[1], a[0], a[1], a[2]); - Tcl_AppendResult(interp, z, 0); + Tcl_AppendResult(interp, z, NULL); sqlite3_free(z); return TCL_OK; } @@ -1449,7 +1449,7 @@ static int SQLITE_TCLAPI sqlite3_mprintf_long( a[i-2] &= (((u64)1)<<(sizeof(int)*8))-1; } z = sqlite3_mprintf(argv[1], a[0], a[1], a[2]); - Tcl_AppendResult(interp, z, 0); + Tcl_AppendResult(interp, z, NULL); sqlite3_free(z); return TCL_OK; } @@ -1476,7 +1476,7 @@ static int SQLITE_TCLAPI sqlite3_mprintf_str( if( Tcl_GetInt(interp, argv[i], &a[i-2]) ) return TCL_ERROR; } z = sqlite3_mprintf(argv[1], a[0], a[1], argc>4 ? argv[4] : NULL); - Tcl_AppendResult(interp, z, 0); + Tcl_AppendResult(interp, z, NULL); sqlite3_free(z); return TCL_OK; } @@ -1502,7 +1502,7 @@ static int SQLITE_TCLAPI sqlite3_snprintf_str( } if( Tcl_GetInt(interp, argv[1], &n) ) return TCL_ERROR; if( n<0 ){ - Tcl_AppendResult(interp, "N must be non-negative", 0); + Tcl_AppendResult(interp, "N must be non-negative", NULL); return TCL_ERROR; } for(i=3; i<5; i++){ @@ -1510,7 +1510,7 @@ static int SQLITE_TCLAPI sqlite3_snprintf_str( } z = sqlite3_malloc( n+1 ); sqlite3_snprintf(n, z, argv[2], a[0], a[1], argc>4 ? argv[5] : NULL); - Tcl_AppendResult(interp, z, 0); + Tcl_AppendResult(interp, z, NULL); sqlite3_free(z); return TCL_OK; } @@ -1539,7 +1539,7 @@ static int SQLITE_TCLAPI sqlite3_mprintf_double( } if( Tcl_GetDouble(interp, argv[4], &r) ) return TCL_ERROR; z = sqlite3_mprintf(argv[1], a[0], a[1], r); - Tcl_AppendResult(interp, z, 0); + Tcl_AppendResult(interp, z, NULL); sqlite3_free(z); return TCL_OK; } @@ -1569,7 +1569,7 @@ static int SQLITE_TCLAPI sqlite3_mprintf_scaled( if( Tcl_GetDouble(interp, argv[i], &r[i-2]) ) return TCL_ERROR; } z = sqlite3_mprintf(argv[1], r[0]*r[1]); - Tcl_AppendResult(interp, z, 0); + Tcl_AppendResult(interp, z, NULL); sqlite3_free(z); return TCL_OK; } @@ -1594,7 +1594,7 @@ static int SQLITE_TCLAPI sqlite3_mprintf_stronly( return TCL_ERROR; } z = sqlite3_mprintf(argv[1], argv[2]); - Tcl_AppendResult(interp, z, 0); + Tcl_AppendResult(interp, z, NULL); sqlite3_free(z); return TCL_OK; } @@ -1621,14 +1621,14 @@ static int SQLITE_TCLAPI sqlite3_mprintf_hexdouble( return TCL_ERROR; } if( sscanf(argv[2], "%08x%08x", &x2, &x1)!=2 ){ - Tcl_AppendResult(interp, "2nd argument should be 16-characters of hex", 0); + Tcl_AppendResult(interp, "2nd argument should be 16-characters of hex", NULL); return TCL_ERROR; } d = x2; d = (d<<32) + x1; memcpy(&r, &d, sizeof(r)); z = sqlite3_mprintf(argv[1], r); - Tcl_AppendResult(interp, z, 0); + Tcl_AppendResult(interp, z, NULL); sqlite3_free(z); return TCL_OK; } @@ -1746,7 +1746,7 @@ static int SQLITE_TCLAPI test_table_column_metadata( &zDatatype, &zCollseq, ¬null, &primarykey, &autoincrement); if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, sqlite3_errmsg(db), 0); + Tcl_AppendResult(interp, sqlite3_errmsg(db), NULL); return TCL_ERROR; } @@ -2023,7 +2023,7 @@ static int SQLITE_TCLAPI test_create_function_v2( ); if( rc!=SQLITE_OK ){ Tcl_ResetResult(interp); - Tcl_AppendResult(interp, sqlite3ErrName(rc), 0); + Tcl_AppendResult(interp, sqlite3ErrName(rc), NULL); return TCL_ERROR; } return TCL_OK; @@ -2212,7 +2212,7 @@ static int SQLITE_TCLAPI test_register_func( rc = sqlite3_create_function(db, argv[2], -1, SQLITE_UTF8, 0, testFunc, 0, 0); if( rc!=0 ){ - Tcl_AppendResult(interp, sqlite3ErrStr(rc), 0); + Tcl_AppendResult(interp, sqlite3ErrStr(rc), NULL); return TCL_ERROR; } if( sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR; @@ -2773,7 +2773,7 @@ static int SQLITE_TCLAPI test_snapshot_open_blob( zName = Tcl_GetString(objv[2]); pBlob = Tcl_GetByteArrayFromObj(objv[3], &nBlob); if( nBlob!=sizeof(sqlite3_snapshot) ){ - Tcl_AppendResult(interp, "bad SNAPSHOT", 0); + Tcl_AppendResult(interp, "bad SNAPSHOT", NULL); return TCL_ERROR; } rc = sqlite3_snapshot_open(db, zName, (sqlite3_snapshot*)pBlob); @@ -2810,7 +2810,7 @@ static int SQLITE_TCLAPI test_snapshot_cmp_blob( p2 = Tcl_GetByteArrayFromObj(objv[2], &n2); if( n1!=sizeof(sqlite3_snapshot) || n1!=n2 ){ - Tcl_AppendResult(interp, "bad SNAPSHOT", 0); + Tcl_AppendResult(interp, "bad SNAPSHOT", NULL); return TCL_ERROR; } @@ -2867,7 +2867,7 @@ static int SQLITE_TCLAPI test_atomic_batch_write( rc = sqlite3_open(zFile, &db); if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, sqlite3_errmsg(db), 0); + Tcl_AppendResult(interp, sqlite3_errmsg(db), NULL); sqlite3_close(db); return TCL_ERROR; } @@ -2909,7 +2909,7 @@ static int SQLITE_TCLAPI test_next_stmt( pStmt = sqlite3_next_stmt(db, pStmt); if( pStmt ){ if( sqlite3TestMakePointerStr(interp, zBuf, pStmt) ) return TCL_ERROR; - Tcl_AppendResult(interp, zBuf, 0); + Tcl_AppendResult(interp, zBuf, NULL); } return TCL_OK; } @@ -3211,7 +3211,7 @@ static int SQLITE_TCLAPI test_bind( if( rc ){ char zBuf[50]; sqlite3_snprintf(sizeof(zBuf), zBuf, "(%d) ", rc); - Tcl_AppendResult(interp, zBuf, sqlite3ErrStr(rc), 0); + Tcl_AppendResult(interp, zBuf, sqlite3ErrStr(rc), NULL); return TCL_ERROR; } return TCL_OK; @@ -3343,7 +3343,7 @@ static int SQLITE_TCLAPI test_collate( if( sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR; if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, sqlite3ErrName(rc), 0); + Tcl_AppendResult(interp, sqlite3ErrName(rc), NULL); return TCL_ERROR; } return TCL_OK; @@ -3750,7 +3750,7 @@ static int SQLITE_TCLAPI test_bind_zeroblob64( rc = sqlite3_bind_zeroblob64(pStmt, idx, n); if( sqlite3TestErrCode(interp, StmtToDb(pStmt), rc) ) return TCL_ERROR; if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, sqlite3ErrName(rc), 0); + Tcl_AppendResult(interp, sqlite3ErrName(rc), NULL); return TCL_ERROR; } @@ -4189,7 +4189,7 @@ static int SQLITE_TCLAPI test_bind_text16( free(toFree); if( sqlite3TestErrCode(interp, StmtToDb(pStmt), rc) ) return TCL_ERROR; if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, sqlite3ErrName(rc), 0); + Tcl_AppendResult(interp, sqlite3ErrName(rc), NULL); return TCL_ERROR; } @@ -4723,7 +4723,7 @@ static int SQLITE_TCLAPI test_ex_errcode( } if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR; rc = sqlite3_extended_errcode(db); - Tcl_AppendResult(interp, (char *)t1ErrorName(rc), 0); + Tcl_AppendResult(interp, (char *)t1ErrorName(rc), NULL); return TCL_OK; } @@ -4750,7 +4750,7 @@ static int SQLITE_TCLAPI test_errcode( } if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR; rc = sqlite3_errcode(db); - Tcl_AppendResult(interp, (char *)t1ErrorName(rc), 0); + Tcl_AppendResult(interp, (char *)t1ErrorName(rc), NULL); return TCL_OK; } @@ -4892,13 +4892,13 @@ static int SQLITE_TCLAPI test_prepare( if( rc!=SQLITE_OK ){ assert( pStmt==0 ); sqlite3_snprintf(sizeof(zBuf), zBuf, "(%d) ", rc); - Tcl_AppendResult(interp, zBuf, sqlite3_errmsg(db), 0); + Tcl_AppendResult(interp, zBuf, sqlite3_errmsg(db), NULL); return TCL_ERROR; } if( pStmt ){ if( sqlite3TestMakePointerStr(interp, zBuf, pStmt) ) return TCL_ERROR; - Tcl_AppendResult(interp, zBuf, 0); + Tcl_AppendResult(interp, zBuf, NULL); } return TCL_OK; } @@ -4966,13 +4966,13 @@ static int SQLITE_TCLAPI test_prepare_v2( if( rc!=SQLITE_OK ){ assert( pStmt==0 ); sqlite3_snprintf(sizeof(zBuf), zBuf, "(%d) ", rc); - Tcl_AppendResult(interp, zBuf, sqlite3_errmsg(db), 0); + Tcl_AppendResult(interp, zBuf, sqlite3_errmsg(db), NULL); return TCL_ERROR; } if( pStmt ){ if( sqlite3TestMakePointerStr(interp, zBuf, pStmt) ) return TCL_ERROR; - Tcl_AppendResult(interp, zBuf, 0); + Tcl_AppendResult(interp, zBuf, NULL); } return TCL_OK; } @@ -5039,13 +5039,13 @@ static int SQLITE_TCLAPI test_prepare_v3( if( rc!=SQLITE_OK ){ assert( pStmt==0 ); sqlite3_snprintf(sizeof(zBuf), zBuf, "(%d) ", rc); - Tcl_AppendResult(interp, zBuf, sqlite3_errmsg(db), 0); + Tcl_AppendResult(interp, zBuf, sqlite3_errmsg(db), NULL); return TCL_ERROR; } if( pStmt ){ if( sqlite3TestMakePointerStr(interp, zBuf, pStmt) ) return TCL_ERROR; - Tcl_AppendResult(interp, zBuf, 0); + Tcl_AppendResult(interp, zBuf, NULL); } return TCL_OK; } @@ -5080,13 +5080,13 @@ static int SQLITE_TCLAPI test_prepare_tkt3134( if( rc!=SQLITE_OK ){ assert( pStmt==0 ); sqlite3_snprintf(sizeof(zBuf), zBuf, "(%d) ", rc); - Tcl_AppendResult(interp, zBuf, sqlite3_errmsg(db), 0); + Tcl_AppendResult(interp, zBuf, sqlite3_errmsg(db), NULL); return TCL_ERROR; } if( pStmt ){ if( sqlite3TestMakePointerStr(interp, zBuf, pStmt) ) return TCL_ERROR; - Tcl_AppendResult(interp, zBuf, 0); + Tcl_AppendResult(interp, zBuf, NULL); } return TCL_OK; } @@ -5146,7 +5146,7 @@ static int SQLITE_TCLAPI test_prepare16( if( pStmt ){ if( sqlite3TestMakePointerStr(interp, zBuf, pStmt) ) return TCL_ERROR; } - Tcl_AppendResult(interp, zBuf, 0); + Tcl_AppendResult(interp, zBuf, NULL); #endif /* SQLITE_OMIT_UTF16 */ return TCL_OK; } @@ -5206,7 +5206,7 @@ static int SQLITE_TCLAPI test_prepare16_v2( if( pStmt ){ if( sqlite3TestMakePointerStr(interp, zBuf, pStmt) ) return TCL_ERROR; } - Tcl_AppendResult(interp, zBuf, 0); + Tcl_AppendResult(interp, zBuf, NULL); #endif /* SQLITE_OMIT_UTF16 */ return TCL_OK; } @@ -5234,7 +5234,7 @@ static int SQLITE_TCLAPI test_open( sqlite3_open(zFilename, &db); if( sqlite3TestMakePointerStr(interp, zBuf, db) ) return TCL_ERROR; - Tcl_AppendResult(interp, zBuf, 0); + Tcl_AppendResult(interp, zBuf, NULL); return TCL_OK; } @@ -5305,7 +5305,7 @@ static int SQLITE_TCLAPI test_open_v2( rc = sqlite3_open_v2(zFilename, &db, flags, zVfs); if( sqlite3TestMakePointerStr(interp, zBuf, db) ) return TCL_ERROR; - Tcl_AppendResult(interp, zBuf, 0); + Tcl_AppendResult(interp, zBuf, NULL); return TCL_OK; } @@ -5333,7 +5333,7 @@ static int SQLITE_TCLAPI test_open16( sqlite3_open16(zFilename, &db); if( sqlite3TestMakePointerStr(interp, zBuf, db) ) return TCL_ERROR; - Tcl_AppendResult(interp, zBuf, 0); + Tcl_AppendResult(interp, zBuf, NULL); #endif /* SQLITE_OMIT_UTF16 */ return TCL_OK; } @@ -5811,7 +5811,7 @@ static int SQLITE_TCLAPI test_interrupt( ){ sqlite3 *db; if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " DB", 0); + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " DB", NULL); return TCL_ERROR; } if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR; @@ -5833,7 +5833,7 @@ static int SQLITE_TCLAPI test_is_interrupted( sqlite3 *db; int rc; if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " DB", 0); + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " DB", NULL); return TCL_ERROR; } if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR; @@ -5915,7 +5915,7 @@ static int SQLITE_TCLAPI get_autocommit( } if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR; sqlite3_snprintf(sizeof(zBuf), zBuf, "%d", sqlite3_get_autocommit(db)); - Tcl_AppendResult(interp, zBuf, 0); + Tcl_AppendResult(interp, zBuf, NULL); return TCL_OK; } @@ -5942,7 +5942,7 @@ static int SQLITE_TCLAPI test_busy_timeout( if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR; if( Tcl_GetInt(interp, argv[2], &ms) ) return TCL_ERROR; rc = sqlite3_busy_timeout(db, ms); - Tcl_AppendResult(interp, sqlite3ErrName(rc), 0); + Tcl_AppendResult(interp, sqlite3ErrName(rc), NULL); return TCL_OK; } @@ -5978,7 +5978,7 @@ static int SQLITE_TCLAPI test_setlk_timeout( rc = sqlite3_setlk_timeout( db, ms, (bBlockOnConnect ? SQLITE_SETLK_BLOCK_ON_CONNECT : 0) ); - Tcl_AppendResult(interp, sqlite3ErrName(rc), 0); + Tcl_AppendResult(interp, sqlite3ErrName(rc), NULL); return TCL_OK; } @@ -7543,7 +7543,7 @@ static int SQLITE_TCLAPI test_wal_checkpoint_v2( if( rc!=SQLITE_OK && rc!=SQLITE_BUSY ){ const char *zErrCode = sqlite3ErrName(rc); Tcl_ResetResult(interp); - Tcl_AppendResult(interp, zErrCode, " - ", (char *)sqlite3_errmsg(db), 0); + Tcl_AppendResult(interp, zErrCode, " - ", (char *)sqlite3_errmsg(db), NULL); return TCL_ERROR; } @@ -8017,7 +8017,7 @@ static void SQLITE_CDECL win32_file_locker(void *pAppData){ } #endif -#if SQLITE_OS_WIN +#ifdef _WIN32 /* ** lock_win32_file FILENAME DELAY1 DELAY2 ** @@ -8826,7 +8826,7 @@ static int SQLITE_TCLAPI guess_number_of_cores( Tcl_Obj *CONST objv[] ){ unsigned int nCore = 1; -#if SQLITE_OS_WIN +#ifdef _WIN32 SYSTEM_INFO sysinfo; GetSystemInfo(&sysinfo); nCore = (unsigned int)sysinfo.dwNumberOfProcessors; @@ -9006,7 +9006,7 @@ int Sqlitetest1_Init(Tcl_Interp *interp){ { "database_never_corrupt", database_never_corrupt, 0}, { "database_may_be_corrupt", database_may_be_corrupt, 0}, { "optimization_control", optimization_control,0}, -#if SQLITE_OS_WIN +#ifdef _WIN32 { "lock_win32_file", win32_file_lock, 0 }, #endif { "tcl_objproc", runAsObjProc, 0 }, diff --git a/src/test2.c b/src/test2.c index a9549aa7f5..07b3b7d901 100644 --- a/src/test2.c +++ b/src/test2.c @@ -59,14 +59,14 @@ static int SQLITE_TCLAPI pager_open( SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_MAIN_DB, pager_test_reiniter); if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, sqlite3ErrName(rc), 0); + Tcl_AppendResult(interp, sqlite3ErrName(rc), NULL); return TCL_ERROR; } sqlite3PagerSetCachesize(pPager, nPage); pageSize = test_pagesize; sqlite3PagerSetPagesize(pPager, &pageSize, -1); sqlite3_snprintf(sizeof(zBuf),zBuf,"%p",pPager); - Tcl_AppendResult(interp, zBuf, 0); + Tcl_AppendResult(interp, zBuf, NULL); return TCL_OK; } @@ -91,7 +91,7 @@ static int SQLITE_TCLAPI pager_close( pPager = sqlite3TestTextToPtr(argv[1]); rc = sqlite3PagerClose(pPager, 0); if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, sqlite3ErrName(rc), 0); + Tcl_AppendResult(interp, sqlite3ErrName(rc), NULL); return TCL_ERROR; } return TCL_OK; @@ -118,7 +118,7 @@ static int SQLITE_TCLAPI pager_rollback( pPager = sqlite3TestTextToPtr(argv[1]); rc = sqlite3PagerRollback(pPager); if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, sqlite3ErrName(rc), 0); + Tcl_AppendResult(interp, sqlite3ErrName(rc), NULL); return TCL_ERROR; } return TCL_OK; @@ -145,12 +145,12 @@ static int SQLITE_TCLAPI pager_commit( pPager = sqlite3TestTextToPtr(argv[1]); rc = sqlite3PagerCommitPhaseOne(pPager, 0, 0); if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, sqlite3ErrName(rc), 0); + Tcl_AppendResult(interp, sqlite3ErrName(rc), NULL); return TCL_ERROR; } rc = sqlite3PagerCommitPhaseTwo(pPager); if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, sqlite3ErrName(rc), 0); + Tcl_AppendResult(interp, sqlite3ErrName(rc), NULL); return TCL_ERROR; } return TCL_OK; @@ -177,7 +177,7 @@ static int SQLITE_TCLAPI pager_stmt_begin( pPager = sqlite3TestTextToPtr(argv[1]); rc = sqlite3PagerOpenSavepoint(pPager, 1); if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, sqlite3ErrName(rc), 0); + Tcl_AppendResult(interp, sqlite3ErrName(rc), NULL); return TCL_ERROR; } return TCL_OK; @@ -205,7 +205,7 @@ static int SQLITE_TCLAPI pager_stmt_rollback( rc = sqlite3PagerSavepoint(pPager, SAVEPOINT_ROLLBACK, 0); sqlite3PagerSavepoint(pPager, SAVEPOINT_RELEASE, 0); if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, sqlite3ErrName(rc), 0); + Tcl_AppendResult(interp, sqlite3ErrName(rc), NULL); return TCL_ERROR; } return TCL_OK; @@ -232,7 +232,7 @@ static int SQLITE_TCLAPI pager_stmt_commit( pPager = sqlite3TestTextToPtr(argv[1]); rc = sqlite3PagerSavepoint(pPager, SAVEPOINT_RELEASE, 0); if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, sqlite3ErrName(rc), 0); + Tcl_AppendResult(interp, sqlite3ErrName(rc), NULL); return TCL_ERROR; } return TCL_OK; @@ -293,7 +293,7 @@ static int SQLITE_TCLAPI pager_pagecount( pPager = sqlite3TestTextToPtr(argv[1]); sqlite3PagerPagecount(pPager, &nPage); sqlite3_snprintf(sizeof(zBuf), zBuf, "%d", nPage); - Tcl_AppendResult(interp, zBuf, 0); + Tcl_AppendResult(interp, zBuf, NULL); return TCL_OK; } @@ -325,11 +325,11 @@ static int SQLITE_TCLAPI page_get( rc = sqlite3PagerGet(pPager, pgno, &pPage, 0); } if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, sqlite3ErrName(rc), 0); + Tcl_AppendResult(interp, sqlite3ErrName(rc), NULL); return TCL_ERROR; } sqlite3_snprintf(sizeof(zBuf),zBuf,"%p",pPage); - Tcl_AppendResult(interp, zBuf, 0); + Tcl_AppendResult(interp, zBuf, NULL); return TCL_OK; } @@ -359,7 +359,7 @@ static int SQLITE_TCLAPI page_lookup( pPage = sqlite3PagerLookup(pPager, pgno); if( pPage ){ sqlite3_snprintf(sizeof(zBuf),zBuf,"%p",pPage); - Tcl_AppendResult(interp, zBuf, 0); + Tcl_AppendResult(interp, zBuf, NULL); } return TCL_OK; } @@ -429,7 +429,7 @@ static int SQLITE_TCLAPI page_read( } pPage = sqlite3TestTextToPtr(argv[1]); memcpy(zBuf, sqlite3PagerGetData(pPage), sizeof(zBuf)); - Tcl_AppendResult(interp, zBuf, 0); + Tcl_AppendResult(interp, zBuf, NULL); return TCL_OK; } @@ -453,7 +453,7 @@ static int SQLITE_TCLAPI page_number( } pPage = (DbPage *)sqlite3TestTextToPtr(argv[1]); sqlite3_snprintf(sizeof(zBuf), zBuf, "%d", sqlite3PagerPagenumber(pPage)); - Tcl_AppendResult(interp, zBuf, 0); + Tcl_AppendResult(interp, zBuf, NULL); return TCL_OK; } @@ -479,7 +479,7 @@ static int SQLITE_TCLAPI page_write( pPage = (DbPage *)sqlite3TestTextToPtr(argv[1]); rc = sqlite3PagerWrite(pPage); if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, sqlite3ErrName(rc), 0); + Tcl_AppendResult(interp, sqlite3ErrName(rc), NULL); return TCL_ERROR; } pData = sqlite3PagerGetData(pPage); @@ -536,7 +536,7 @@ static int SQLITE_TCLAPI fake_big_file( (SQLITE_OPEN_CREATE|SQLITE_OPEN_READWRITE|SQLITE_OPEN_MAIN_DB), 0 ); if( rc ){ - Tcl_AppendResult(interp, "open failed: ", sqlite3ErrName(rc), 0); + Tcl_AppendResult(interp, "open failed: ", sqlite3ErrName(rc), NULL); sqlite3_free(zFile); return TCL_ERROR; } @@ -546,7 +546,7 @@ static int SQLITE_TCLAPI fake_big_file( sqlite3OsCloseFree(fd); sqlite3_free(zFile); if( rc ){ - Tcl_AppendResult(interp, "write failed: ", sqlite3ErrName(rc), 0); + Tcl_AppendResult(interp, "write failed: ", sqlite3ErrName(rc), NULL); return TCL_ERROR; } return TCL_OK; diff --git a/src/test3.c b/src/test3.c index f1b2b01680..fade30149a 100644 --- a/src/test3.c +++ b/src/test3.c @@ -65,12 +65,12 @@ static int SQLITE_TCLAPI btree_open( SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_MAIN_DB); sqlite3_free(zFilename); if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, sqlite3ErrName(rc), 0); + Tcl_AppendResult(interp, sqlite3ErrName(rc), NULL); return TCL_ERROR; } sqlite3BtreeSetCacheSize(pBt, nCache); sqlite3_snprintf(sizeof(zBuf), zBuf,"%p", pBt); - Tcl_AppendResult(interp, zBuf, 0); + Tcl_AppendResult(interp, zBuf, NULL); return TCL_OK; } @@ -95,7 +95,7 @@ static int SQLITE_TCLAPI btree_close( pBt = sqlite3TestTextToPtr(argv[1]); rc = sqlite3BtreeClose(pBt); if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, sqlite3ErrName(rc), 0); + Tcl_AppendResult(interp, sqlite3ErrName(rc), NULL); return TCL_ERROR; } nRefSqlite3--; @@ -132,7 +132,7 @@ static int SQLITE_TCLAPI btree_begin_transaction( rc = sqlite3BtreeBeginTrans(pBt, 1, 0); sqlite3BtreeLeave(pBt); if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, sqlite3ErrName(rc), 0); + Tcl_AppendResult(interp, sqlite3ErrName(rc), NULL); return TCL_ERROR; } return TCL_OK; @@ -229,11 +229,11 @@ static int SQLITE_TCLAPI btree_cursor( sqlite3_mutex_leave(pBt->db->mutex); if( rc ){ ckfree((char *)pCur); - Tcl_AppendResult(interp, sqlite3ErrName(rc), 0); + Tcl_AppendResult(interp, sqlite3ErrName(rc), NULL); return TCL_ERROR; } sqlite3_snprintf(sizeof(zBuf), zBuf,"%p", pCur); - Tcl_AppendResult(interp, zBuf, 0); + Tcl_AppendResult(interp, zBuf, NULL); return SQLITE_OK; } @@ -271,7 +271,7 @@ static int SQLITE_TCLAPI btree_close_cursor( #endif ckfree((char *)pCur); if( rc ){ - Tcl_AppendResult(interp, sqlite3ErrName(rc), 0); + Tcl_AppendResult(interp, sqlite3ErrName(rc), NULL); return TCL_ERROR; } return SQLITE_OK; @@ -309,11 +309,11 @@ static int SQLITE_TCLAPI btree_next( } sqlite3BtreeLeave(pCur->pBtree); if( rc ){ - Tcl_AppendResult(interp, sqlite3ErrName(rc), 0); + Tcl_AppendResult(interp, sqlite3ErrName(rc), NULL); return TCL_ERROR; } sqlite3_snprintf(sizeof(zBuf),zBuf,"%d",res); - Tcl_AppendResult(interp, zBuf, 0); + Tcl_AppendResult(interp, zBuf, NULL); return SQLITE_OK; } @@ -344,11 +344,11 @@ static int SQLITE_TCLAPI btree_first( rc = sqlite3BtreeFirst(pCur, &res); sqlite3BtreeLeave(pCur->pBtree); if( rc ){ - Tcl_AppendResult(interp, sqlite3ErrName(rc), 0); + Tcl_AppendResult(interp, sqlite3ErrName(rc), NULL); return TCL_ERROR; } sqlite3_snprintf(sizeof(zBuf),zBuf,"%d",res); - Tcl_AppendResult(interp, zBuf, 0); + Tcl_AppendResult(interp, zBuf, NULL); return SQLITE_OK; } @@ -378,7 +378,7 @@ static int SQLITE_TCLAPI btree_eof( rc = sqlite3BtreeEof(pCur); sqlite3BtreeLeave(pCur->pBtree); sqlite3_snprintf(sizeof(zBuf),zBuf, "%d", rc); - Tcl_AppendResult(interp, zBuf, 0); + Tcl_AppendResult(interp, zBuf, NULL); return SQLITE_OK; } @@ -407,7 +407,7 @@ static int SQLITE_TCLAPI btree_payload_size( n = sqlite3BtreePayloadSize(pCur); sqlite3BtreeLeave(pCur->pBtree); sqlite3_snprintf(sizeof(zBuf),zBuf, "%u", n); - Tcl_AppendResult(interp, zBuf, 0); + Tcl_AppendResult(interp, zBuf, NULL); return SQLITE_OK; } @@ -452,20 +452,20 @@ static int SQLITE_TCLAPI btree_varint_test( if( n1>9 || n1<1 ){ sqlite3_snprintf(sizeof(zErr), zErr, "putVarint returned %d - should be between 1 and 9", n1); - Tcl_AppendResult(interp, zErr, 0); + Tcl_AppendResult(interp, zErr, NULL); return TCL_ERROR; } n2 = getVarint(zBuf, &out); if( n1!=n2 ){ sqlite3_snprintf(sizeof(zErr), zErr, "putVarint returned %d and getVarint returned %d", n1, n2); - Tcl_AppendResult(interp, zErr, 0); + Tcl_AppendResult(interp, zErr, NULL); return TCL_ERROR; } if( in!=out ){ sqlite3_snprintf(sizeof(zErr), zErr, "Wrote 0x%016llx and got back 0x%016llx", in, out); - Tcl_AppendResult(interp, zErr, 0); + Tcl_AppendResult(interp, zErr, NULL); return TCL_ERROR; } if( (in & 0xffffffff)==in ){ @@ -476,14 +476,14 @@ static int SQLITE_TCLAPI btree_varint_test( sqlite3_snprintf(sizeof(zErr), zErr, "putVarint returned %d and GetVarint32 returned %d", n1, n2); - Tcl_AppendResult(interp, zErr, 0); + Tcl_AppendResult(interp, zErr, NULL); return TCL_ERROR; } if( in!=out ){ sqlite3_snprintf(sizeof(zErr), zErr, "Wrote 0x%016llx and got back 0x%016llx from GetVarint32", in, out); - Tcl_AppendResult(interp, zErr, 0); + Tcl_AppendResult(interp, zErr, NULL); return TCL_ERROR; } } @@ -528,7 +528,7 @@ static int SQLITE_TCLAPI btree_from_db( } if( 1!=Tcl_GetCommandInfo(interp, argv[1], &info) ){ - Tcl_AppendResult(interp, "No such db-handle: \"", argv[1], "\"", 0); + Tcl_AppendResult(interp, "No such db-handle: \"", argv[1], "\"", NULL); return TCL_ERROR; } if( argc==3 ){ @@ -646,7 +646,7 @@ static int SQLITE_TCLAPI btree_insert( Tcl_ResetResult(interp); if( rc ){ - Tcl_AppendResult(interp, sqlite3ErrName(rc), 0); + Tcl_AppendResult(interp, sqlite3ErrName(rc), NULL); return TCL_ERROR; } return TCL_OK; diff --git a/src/test4.c b/src/test4.c index 8a68f7d3e4..ea67908c23 100644 --- a/src/test4.c +++ b/src/test4.c @@ -119,7 +119,7 @@ static void *test_thread_main(void *pArg){ */ static int parse_thread_id(Tcl_Interp *interp, const char *zArg){ if( zArg==0 || zArg[0]==0 || zArg[1]!=0 || !isupper((unsigned char)zArg[0]) ){ - Tcl_AppendResult(interp, "thread ID must be an upper case letter", 0); + Tcl_AppendResult(interp, "thread ID must be an upper case letter", NULL); return -1; } return zArg[0] - 'A'; @@ -149,7 +149,7 @@ static int SQLITE_TCLAPI tcl_thread_create( i = parse_thread_id(interp, argv[1]); if( i<0 ) return TCL_ERROR; if( threadset[i].busy ){ - Tcl_AppendResult(interp, "thread ", argv[1], " is already running", 0); + Tcl_AppendResult(interp, "thread ", argv[1], " is already running", NULL); return TCL_ERROR; } threadset[i].busy = 1; @@ -159,7 +159,7 @@ static int SQLITE_TCLAPI tcl_thread_create( threadset[i].completed = 0; rc = pthread_create(&x, 0, test_thread_main, &threadset[i]); if( rc ){ - Tcl_AppendResult(interp, "failed to create the thread", 0); + Tcl_AppendResult(interp, "failed to create the thread", NULL); sqlite3_free(threadset[i].zFilename); threadset[i].busy = 0; return TCL_ERROR; @@ -198,7 +198,7 @@ static int SQLITE_TCLAPI tcl_thread_wait( i = parse_thread_id(interp, argv[1]); if( i<0 ) return TCL_ERROR; if( !threadset[i].busy ){ - Tcl_AppendResult(interp, "no such thread", 0); + Tcl_AppendResult(interp, "no such thread", NULL); return TCL_ERROR; } test_thread_wait(&threadset[i]); @@ -247,7 +247,7 @@ static int SQLITE_TCLAPI tcl_thread_halt( i = parse_thread_id(interp, argv[1]); if( i<0 ) return TCL_ERROR; if( !threadset[i].busy ){ - Tcl_AppendResult(interp, "no such thread", 0); + Tcl_AppendResult(interp, "no such thread", NULL); return TCL_ERROR; } test_stop_thread(&threadset[i]); @@ -278,12 +278,12 @@ static int SQLITE_TCLAPI tcl_thread_argc( i = parse_thread_id(interp, argv[1]); if( i<0 ) return TCL_ERROR; if( !threadset[i].busy ){ - Tcl_AppendResult(interp, "no such thread", 0); + Tcl_AppendResult(interp, "no such thread", NULL); return TCL_ERROR; } test_thread_wait(&threadset[i]); sqlite3_snprintf(sizeof(zBuf), zBuf, "%d", threadset[i].argc); - Tcl_AppendResult(interp, zBuf, 0); + Tcl_AppendResult(interp, zBuf, NULL); return TCL_OK; } @@ -310,16 +310,16 @@ static int SQLITE_TCLAPI tcl_thread_argv( i = parse_thread_id(interp, argv[1]); if( i<0 ) return TCL_ERROR; if( !threadset[i].busy ){ - Tcl_AppendResult(interp, "no such thread", 0); + Tcl_AppendResult(interp, "no such thread", NULL); return TCL_ERROR; } if( Tcl_GetInt(interp, argv[2], &n) ) return TCL_ERROR; test_thread_wait(&threadset[i]); if( n<0 || n>=threadset[i].argc ){ - Tcl_AppendResult(interp, "column number out of range", 0); + Tcl_AppendResult(interp, "column number out of range", NULL); return TCL_ERROR; } - Tcl_AppendResult(interp, threadset[i].argv[n], 0); + Tcl_AppendResult(interp, threadset[i].argv[n], NULL); return TCL_OK; } @@ -346,16 +346,16 @@ static int SQLITE_TCLAPI tcl_thread_colname( i = parse_thread_id(interp, argv[1]); if( i<0 ) return TCL_ERROR; if( !threadset[i].busy ){ - Tcl_AppendResult(interp, "no such thread", 0); + Tcl_AppendResult(interp, "no such thread", NULL); return TCL_ERROR; } if( Tcl_GetInt(interp, argv[2], &n) ) return TCL_ERROR; test_thread_wait(&threadset[i]); if( n<0 || n>=threadset[i].argc ){ - Tcl_AppendResult(interp, "column number out of range", 0); + Tcl_AppendResult(interp, "column number out of range", NULL); return TCL_ERROR; } - Tcl_AppendResult(interp, threadset[i].colv[n], 0); + Tcl_AppendResult(interp, threadset[i].colv[n], NULL); return TCL_OK; } @@ -382,12 +382,12 @@ static int SQLITE_TCLAPI tcl_thread_result( i = parse_thread_id(interp, argv[1]); if( i<0 ) return TCL_ERROR; if( !threadset[i].busy ){ - Tcl_AppendResult(interp, "no such thread", 0); + Tcl_AppendResult(interp, "no such thread", NULL); return TCL_ERROR; } test_thread_wait(&threadset[i]); zName = sqlite3ErrName(threadset[i].rc); - Tcl_AppendResult(interp, zName, 0); + Tcl_AppendResult(interp, zName, NULL); return TCL_OK; } @@ -413,11 +413,11 @@ static int SQLITE_TCLAPI tcl_thread_error( i = parse_thread_id(interp, argv[1]); if( i<0 ) return TCL_ERROR; if( !threadset[i].busy ){ - Tcl_AppendResult(interp, "no such thread", 0); + Tcl_AppendResult(interp, "no such thread", NULL); return TCL_ERROR; } test_thread_wait(&threadset[i]); - Tcl_AppendResult(interp, threadset[i].zErr, 0); + Tcl_AppendResult(interp, threadset[i].zErr, NULL); return TCL_OK; } @@ -457,7 +457,7 @@ static int SQLITE_TCLAPI tcl_thread_compile( i = parse_thread_id(interp, argv[1]); if( i<0 ) return TCL_ERROR; if( !threadset[i].busy ){ - Tcl_AppendResult(interp, "no such thread", 0); + Tcl_AppendResult(interp, "no such thread", NULL); return TCL_ERROR; } test_thread_wait(&threadset[i]); @@ -511,7 +511,7 @@ static int SQLITE_TCLAPI tcl_thread_step( i = parse_thread_id(interp, argv[1]); if( i<0 ) return TCL_ERROR; if( !threadset[i].busy ){ - Tcl_AppendResult(interp, "no such thread", 0); + Tcl_AppendResult(interp, "no such thread", NULL); return TCL_ERROR; } test_thread_wait(&threadset[i]); @@ -554,7 +554,7 @@ static int SQLITE_TCLAPI tcl_thread_finalize( i = parse_thread_id(interp, argv[1]); if( i<0 ) return TCL_ERROR; if( !threadset[i].busy ){ - Tcl_AppendResult(interp, "no such thread", 0); + Tcl_AppendResult(interp, "no such thread", NULL); return TCL_ERROR; } test_thread_wait(&threadset[i]); @@ -587,14 +587,14 @@ static int SQLITE_TCLAPI tcl_thread_swap( i = parse_thread_id(interp, argv[1]); if( i<0 ) return TCL_ERROR; if( !threadset[i].busy ){ - Tcl_AppendResult(interp, "no such thread", 0); + Tcl_AppendResult(interp, "no such thread", NULL); return TCL_ERROR; } test_thread_wait(&threadset[i]); j = parse_thread_id(interp, argv[2]); if( j<0 ) return TCL_ERROR; if( !threadset[j].busy ){ - Tcl_AppendResult(interp, "no such thread", 0); + Tcl_AppendResult(interp, "no such thread", NULL); return TCL_ERROR; } test_thread_wait(&threadset[j]); @@ -628,7 +628,7 @@ static int SQLITE_TCLAPI tcl_thread_db_get( i = parse_thread_id(interp, argv[1]); if( i<0 ) return TCL_ERROR; if( !threadset[i].busy ){ - Tcl_AppendResult(interp, "no such thread", 0); + Tcl_AppendResult(interp, "no such thread", NULL); return TCL_ERROR; } test_thread_wait(&threadset[i]); @@ -659,7 +659,7 @@ static int SQLITE_TCLAPI tcl_thread_db_put( i = parse_thread_id(interp, argv[1]); if( i<0 ) return TCL_ERROR; if( !threadset[i].busy ){ - Tcl_AppendResult(interp, "no such thread", 0); + Tcl_AppendResult(interp, "no such thread", NULL); return TCL_ERROR; } test_thread_wait(&threadset[i]); @@ -691,7 +691,7 @@ static int SQLITE_TCLAPI tcl_thread_stmt_get( i = parse_thread_id(interp, argv[1]); if( i<0 ) return TCL_ERROR; if( !threadset[i].busy ){ - Tcl_AppendResult(interp, "no such thread", 0); + Tcl_AppendResult(interp, "no such thread", NULL); return TCL_ERROR; } test_thread_wait(&threadset[i]); diff --git a/src/test5.c b/src/test5.c index 334b5d07fe..76e6197558 100644 --- a/src/test5.c +++ b/src/test5.c @@ -106,7 +106,7 @@ static u8 name_to_enc(Tcl_Interp *interp, Tcl_Obj *pObj){ } } if( !pEnc->enc ){ - Tcl_AppendResult(interp, "No such encoding: ", z, 0); + Tcl_AppendResult(interp, "No such encoding: ", z, NULL); } if( pEnc->enc==SQLITE_UTF16 ){ return SQLITE_UTF16NATIVE; diff --git a/src/test6.c b/src/test6.c index 76db640c4d..b57759150b 100644 --- a/src/test6.c +++ b/src/test6.c @@ -934,7 +934,7 @@ static int SQLITE_TCLAPI crashParamsObjCmd( zCrashFile = Tcl_GetStringFromObj(objv[objc-1], &nCrashFile); if( nCrashFile>=sizeof(g.zCrashFile) ){ - Tcl_AppendResult(interp, "Filename is too long: \"", zCrashFile, "\"", 0); + Tcl_AppendResult(interp, "Filename is too long: \"", zCrashFile, "\"", NULL); goto error; } if( Tcl_GetIntFromObj(interp, objv[objc-2], &iDelay) ){ @@ -1055,7 +1055,7 @@ static int SQLITE_TCLAPI jtObjCmd( zParent = 0; } if( jt_register(zParent, objc==3) ){ - Tcl_AppendResult(interp, "Error in jt_register", 0); + Tcl_AppendResult(interp, "Error in jt_register", NULL); return TCL_ERROR; } diff --git a/src/test9.c b/src/test9.c index b5362adb7f..62b16795e3 100644 --- a/src/test9.c +++ b/src/test9.c @@ -56,7 +56,7 @@ static int SQLITE_TCLAPI c_collation_test( error_out: Tcl_ResetResult(interp); - Tcl_AppendResult(interp, "Error testing function: ", zErrFunction, 0); + Tcl_AppendResult(interp, "Error testing function: ", zErrFunction, NULL); return TCL_ERROR; } @@ -96,7 +96,7 @@ static int SQLITE_TCLAPI c_realloc_test( error_out: Tcl_ResetResult(interp); - Tcl_AppendResult(interp, "Error testing function: ", zErrFunction, 0); + Tcl_AppendResult(interp, "Error testing function: ", zErrFunction, NULL); return TCL_ERROR; } @@ -174,7 +174,7 @@ static int SQLITE_TCLAPI c_misuse_test( error_out: Tcl_ResetResult(interp); - Tcl_AppendResult(interp, "Error testing function: ", zErrFunction, 0); + Tcl_AppendResult(interp, "Error testing function: ", zErrFunction, NULL); return TCL_ERROR; } diff --git a/src/test_backup.c b/src/test_backup.c index 8051888ee6..ae2348ebc2 100644 --- a/src/test_backup.c +++ b/src/test_backup.c @@ -135,7 +135,7 @@ static int SQLITE_TCLAPI backupTestInit( pBackup = sqlite3_backup_init(pDestDb, zDestName, pSrcDb, zSrcName); if( !pBackup ){ - Tcl_AppendResult(interp, "sqlite3_backup_init() failed", 0); + Tcl_AppendResult(interp, "sqlite3_backup_init() failed", NULL); return TCL_ERROR; } diff --git a/src/test_blob.c b/src/test_blob.c index bddad240ce..ae5a734179 100644 --- a/src/test_blob.c +++ b/src/test_blob.c @@ -237,7 +237,7 @@ static int SQLITE_TCLAPI test_blob_read( if( nByte>0 ){ zBuf = (unsigned char *)Tcl_AttemptAlloc(nByte); if( zBuf==0 ){ - Tcl_AppendResult(interp, "out of memory in " __FILE__, 0); + Tcl_AppendResult(interp, "out of memory in " __FILE__, NULL); return TCL_ERROR; } } diff --git a/src/test_fs.c b/src/test_fs.c index d821a83b9d..1c47bbaacf 100644 --- a/src/test_fs.c +++ b/src/test_fs.c @@ -69,18 +69,15 @@ #include #include -#if SQLITE_OS_UNIX || defined(__MINGW_H) +#if !defined(_WIN32) || defined(__MSVCRT__) # include # include # ifndef DIRENT # define DIRENT dirent # endif -#endif -#if SQLITE_OS_WIN +#else # include -# if !defined(__MINGW_H) -# include "test_windirent.h" -# endif +# include "test_windirent.h" # ifndef S_ISREG # define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG) # endif @@ -485,7 +482,7 @@ static int fstreeFilter( int nDir; char aWild[2] = { '\0', '\0' }; -#if SQLITE_OS_WIN +#ifdef _WIN32 const char *zDrive = windirent_getenv("fstreeDrive"); if( zDrive==0 ){ zDrive = windirent_getenv("SystemDrive"); @@ -538,7 +535,7 @@ static int fstreeFilter( sqlite3_bind_text(pCsr->pStmt, 2, zRoot, nRoot, SQLITE_TRANSIENT); sqlite3_bind_text(pCsr->pStmt, 3, zPrefix, nPrefix, SQLITE_TRANSIENT); -#if SQLITE_OS_WIN +#ifdef _WIN32 sqlite3_free(zPrefix); sqlite3_free(zRoot); #endif diff --git a/src/test_hexio.c b/src/test_hexio.c index 1a21e89aa0..a4a86c2096 100644 --- a/src/test_hexio.c +++ b/src/test_hexio.c @@ -122,7 +122,7 @@ static int SQLITE_TCLAPI hexio_read( in = fopen(zFile, "r"); } if( in==0 ){ - Tcl_AppendResult(interp, "cannot open input file ", zFile, 0); + Tcl_AppendResult(interp, "cannot open input file ", zFile, NULL); return TCL_ERROR; } fseek(in, offset, SEEK_SET); @@ -132,7 +132,7 @@ static int SQLITE_TCLAPI hexio_read( got = 0; } sqlite3TestBinToHex(zBuf, got); - Tcl_AppendResult(interp, zBuf, 0); + Tcl_AppendResult(interp, zBuf, NULL); sqlite3_free(zBuf); return TCL_OK; } @@ -175,7 +175,7 @@ static int SQLITE_TCLAPI hexio_write( out = fopen(zFile, "r+"); } if( out==0 ){ - Tcl_AppendResult(interp, "cannot open output file ", zFile, 0); + Tcl_AppendResult(interp, "cannot open output file ", zFile, NULL); return TCL_ERROR; } fseek(out, offset, SEEK_SET); @@ -324,7 +324,7 @@ static int SQLITE_TCLAPI utf8_to_utf8( z[n] = 0; nOut = sqlite3Utf8To8(z); sqlite3TestBinToHex(z,nOut); - Tcl_AppendResult(interp, (char*)z, 0); + Tcl_AppendResult(interp, (char*)z, NULL); sqlite3_free(z); return TCL_OK; #else diff --git a/src/test_malloc.c b/src/test_malloc.c index 8d6c4fa505..1c19d896f2 100644 --- a/src/test_malloc.c +++ b/src/test_malloc.c @@ -646,7 +646,7 @@ static int SQLITE_TCLAPI test_memdebug_fail( } if( zErr ){ - Tcl_AppendResult(interp, zErr, zOption, 0); + Tcl_AppendResult(interp, zErr, zOption, NULL); return TCL_ERROR; } } diff --git a/src/test_multiplex.c b/src/test_multiplex.c index e5b43f4cc1..82551200f2 100644 --- a/src/test_multiplex.c +++ b/src/test_multiplex.c @@ -1315,8 +1315,8 @@ static int SQLITE_TCLAPI test_multiplex_control( } if( 0==Tcl_GetCommandInfo(interp, Tcl_GetString(objv[1]), &cmdInfo) ){ - Tcl_AppendResult(interp, "expected database handle, got \"", 0); - Tcl_AppendResult(interp, Tcl_GetString(objv[1]), "\"", 0); + Tcl_AppendResult(interp, "expected database handle, got \"", NULL); + Tcl_AppendResult(interp, Tcl_GetString(objv[1]), "\"", NULL); return TCL_ERROR; }else{ db = *(sqlite3 **)cmdInfo.objClientData; diff --git a/src/test_mutex.c b/src/test_mutex.c index e60a06df32..de064de4c4 100644 --- a/src/test_mutex.c +++ b/src/test_mutex.c @@ -225,8 +225,8 @@ static int SQLITE_TCLAPI test_install_mutex_counters( assert(isInstall==0 || isInstall==1); assert(g.isInstalled==0 || g.isInstalled==1); if( isInstall==g.isInstalled ){ - Tcl_AppendResult(interp, "mutex counters are ", 0); - Tcl_AppendResult(interp, isInstall?"already installed":"not installed", 0); + Tcl_AppendResult(interp, "mutex counters are ", NULL); + Tcl_AppendResult(interp, isInstall?"already installed":"not installed", NULL); return TCL_ERROR; } diff --git a/src/test_osinst.c b/src/test_osinst.c index 2d03d2bbcd..e776d89e55 100644 --- a/src/test_osinst.c +++ b/src/test_osinst.c @@ -71,9 +71,8 @@ #include "sqlite3.h" -#include "os_setup.h" -#if SQLITE_OS_WIN -# include "os_win.h" +#ifdef _WIN32 +#include #endif #include @@ -219,14 +218,7 @@ static sqlite3_io_methods vfslog_io_methods = { vfslogShmUnmap /* xShmUnmap */ }; -#if SQLITE_OS_UNIX && !defined(NO_GETTOD) -#include -static sqlite3_uint64 vfslog_time(){ - struct timeval sTime; - gettimeofday(&sTime, 0); - return sTime.tv_usec + (sqlite3_uint64)sTime.tv_sec * 1000000; -} -#elif SQLITE_OS_WIN +#ifdef _WIN32 #include static sqlite3_uint64 vfslog_time(){ FILETIME ft; @@ -241,6 +233,13 @@ static sqlite3_uint64 vfslog_time(){ /* ft is 100-nanosecond intervals, we want microseconds */ return u64time /(sqlite3_uint64)10; } +#elif !defined(NO_GETTOD) +#include +static sqlite3_uint64 vfslog_time(){ + struct timeval sTime; + gettimeofday(&sTime, 0); + return sTime.tv_usec + (sqlite3_uint64)sTime.tv_sec * 1000000; +} #else static sqlite3_uint64 vfslog_time(){ return 0; @@ -1146,7 +1145,7 @@ static int SQLITE_TCLAPI test_vfslog( zMsg = Tcl_GetString(objv[3]); rc = sqlite3_vfslog_annotate(zVfs, zMsg); if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, "failed", 0); + Tcl_AppendResult(interp, "failed", (char*)0); return TCL_ERROR; } break; @@ -1160,7 +1159,7 @@ static int SQLITE_TCLAPI test_vfslog( zVfs = Tcl_GetString(objv[2]); rc = sqlite3_vfslog_finalize(zVfs); if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, "failed", 0); + Tcl_AppendResult(interp, "failed", (char*)0); return TCL_ERROR; } break; @@ -1180,7 +1179,7 @@ static int SQLITE_TCLAPI test_vfslog( if( *zParent=='\0' ) zParent = 0; rc = sqlite3_vfslog_new(zVfs, zParent, zLog); if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, "failed", 0); + Tcl_AppendResult(interp, "failed", (char*)0); return TCL_ERROR; } break; diff --git a/src/test_quota.c b/src/test_quota.c index 62d808a22b..d2f9cddd11 100644 --- a/src/test_quota.c +++ b/src/test_quota.c @@ -44,14 +44,12 @@ #define sqlite3_mutex_notheld(X) ((void)(X),1) #endif /* SQLITE_THREADSAFE==0 */ -#include "os_setup.h" -#if SQLITE_OS_UNIX -# include -#endif -#if SQLITE_OS_WIN -# include "os_win.h" +#ifdef _WIN32 +# include # include +#else +# include #endif @@ -130,7 +128,7 @@ struct quota_FILE { FILE *f; /* Open stdio file pointer */ sqlite3_int64 iOfst; /* Current offset into the file */ quotaFile *pFile; /* The file record in the quota system */ -#if SQLITE_OS_WIN +#ifdef _WIN32 char *zMbcsName; /* Full MBCS pathname of the file */ #endif }; @@ -375,7 +373,7 @@ static quotaFile *quotaFindFile( ** used to store the returned pointer when done. */ static char *quota_utf8_to_mbcs(const char *zUtf8){ -#if SQLITE_OS_WIN +#ifdef _WIN32 size_t n; /* Bytes in zUtf8 */ int nWide; /* number of UTF-16 characters */ int nMbcs; /* Bytes of MBCS */ @@ -410,7 +408,7 @@ static char *quota_utf8_to_mbcs(const char *zUtf8){ ** Deallocate any memory allocated by quota_utf8_to_mbcs(). */ static void quota_mbcs_free(char *zOld){ -#if SQLITE_OS_WIN +#ifdef _WIN32 sqlite3_free(zOld); #else /* No-op on unix */ @@ -970,7 +968,7 @@ quota_FILE *sqlite3_quota_fopen(const char *zFilename, const char *zMode){ } quotaLeave(); sqlite3_free(zFull); -#if SQLITE_OS_WIN +#ifdef _WIN32 p->zMbcsName = zFullTranslated; #endif return p; @@ -1073,7 +1071,7 @@ int sqlite3_quota_fclose(quota_FILE *p){ } quotaLeave(); } -#if SQLITE_OS_WIN +#ifdef _WIN32 quota_mbcs_free(p->zMbcsName); #endif sqlite3_free(p); @@ -1087,11 +1085,10 @@ int sqlite3_quota_fflush(quota_FILE *p, int doFsync){ int rc; rc = fflush(p->f); if( rc==0 && doFsync ){ -#if SQLITE_OS_UNIX - rc = fsync(fileno(p->f)); -#endif -#if SQLITE_OS_WIN +#ifdef _WIN32 rc = _commit(_fileno(p->f)); +#else + rc = fsync(fileno(p->f)); #endif } return rc!=0; @@ -1143,17 +1140,16 @@ int sqlite3_quota_ftruncate(quota_FILE *p, sqlite3_int64 szNew){ pGroup->iSize += szNew - pFile->iSize; quotaLeave(); } -#if SQLITE_OS_UNIX - rc = ftruncate(fileno(p->f), szNew); -#endif -#if SQLITE_OS_WIN -# if defined(__MINGW32__) && defined(SQLITE_TEST) +#ifdef _WIN32 +# if defined(__MSVCRT__) && defined(SQLITE_TEST) /* _chsize_s() is missing from MingW (as of 2012-11-06). Use ** _chsize() as a work-around for testing purposes. */ rc = _chsize(_fileno(p->f), (long)szNew); # else rc = _chsize_s(_fileno(p->f), szNew); # endif +#else + rc = ftruncate(fileno(p->f), szNew); #endif if( pFile && rc==0 ){ quotaGroup *pGroup = pFile->pGroup; @@ -1172,13 +1168,12 @@ int sqlite3_quota_ftruncate(quota_FILE *p, sqlite3_int64 szNew){ */ int sqlite3_quota_file_mtime(quota_FILE *p, time_t *pTime){ int rc; -#if SQLITE_OS_UNIX - struct stat buf; - rc = fstat(fileno(p->f), &buf); -#endif -#if SQLITE_OS_WIN +#ifdef _WIN32 struct _stati64 buf; rc = _stati64(p->zMbcsName, &buf); +#else + struct stat buf; + rc = fstat(fileno(p->f), &buf); #endif if( rc==0 ) *pTime = buf.st_mtime; return rc; @@ -1190,13 +1185,12 @@ int sqlite3_quota_file_mtime(quota_FILE *p, time_t *pTime){ */ sqlite3_int64 sqlite3_quota_file_truesize(quota_FILE *p){ int rc; -#if SQLITE_OS_UNIX - struct stat buf; - rc = fstat(fileno(p->f), &buf); -#endif -#if SQLITE_OS_WIN +#ifdef _WIN32 struct _stati64 buf; rc = _stati64(p->zMbcsName, &buf); +#else + struct stat buf; + rc = fstat(fileno(p->f), &buf); #endif return rc==0 ? buf.st_size : -1; } diff --git a/src/test_sqllog.c b/src/test_sqllog.c index 9ae0e50685..5abf59a8bf 100644 --- a/src/test_sqllog.c +++ b/src/test_sqllog.c @@ -84,7 +84,7 @@ #include #include static int getProcessId(void){ -#if SQLITE_OS_WIN +#ifdef _WIN32 return (int)_getpid(); #else return (int)getpid(); diff --git a/src/test_superlock.c b/src/test_superlock.c index 7f3bf163a5..82997927c4 100644 --- a/src/test_superlock.c +++ b/src/test_superlock.c @@ -338,7 +338,7 @@ static int SQLITE_TCLAPI superlock_cmd( if( rc!=SQLITE_OK ){ extern const char *sqlite3ErrStr(int); Tcl_ResetResult(interp); - Tcl_AppendResult(interp, sqlite3ErrStr(rc), 0); + Tcl_AppendResult(interp, sqlite3ErrStr(rc), NULL); return TCL_ERROR; } diff --git a/src/test_syscall.c b/src/test_syscall.c index af2ae10015..35c303f8ee 100644 --- a/src/test_syscall.c +++ b/src/test_syscall.c @@ -686,7 +686,7 @@ static int SQLITE_TCLAPI test_syscall_pagesize( } }else{ if( pgsz<512 || (pgsz & (pgsz-1)) ){ - Tcl_AppendResult(interp, "pgsz out of range", 0); + Tcl_AppendResult(interp, "pgsz out of range", NULL); return TCL_ERROR; } gSyscall.orig_getpagesize = pVfs->xGetSystemCall(pVfs, "getpagesize"); @@ -729,7 +729,7 @@ static int SQLITE_TCLAPI test_syscall( return TCL_ERROR; } if( pVfs->iVersion<3 || pVfs->xSetSystemCall==0 ){ - Tcl_AppendResult(interp, "VFS does not support xSetSystemCall", 0); + Tcl_AppendResult(interp, "VFS does not support xSetSystemCall", NULL); rc = TCL_ERROR; }else{ rc = Tcl_GetIndexFromObjStruct(interp, diff --git a/src/test_thread.c b/src/test_thread.c index 7c06d110ac..98ef2c2468 100644 --- a/src/test_thread.c +++ b/src/test_thread.c @@ -201,7 +201,7 @@ static int SQLITE_TCLAPI sqlthread_spawn( rc = Tcl_CreateThread(&x, tclScriptThread, (void *)pNew, nStack, flags); if( rc!=TCL_OK ){ - Tcl_AppendResult(interp, "Error in Tcl_CreateThread()", 0); + Tcl_AppendResult(interp, "Error in Tcl_CreateThread()", NULL); ckfree((char *)pNew); return TCL_ERROR; } @@ -235,7 +235,7 @@ static int SQLITE_TCLAPI sqlthread_parent( UNUSED_PARAMETER(objc); if( p==0 ){ - Tcl_AppendResult(interp, "no parent thread", 0); + Tcl_AppendResult(interp, "no parent thread", NULL); return TCL_ERROR; } @@ -287,7 +287,7 @@ static int SQLITE_TCLAPI sqlthread_open( sqlite3_busy_handler(db, xBusy, 0); if( sqlite3TestMakePointerStr(interp, zBuf, db) ) return TCL_ERROR; - Tcl_AppendResult(interp, zBuf, 0); + Tcl_AppendResult(interp, zBuf, NULL); return TCL_OK; } @@ -614,13 +614,13 @@ static int SQLITE_TCLAPI blocking_prepare_v2_proc( if( rc!=SQLITE_OK ){ assert( pStmt==0 ); sqlite3_snprintf(sizeof(zBuf), zBuf, "%s ", (char *)sqlite3ErrName(rc)); - Tcl_AppendResult(interp, zBuf, sqlite3_errmsg(db), 0); + Tcl_AppendResult(interp, zBuf, sqlite3_errmsg(db), NULL); return TCL_ERROR; } if( pStmt ){ if( sqlite3TestMakePointerStr(interp, zBuf, pStmt) ) return TCL_ERROR; - Tcl_AppendResult(interp, zBuf, 0); + Tcl_AppendResult(interp, zBuf, NULL); } return TCL_OK; } diff --git a/src/test_vfs.c b/src/test_vfs.c index f75ef956b6..f44914c207 100644 --- a/src/test_vfs.c +++ b/src/test_vfs.c @@ -1147,7 +1147,7 @@ static int SQLITE_TCLAPI testvfs_obj_cmd( } ckfree(zName); if( !pBuffer ){ - Tcl_AppendResult(interp, "no such file: ", Tcl_GetString(objv[2]), 0); + Tcl_AppendResult(interp, "no such file: ", Tcl_GetString(objv[2]), NULL); return TCL_ERROR; } if( objc==4 ){ @@ -1225,7 +1225,7 @@ static int SQLITE_TCLAPI testvfs_obj_cmd( } } if( iMethod==ArraySize(vfsmethod) ){ - Tcl_AppendResult(interp, "unknown method: ", zElem, 0); + Tcl_AppendResult(interp, "unknown method: ", zElem, NULL); return TCL_ERROR; } } @@ -1353,7 +1353,7 @@ static int SQLITE_TCLAPI testvfs_obj_cmd( return TCL_ERROR; } if( aFlag[idx].iValue<0 && nFlags>1 ){ - Tcl_AppendResult(interp, "bad flags: ", Tcl_GetString(objv[2]), 0); + Tcl_AppendResult(interp, "bad flags: ", Tcl_GetString(objv[2]), NULL); return TCL_ERROR; } iNew |= aFlag[idx].iValue; @@ -1673,7 +1673,7 @@ static int SQLITE_TCLAPI test_vfs_set_readmark( return TCL_ERROR; } if( pShm==0 ){ - Tcl_AppendResult(interp, "*-shm is not yet mapped", 0); + Tcl_AppendResult(interp, "*-shm is not yet mapped", NULL); return TCL_ERROR; } aShm = (u32*)pShm; From 8199c8d7a70105551afec082c13f4560ed6e6d55 Mon Sep 17 00:00:00 2001 From: stephan Date: Thu, 6 Mar 2025 13:49:27 +0000 Subject: [PATCH 002/120] Cygwin-centric test script tweaks from Jan Nijtmans. FossilOrigin-Name: 9868615b7d41179672dde2eafff878d50cf9d647c7050ccf5103e385fd182fc2 --- manifest | 31 ++++++++++++++----------------- manifest.uuid | 2 +- test/mmap2.test | 4 ++-- test/nockpt.test | 4 +++- test/oserror.test | 5 ++++- test/pager4.test | 2 +- test/shmlock.test | 2 +- test/tkt3457.test | 4 ++-- test/unixexcl.test | 2 +- test/wal64k.test | 4 ++-- test/walnoshm.test | 1 + 11 files changed, 32 insertions(+), 29 deletions(-) diff --git a/manifest b/manifest index c67c275604..f9bfb6d41c 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Cygwin-centric\sfixes\sfrom\sJan\sNijtmans. -D 2025-03-06T13:38:07.006 +C Cygwin-centric\stest\sscript\stweaks\sfrom\sJan\sNijtmans. +D 2025-03-06T13:49:27.683 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -1471,7 +1471,7 @@ F test/misc8.test 08d2380bc435486b12161521f225043ac2be26f02471c2c1ea4cac0b1548ed F test/misuse.test 46d42ffdf375833ea5828796e56f84660344f7548659b493059f152f00e66840 F test/mjournal.test 28a08d5cb5fb5b5702a46e19176e45e964e0800d1f894677169e79f34030e152 F test/mmap1.test 18de3fd7b70a777af6004ca2feecfcdd3d0be17fa04058e808baf530c94b1a1d -F test/mmap2.test 9d6dd9ddb4ad2379f29cc78f38ce1e63ed418022 +F test/mmap2.test dba452dc7db91e9df10f70bdd73dc4190c7b8ee7b5133b4684f04277ada0b9ac F test/mmap3.test b3c297e78e6a8520aafcc1a8f140535594c9086e F test/mmap4.test 2e2b4e32555b58da15176e6fe750f17c9dcf7f93 F test/mmapcorrupt.test 470fb44fe92e99c1d23701d156f8c17865f5b027063c9119dcfdb842791f4465 @@ -1484,7 +1484,7 @@ F test/multiplex4.test e8ae4c4bd70606a5727743241f13b5701990abe4 F test/mutex1.test 42cb5e244c3a77bb0ef2b967e06fa5e7ba7d32d90a9b20bed98f6f5ede185a25 F test/mutex2.test bfeaeac2e73095b2ac32285d2756e3a65e681660 F test/nan.test 73ea63ab43668313e2f8cc9ef9e9a966672c7934f3ce76926fbe991235d07d91 -F test/nockpt.test 8c43b25af63b0bd620cf1b003529e37b6f1dc53bd22690e96a1bd73f78dde53a +F test/nockpt.test e0ef4af9b35892de80515c2e45a54eb3c83623721f8bbc797450041a3cd3405f F test/nolock.test f196cf8b8fbea4e2ca345140a2b3f3b0da45c76e F test/normalize.test f23b6c5926c59548635fcf39678ac613e726121e073dd902a3062fbb83903b72 F test/notify1.test 669b2b743618efdc18ca4b02f45423d5d2304abf @@ -1513,14 +1513,14 @@ F test/orderby8.test 23ef1a5d72bd3adcc2f65561c654295d1b8047bd F test/orderby9.test 87fb9548debcc2cd141c5299002dd94672fa76a3 F test/orderbyA.test df608e59efc2ef50c1eddf1a773b272de3252e9401bfec86d04b52fd973866d5 F test/orderbyB.test 32576c7b138105bc72f7fbf33bd320ca3a7d303641fc939e0e56af6cba884b3d -F test/oserror.test 1fc9746b83d778e70d115049747ba19c7fba154afce7cc165b09feb6ca6abbc5 +F test/oserror.test ee3fad06ec8671c4d047c2c92a567fc2e0e8161caaec7edd6d48325c5ac97f30 F test/ossfuzz.c 9636dad2092a05a32110df0ca06713038dd0c43dd89a77dabe4b8b0d71096715 F test/ossshell.c f125c5bd16e537a2549aa579b328dd1c59905e7ab1338dfc210e755bb7b69f17 F test/ovfl.test 199c482696defceacee8c8e0e0ef36da62726b2f F test/pager1.test ffd885cdc98b986c9f746496508c0c4810ed0eaade3575ddf53c222e85880552 F test/pager2.test c0ede15952b607f9a38f653acdfa73c19e657958e9104aab1a71950ea7b71831 F test/pager3.test 4e9a83d6ca0838d7c602c9eb93d1357562d9059c1e02ffb138a8271020838370 -F test/pager4.test a122e9e6925d5b23b31e3dfef8c6a44bbf19590e +F test/pager4.test 98837730b0d3fe8002706e1c7c3b2e43db19f9a369d671c20307473c39efc64e F test/pagerfault.test 63c5da625562c66345ab4528790327ca63db2f6f9cbae2aba8cb7c51de3d1628 F test/pagerfault2.test caf4c7facb914fd3b03a17b31ae2b180c8d6ca1f F test/pagerfault3.test 1003fcda009bf48a8e22a516e193b6ef0dd1bbd8 @@ -1648,7 +1648,7 @@ F test/shell7.test 43fd8e511c533bab5232e95c7b4be93b243451709e89582600d4b6e67693d F test/shell8.test aea51ecbcd4494c746b096aeff51d841d04d5f0dc4b62eb42427f16109b87acd F test/shell9.test 8742a5b390cdcef6369f5aa223e415aa4255a4129ef249b177887dc635a87209 F test/shellA.test 079c05c11947ade4ea8d51053d3abb687ec96a3dce6680d01838519b705190c5 -F test/shmlock.test 3dbf017d34ab0c60abe6a44e447d3552154bd0c87b41eaf5ceacd408dd13fda5 +F test/shmlock.test ca560c2cd8197ca2c75be31060918c39fb1cd44de9434b61d1b376b96c0e42fa F test/shortread1.test bb591ef20f0fd9ed26d0d12e80eee6d7ac8897a3 F test/show_speedtest1_rtree.tcl 32e6c5f073d7426148a6936a0408f4b5b169aba5 F test/shrink.test 2668e607dcdfa19c52828c09b69685b38da793856582ae31debf79d90c7bbbdc @@ -1857,7 +1857,7 @@ F test/tkt3357.test 77c37c6482b526fe89941ce951c22d011f5922ed F test/tkt3419.test 1bbf36d7ea03b638c15804251287c2391f5c1f6b F test/tkt3424.test 61f831bd2b071bd128fa5d00fbda57e656ca5812 F test/tkt3442.test c9d95b4c8f4f35a51b523f35d2afd0ce124937812af296545ad551ff763504fd -F test/tkt3457.test 5b9cc2b6cbbf896e9b973db83f6520f43f326f4d08604372a7b0379625e28412 +F test/tkt3457.test adf048188761581124a2f0f91f9d23a5b76fb425270ecbfd73c9c7949fa10786 F test/tkt3461.test 228ea328a5a21e8663f80ee3d212a6ad92549a19 F test/tkt3493.test 1686cbde85f8721fc1bdc0ee72f2ef2f63139218 F test/tkt3508.test d75704db9501625c7f7deec119fcaf1696aefb7d @@ -1935,7 +1935,7 @@ F test/unionvtab.test e1704ab1b4c1bb3ffc9da4681f8e85a0b909fd80b937984fc94b27415a F test/unionvtabfault.test e8759f3d14fb938ce9657e2342db34aeac0fb9bc1692b0d1ebb0069630151d06 F test/unique.test 93f8b2ef5ea51b9495f8d6493429b1fd0f465264 F test/unique2.test 3674e9f2a3f1fbbfd4772ac74b7a97090d0f77d2 -F test/unixexcl.test d936ba2b06794018e136418addd59a2354eeae97 +F test/unixexcl.test d2366ef2d3d95249314307861d748924d9ab4f24305541159a08be61ccd4a9ee F test/unordered.test 0edaf3411d300693bca595897c5201421c6c5ec787990a1dfe2f7f60ae93f1e2 F test/update.test 85d3f46d0863033370bd881b1097f5694369a8730e53c5f85d96f32b7b310b47 F test/update2.test 67455bc61fcbcf96923c45b3bc4f87bc72be7d67575ad35f134906148c7b06d3 @@ -2002,7 +2002,7 @@ F test/wal3.test 5de023bb862fd1eb9d2ad26fa8d9c43abb5370582e5b08b2ae0d6f93661bc31 F test/wal4.test 4744e155cd6299c6bd99d3eab1c82f77db9cdb3c F test/wal5.test 9c11da7aeccd83a46d79a556ad11a18d3cb15aa9 F test/wal6.test b602704e4b066199bc89d91ca9000f335dcf4572 -F test/wal64k.test 2a525c0f45d709bae3765c71045ccec5df7d100ccbd3a7860fdba46c9addb965 +F test/wal64k.test bb8c52f0140aae1de877ffed86e2a97d903f98cf9ac263f185d51c58cde92327 F test/wal7.test 2ae8f427d240099cc4b2dfef63cff44e2a68a1bd F test/wal8.test d9df3fba4caad5854ed69ed673c68482514203c8 F test/wal9.test 378e76a9ad09cd9bee06c172ad3547b0129a6750 @@ -2019,7 +2019,7 @@ F test/walfault.test 09b8ad7e52d2f54bce50e31aa7ea51412bb9f70ac13c74e669ddcd8b48b F test/walfault2.test e039ac66c78d5561683cacde04097213cdad3b58e2b3f3fe1112862217bfd915 F test/walhook.test ed00a40ba7255da22d6b66433ab61fab16a63483 F test/walmode.test cd6e7cff618eaaa5910ce57c3657aa50110397f86213886a2400afb9bfec7b7b -F test/walnoshm.test 84ca10c544632a756467336b7c3b864d493ee496 +F test/walnoshm.test 844b3eb7d8e8ee76c834ef723babec57b0be51fa52ef7e321c289ed0fe3cddc2 F test/waloverwrite.test dad2f26567f1b45174e54fbf9a8dc1cb876a7f03 F test/walpersist.test 8d78a1ec91299163451417b451a2bac3481f8eb9f455b1ca507a6625c927ca6e F test/walprotocol.test 1b3f922125e341703f6e946d77fdc564d38fb3e07a9385cfdc6c99cac1ecf878 @@ -2213,11 +2213,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P f31042595b8f8a378db9778c9a8223b07ec02cf2f528581ba43bf72b5b03c964 -R e2636937135f5b30145a26001dbda091 -T *branch * cygwin-fixes -T *sym-cygwin-fixes * -T -sym-trunk * +P 205979813c7300debb5f1ba270583ef2f08e069d6d01865b5910702889a5c1ed +R cf9d3169fa65916adb28e6e37c49539f U stephan -Z a07a11eb75fd35bca8f25a9808dd0343 +Z d2a6db88a6d1b9751782d00b8ec047d5 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index c2a7b0c1e2..8930484fdf 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -205979813c7300debb5f1ba270583ef2f08e069d6d01865b5910702889a5c1ed +9868615b7d41179672dde2eafff878d50cf9d647c7050ccf5103e385fd182fc2 diff --git a/test/mmap2.test b/test/mmap2.test index 1f8346b915..df96671dfb 100644 --- a/test/mmap2.test +++ b/test/mmap2.test @@ -21,10 +21,10 @@ set testdir [file dirname $argv0] source $testdir/tester.tcl set testprefix mmap2 -if {$::tcl_platform(platform)!="unix" || [test_syscall defaultvfs] != "unix"} { +if {[llength [info commands test_syscall]]==0} { finish_test return -} +} ifcapable !mmap { finish_test return diff --git a/test/nockpt.test b/test/nockpt.test index 4cc61d11e1..84b2953e67 100644 --- a/test/nockpt.test +++ b/test/nockpt.test @@ -102,7 +102,9 @@ sqlite3_close_v2 $::db1 # Delete the database, wal and shm files. # -forcedelete test.db test.db-wal test.db-shm +catch {forcedelete test.db} +catch {forcedelete test.db-wal} +catch {forcedelete test.db-shm} # Open and populate a new database file at the same file-system location # as the one just deleted. Contrive a partial checkpoint on it. diff --git a/test/oserror.test b/test/oserror.test index a51301cc52..43d72569d9 100644 --- a/test/oserror.test +++ b/test/oserror.test @@ -16,7 +16,10 @@ set testdir [file dirname $argv0] source $testdir/tester.tcl -if {$::tcl_platform(platform)!="unix"} { finish_test ; return } +if {[llength [info commands test_syscall]]==0} { + finish_test + return +} set ::testprefix oserror db close diff --git a/test/pager4.test b/test/pager4.test index 2cf73d1b17..bec5bb645d 100644 --- a/test/pager4.test +++ b/test/pager4.test @@ -13,7 +13,7 @@ # is unlinked or renamed out from under SQLite. # -if {$tcl_platform(platform)!="unix"} return +if {$tcl_platform(os)=="Windows NT"} return set testdir [file dirname $argv0] source $testdir/tester.tcl diff --git a/test/shmlock.test b/test/shmlock.test index 89b29fd7ac..69c79ecc0a 100644 --- a/test/shmlock.test +++ b/test/shmlock.test @@ -114,7 +114,7 @@ sqlite3 db0 test.db sqlite3 db1 test.db do_test 3.1 { execsql { SELECT * FROM t1 } db0 } {1 2} do_test 3.2 { execsql { SELECT * FROM t1 } db1 } {1 2} -if {$tcl_platform(platform)=="windows"} { +if {$tcl_platform(os)=="Windows NT"} { set isWindows 1 } else { set isWindows 0 diff --git a/test/tkt3457.test b/test/tkt3457.test index 0273494639..17b6c72cd4 100644 --- a/test/tkt3457.test +++ b/test/tkt3457.test @@ -15,10 +15,10 @@ set testdir [file dirname $argv0] source $testdir/tester.tcl -if {$tcl_platform(platform) != "unix"} { +if {[llength [info commands test_syscall]]==0} { finish_test return -} +} if {[atomic_batch_write test.db]} { finish_test return diff --git a/test/unixexcl.test b/test/unixexcl.test index 8e9c4644d1..c24945e5e3 100644 --- a/test/unixexcl.test +++ b/test/unixexcl.test @@ -18,7 +18,7 @@ source $testdir/tester.tcl source $testdir/lock_common.tcl source $testdir/malloc_common.tcl -if {$::tcl_platform(platform)!="unix" || [info commands test_syscall]==""} { +if {[llength [info commands test_syscall]]==0} { finish_test return } diff --git a/test/wal64k.test b/test/wal64k.test index 8ff8e4b77c..bacb14328a 100644 --- a/test/wal64k.test +++ b/test/wal64k.test @@ -19,10 +19,10 @@ set testprefix wal64k ifcapable !wal {finish_test ; return } -if {$tcl_platform(platform) != "unix"} { +if {[llength [info commands test_syscall]]==0} { finish_test return -} +} db close test_syscall pagesize 65536 diff --git a/test/walnoshm.test b/test/walnoshm.test index d4082178dd..f546c29b13 100644 --- a/test/walnoshm.test +++ b/test/walnoshm.test @@ -104,6 +104,7 @@ do_test 2.1.5 { } {exclusive delete a b c d e f g h} do_test 2.2.1 { + db2 close forcecopy test.db test2.db forcecopy test.db-wal test2.db-wal sqlite3 db3 test2.db -vfs tvfsshm From 7b9407af9037776d7bb3dc4ae50fa92875dabf2e Mon Sep 17 00:00:00 2001 From: stephan Date: Fri, 7 Mar 2025 06:54:04 +0000 Subject: [PATCH 003/120] os_win.c patches for Cygwin (described in the cygwin-fixes branch wiki page). Makefile.msc's test target on trunk fails the same 13 tests as this branch. FossilOrigin-Name: 655c60d1926adb552d37441bf9857263eae92e3806a8524e8443b81fdfd8c258 --- manifest | 12 ++-- manifest.uuid | 2 +- src/os_win.c | 183 ++++++++++++++++++++++++++++++-------------------- 3 files changed, 116 insertions(+), 81 deletions(-) diff --git a/manifest b/manifest index e5ba89c851..05047b9793 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Merge\strunk\sinto\sthe\scygwin-fixes\sbranch\s(which\swas\sinadvertently\sbranched\stoo\searly). -D 2025-03-06T14:40:45.465 +C os_win.c\spatches\sfor\sCygwin\s(described\sin\sthe\scygwin-fixes\sbranch\swiki\spage).\sMakefile.msc's\stest\starget\son\strunk\sfails\sthe\ssame\s13\stests\sas\sthis\sbranch. +D 2025-03-07T06:54:04.344 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -767,7 +767,7 @@ F src/os_common.h 6c0eb8dd40ef3e12fe585a13e709710267a258e2c8dd1c40b1948a1d14582e F src/os_kv.c 4d39e1f1c180b11162c6dc4aa8ad34053873a639bac6baae23272fc03349986a F src/os_setup.h 6011ad7af5db4e05155f385eb3a9b4470688de6f65d6166b8956e58a3d872107 F src/os_unix.c 410185df4900817c218c0efdb8064b3481af88cb3f7cea7392f820b6eebc7889 -F src/os_win.c ab9912a2c1cb39a6429b8de919a5b63ad1c7775e511d748391c57bf9ad03bd29 +F src/os_win.c e58f0861b3b939a8f32c52fb8bfeaac45cabf13a5e0a546292b19df1700c0de5 F src/os_win.h 4c247cdb6d407c75186c94a1e84d5a22cbae4adcec93fcae8d2bc1f956fd1f19 F src/pager.c 9fbb541b46125dfa8914827575e6bb4d15048caa008073b1709112d495d7983b F src/pager.h 6137149346e6c8a3ddc1eeb40aee46381e9bc8b0fcc6dda8a1efde993c2275b8 @@ -2213,8 +2213,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 9868615b7d41179672dde2eafff878d50cf9d647c7050ccf5103e385fd182fc2 44adf8f38761a0d756c047f93fc76fc1d0aba8cc209970e3ba13e7040dd14b13 -R 6720fafd003ea32af768dea715e79f11 +P a7863b2e2fbea0ea11c494016b99921f70aae09607868aa65af988cbd173b31a +R ea5818813fceadcfc7cbbe3fe0406646 U stephan -Z 4921eb5838dff5a5d0b087efb7597040 +Z 4d833d4901925f4ec5cc4c393f5e8b1d # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 14e8ea62ac..a5d9460fb5 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a7863b2e2fbea0ea11c494016b99921f70aae09607868aa65af988cbd173b31a +655c60d1926adb552d37441bf9857263eae92e3806a8524e8443b81fdfd8c258 diff --git a/src/os_win.c b/src/os_win.c index dab8af34c4..feb7bd2c7e 100644 --- a/src/os_win.c +++ b/src/os_win.c @@ -617,7 +617,7 @@ static struct win_syscall { { "FileTimeToLocalFileTime", (SYSCALL)0, 0 }, #endif -#define osFileTimeToLocalFileTime ((BOOL(WINAPI*)(CONST FILETIME*, \ +#define osFileTimeToLocalFileTime ((BOOL(WINAPI*)(const FILETIME*, \ LPFILETIME))aSyscall[11].pCurrent) #if SQLITE_OS_WINCE @@ -626,7 +626,7 @@ static struct win_syscall { { "FileTimeToSystemTime", (SYSCALL)0, 0 }, #endif -#define osFileTimeToSystemTime ((BOOL(WINAPI*)(CONST FILETIME*, \ +#define osFileTimeToSystemTime ((BOOL(WINAPI*)(const FILETIME*, \ LPSYSTEMTIME))aSyscall[12].pCurrent) { "FlushFileBuffers", (SYSCALL)FlushFileBuffers, 0 }, @@ -970,7 +970,7 @@ static struct win_syscall { { "SystemTimeToFileTime", (SYSCALL)SystemTimeToFileTime, 0 }, -#define osSystemTimeToFileTime ((BOOL(WINAPI*)(CONST SYSTEMTIME*, \ +#define osSystemTimeToFileTime ((BOOL(WINAPI*)(const SYSTEMTIME*, \ LPFILETIME))aSyscall[56].pCurrent) #if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT @@ -1207,6 +1207,63 @@ static struct win_syscall { #define osCancelIo ((BOOL(WINAPI*)(HANDLE))aSyscall[81].pCurrent) +#if defined(SQLITE_WIN32_HAS_WIDE) && defined(_WIN32) + { "GetModuleHandleW", (SYSCALL)GetModuleHandleW, 0 }, +#else + { "GetModuleHandleW", (SYSCALL)0, 0 }, +#endif + +#define osGetModuleHandleW ((HMODULE(WINAPI*)(LPCWSTR))aSyscall[82].pCurrent) + +#ifndef _WIN32 + { "getenv", (SYSCALL)getenv, 0 }, +#else + { "getenv", (SYSCALL)0, 0 }, +#endif + +#define osGetenv ((const char *(*)(const char *))aSyscall[83].pCurrent) + +#ifndef _WIN32 + { "getcwd", (SYSCALL)getcwd, 0 }, +#else + { "getcwd", (SYSCALL)0, 0 }, +#endif + +#define osGetcwd ((char*(*)(char*,size_t))aSyscall[84].pCurrent) + +#ifndef _WIN32 + { "readlink", (SYSCALL)readlink, 0 }, +#else + { "readlink", (SYSCALL)0, 0 }, +#endif + +#define osReadlink ((ssize_t(*)(const char*,char*,size_t))aSyscall[85].pCurrent) + +#ifndef _WIN32 + { "lstat", (SYSCALL)lstat, 0 }, +#else + { "lstat", (SYSCALL)0, 0 }, +#endif + +#define osLstat ((int(*)(const char*,struct stat*))aSyscall[86].pCurrent) + +#ifndef _WIN32 + { "__errno", (SYSCALL)__errno, 0 }, +#else + { "__errno", (SYSCALL)0, 0 }, +#endif + +#define osErrno (*((int*(*)(void))aSyscall[87].pCurrent)()) + +#ifndef _WIN32 + { "cygwin_conv_path", (SYSCALL)cygwin_conv_path, 0 }, +#else + { "cygwin_conv_path", (SYSCALL)0, 0 }, +#endif + +#define osCygwin_conv_path ((size_t(*)(unsigned int, \ + const void *, void *, size_t))aSyscall[88].pCurrent) + }; /* End of the overrideable system calls */ /* @@ -1380,6 +1437,7 @@ int sqlite3_win32_reset_heap(){ } #endif /* SQLITE_WIN32_MALLOC */ +#ifdef _WIN32 /* ** This function outputs the specified (ANSI) string to the Win32 debugger ** (if available). @@ -1422,6 +1480,7 @@ void sqlite3_win32_write_debug(const char *zBuf, int nBuf){ } #endif } +#endif /* _WIN32 */ /* ** The following routine suspends the current thread for at least ms @@ -1781,28 +1840,29 @@ static char *winUnicodeToUtf8(LPCWSTR zWideText){ ** Space to hold the returned string is obtained from sqlite3_malloc(). */ static LPWSTR winMbcsToUnicode(const char *zText, int useAnsi){ - int nByte; + int nWideChar; LPWSTR zMbcsText; int codepage = useAnsi ? CP_ACP : CP_OEMCP; - nByte = osMultiByteToWideChar(codepage, 0, zText, -1, NULL, - 0)*sizeof(WCHAR); - if( nByte==0 ){ + nWideChar = osMultiByteToWideChar(codepage, 0, zText, -1, NULL, + 0); + if( nWideChar==0 ){ return 0; } - zMbcsText = sqlite3MallocZero( nByte*sizeof(WCHAR) ); + zMbcsText = sqlite3MallocZero( nWideChar*sizeof(WCHAR) ); if( zMbcsText==0 ){ return 0; } - nByte = osMultiByteToWideChar(codepage, 0, zText, -1, zMbcsText, - nByte); - if( nByte==0 ){ + nWideChar = osMultiByteToWideChar(codepage, 0, zText, -1, zMbcsText, + nWideChar); + if( nWideChar==0 ){ sqlite3_free(zMbcsText); zMbcsText = 0; } return zMbcsText; } +#ifdef _WIN32 /* ** Convert a Microsoft Unicode string to a multi-byte character string, ** using the ANSI or OEM code page. @@ -1830,6 +1890,7 @@ static char *winUnicodeToMbcs(LPCWSTR zWideText, int useAnsi){ } return zText; } +#endif /* _WIN32 */ /* ** Convert a multi-byte character string to UTF-8. @@ -1849,6 +1910,7 @@ static char *winMbcsToUtf8(const char *zText, int useAnsi){ return zTextUtf8; } +#ifdef _WIN32 /* ** Convert a UTF-8 string to a multi-byte character string. ** @@ -1898,6 +1960,7 @@ char *sqlite3_win32_unicode_to_utf8(LPCWSTR zWideText){ #endif return winUnicodeToUtf8(zWideText); } +#endif /* _WIN32 */ /* ** This is a public wrapper for the winMbcsToUtf8() function. @@ -1915,6 +1978,7 @@ char *sqlite3_win32_mbcs_to_utf8(const char *zText){ return winMbcsToUtf8(zText, osAreFileApisANSI()); } +#ifdef _WIN32 /* ** This is a public wrapper for the winMbcsToUtf8() function. */ @@ -2039,6 +2103,7 @@ int sqlite3_win32_set_directory( ){ return sqlite3_win32_set_directory16(type, zValue); } +#endif /* _WIN32 */ /* ** The return value of winGetLastErrorMsg @@ -4120,7 +4185,7 @@ static void *winConvertFromUtf8Filename(const char *zFilename){ if( osIsNT() ){ zConverted = winUtf8ToUnicode(zFilename); } -#ifdef SQLITE_WIN32_HAS_ANSI +#if defined(SQLITE_WIN32_HAS_ANSI) && defined(_WIN32) else{ zConverted = winUtf8ToMbcs(zFilename, osAreFileApisANSI()); } @@ -4949,7 +5014,7 @@ static winVfsAppData winNolockAppData = { ** sqlite3_vfs object. */ -#if defined(__CYGWIN__) +#ifndef _WIN32 /* ** Convert a filename from whatever the underlying operating system ** supports for filenames into UTF-8. Space to hold the result is @@ -5059,7 +5124,7 @@ static int winGetTempname(sqlite3_vfs *pVfs, char **pzBuf){ sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); } -#if defined(__CYGWIN__) +#ifndef _WIN32 else{ static const char *azDirs[] = { 0, /* getenv("SQLITE_TMPDIR") */ @@ -5076,11 +5141,11 @@ static int winGetTempname(sqlite3_vfs *pVfs, char **pzBuf){ unsigned int i; const char *zDir = 0; - if( !azDirs[0] ) azDirs[0] = getenv("SQLITE_TMPDIR"); - if( !azDirs[1] ) azDirs[1] = getenv("TMPDIR"); - if( !azDirs[2] ) azDirs[2] = getenv("TMP"); - if( !azDirs[3] ) azDirs[3] = getenv("TEMP"); - if( !azDirs[4] ) azDirs[4] = getenv("USERPROFILE"); + if( !azDirs[0] ) azDirs[0] = osGetenv("SQLITE_TMPDIR"); + if( !azDirs[1] ) azDirs[1] = osGetenv("TMPDIR"); + if( !azDirs[2] ) azDirs[2] = osGetenv("TMP"); + if( !azDirs[3] ) azDirs[3] = osGetenv("TEMP"); + if( !azDirs[4] ) azDirs[4] = osGetenv("USERPROFILE"); for(i=0; i=pVfs->mxPathname ); - if ( sqlite3_data_directory && !winIsVerbatimPathname(zRelative) ){ - /* - ** NOTE: We are dealing with a relative path name and the data - ** directory has been set. Therefore, use it as the basis - ** for converting the relative path name to an absolute - ** one by prepending the data directory and a slash. - */ - char *zOut = sqlite3MallocZero( 1+(u64)pVfs->mxPathname ); - if( !zOut ){ - return SQLITE_IOERR_NOMEM_BKPT; - } - if( cygwin_conv_path( - (osIsNT() ? CCP_POSIX_TO_WIN_W : CCP_POSIX_TO_WIN_A) | - CCP_RELATIVE, zRelative, zOut, pVfs->mxPathname+1)<0 ){ - sqlite3_free(zOut); - return winLogError(SQLITE_CANTOPEN_CONVPATH, (DWORD)errno, - "winFullPathname1", zRelative); - }else{ - char *zUtf8 = winConvertToUtf8Filename(zOut); - if( !zUtf8 ){ - sqlite3_free(zOut); - return SQLITE_IOERR_NOMEM_BKPT; - } - sqlite3_snprintf(MIN(nFull, pVfs->mxPathname), zFull, "%s%c%s", - sqlite3_data_directory, winGetDirSep(), zUtf8); - sqlite3_free(zUtf8); - sqlite3_free(zOut); - } + char *zOut = sqlite3MallocZero( pVfs->mxPathname+1 ); + if( !zOut ){ + return SQLITE_IOERR_NOMEM_BKPT; + } + if( osCygwin_conv_path( + CCP_POSIX_TO_WIN_W, + zRelative, zOut, pVfs->mxPathname+1)<0 ){ + sqlite3_free(zOut); + return winLogError(SQLITE_CANTOPEN_CONVPATH, (DWORD)errno, + "winFullPathname2", zRelative); }else{ - char *zOut = sqlite3MallocZero( pVfs->mxPathname+1 ); - if( !zOut ){ + char *zUtf8 = winConvertToUtf8Filename(zOut); + if( !zUtf8 ){ + sqlite3_free(zOut); return SQLITE_IOERR_NOMEM_BKPT; } - if( cygwin_conv_path( - (osIsNT() ? CCP_POSIX_TO_WIN_W : CCP_POSIX_TO_WIN_A), - zRelative, zOut, pVfs->mxPathname+1)<0 ){ - sqlite3_free(zOut); - return winLogError(SQLITE_CANTOPEN_CONVPATH, (DWORD)errno, - "winFullPathname2", zRelative); - }else{ - char *zUtf8 = winConvertToUtf8Filename(zOut); - if( !zUtf8 ){ - sqlite3_free(zOut); - return SQLITE_IOERR_NOMEM_BKPT; - } - sqlite3_snprintf(MIN(nFull, pVfs->mxPathname), zFull, "%s", zUtf8); - sqlite3_free(zUtf8); - sqlite3_free(zOut); - } + sqlite3_snprintf(MIN(nFull, pVfs->mxPathname), zFull, "%s", zUtf8); + sqlite3_free(zUtf8); + sqlite3_free(zOut); } return SQLITE_OK; #endif -#if (SQLITE_OS_WINCE || SQLITE_OS_WINRT) && !defined(__CYGWIN__) +#if (SQLITE_OS_WINCE || SQLITE_OS_WINRT) && defined(_WIN32) SimulateIOError( return SQLITE_ERROR ); /* WinCE has no concept of a relative pathname, or so I am told. */ /* WinRT has no way to convert a relative path to an absolute one. */ @@ -5953,7 +5988,7 @@ static int winFullPathnameNoMutex( return SQLITE_OK; #endif -#if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT && !defined(__CYGWIN__) +#if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT && defined(_WIN32) /* It's odd to simulate an io-error here, but really this is just ** using the io-error infrastructure to test that SQLite handles this ** function failing. This function could fail if, for example, the @@ -6056,7 +6091,7 @@ static int winFullPathname( */ static void *winDlOpen(sqlite3_vfs *pVfs, const char *zFilename){ HANDLE h; -#if defined(__CYGWIN__) +#ifndef _WIN32 int nFull = pVfs->mxPathname+1; char *zFull = sqlite3MallocZero( nFull ); void *zConverted = 0; @@ -6423,7 +6458,7 @@ int sqlite3_os_init(void){ /* Double-check that the aSyscall[] array has been constructed ** correctly. See ticket [bb3a86e890c8e96ab] */ - assert( ArraySize(aSyscall)==82 ); + assert( ArraySize(aSyscall)==89 ); /* get memory map allocation granularity */ memset(&winSysInfo, 0, sizeof(SYSTEM_INFO)); From 065c0a612039ca264e7b7f3bfc40409ca3b2c06d Mon Sep 17 00:00:00 2001 From: stephan Date: Sat, 8 Mar 2025 06:53:06 +0000 Subject: [PATCH 004/120] Test app/script patches from Jan Nijtmans for cygwin. Add/replace many more sentinel arguments for TCL variadic functions which specifically need a NULL trailing argument. With this, 'make test' on cygwin runs to completion for me, with 134 of 329227 tests failing. MSC build fails the same 13 tests which fail for me in trunk. FossilOrigin-Name: 84d8fcfca19cd183d05a702d0eb1742bfae462d3383a3db72741a48cefac1058 --- manifest | 68 +++++++++++++------------- manifest.uuid | 2 +- src/test1.c | 98 +++++++++++++++++++------------------- src/test2.c | 34 ++++++------- src/test3.c | 29 +++++------ src/test4.c | 30 ++++++------ src/test5.c | 4 +- src/test6.c | 6 +-- src/test_hexio.c | 2 +- src/test_init.c | 2 +- src/test_vfs.c | 2 +- test/backup2.test | 2 +- test/crash8.test | 2 +- test/extension01.test | 4 +- test/external_reader.test | 2 +- test/io.test | 2 +- test/journal3.test | 2 +- test/loadext.test | 8 +++- test/pager1.test | 10 ++-- test/pager4.test | 2 +- test/pagerfault.test | 2 +- test/shared6.test | 2 +- test/shmlock.test | 2 +- test/symlink.test | 2 +- test/sync.test | 2 +- test/sync2.test | 2 +- test/wal2.test | 6 +-- test/wal6.test | 4 +- test/walmode.test | 2 +- test/walro.test | 2 +- tool/sqlite3_analyzer.c.in | 2 +- 31 files changed, 172 insertions(+), 167 deletions(-) diff --git a/manifest b/manifest index 05047b9793..e4a0cf25eb 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C os_win.c\spatches\sfor\sCygwin\s(described\sin\sthe\scygwin-fixes\sbranch\swiki\spage).\sMakefile.msc's\stest\starget\son\strunk\sfails\sthe\ssame\s13\stests\sas\sthis\sbranch. -D 2025-03-07T06:54:04.344 +C Test\sapp/script\spatches\sfrom\sJan\sNijtmans\sfor\scygwin.\sAdd/replace\smany\smore\ssentinel\sarguments\sfor\sTCL\svariadic\sfunctions\swhich\sspecifically\sneed\sa\sNULL\strailing\sargument.\sWith\sthis,\s'make\stest'\son\scygwin\sruns\sto\scompletion\sfor\sme,\swith\s134\sof\s329227\stests\sfailing.\sMSC\sbuild\sfails\sthe\ssame\s13\stests\swhich\sfail\sfor\sme\sin\strunk. +D 2025-03-08T06:53:06.819 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -792,12 +792,12 @@ F src/status.c 0e72e4f6be6ccfde2488eb63210297e75f569f3ce9920f6c3d77590ec6ce5ffd F src/table.c 0f141b58a16de7e2fbe81c308379e7279f4c6b50eb08efeec5892794a0ba30d1 F src/tclsqlite.c 5875b959c3262d93b32893540c40d4ebb111495adc80db3ee0ddd440966ddcd5 F src/tclsqlite.h 65e2c761446e1c9fa0342b7d2612a703483643c8b6a316d12a65b745a4727395 -F src/test1.c 4e3dbca39c1728e45f8bf9aacb5a02290f84bf845af138337a83293ff6e228db -F src/test2.c 1659a6ac3798fdf950d5edb4b3ec621553e903eb0d3ec6ef3016cb8fcacee939 -F src/test3.c 4a151b3db6cf6623515ea0888b06f6ef322a77e2f9589aa227ab2ce56f59aa1e -F src/test4.c ba4656d94dc2a8ea0ca5dd30d9cfec2a3cc729ab46fb5468663a34d32ce7d2f1 -F src/test5.c 238495115aeee18b11e825064bb51f2c0378bc724d9f47b92cf87dedb711104f -F src/test6.c 3e489ba6855e08d2b33b5e80e490923712f4f17751e61e2d19e31ad8a2757a2f +F src/test1.c ccfef3b483ce4204741347cb1514d997365f21d6aef79343a216f3c126e79282 +F src/test2.c 62f0830958f9075692c29c6de51b495ae8969e1bef85f239ffcd9ba5fb44a5ff +F src/test3.c 432646f581d8af1bb495e58fc98234380250954f5d5535e507fc785eccc3987a +F src/test4.c 0ac87fc13cdb334ab3a71823f99b6c32a6bebe5d603cd6a71d84c823d43a25a0 +F src/test5.c 38fa635a70a94f2aa8b47ecbab15d821386205d27ad4159c3551ab3ba45efa11 +F src/test6.c 9722054d37257459f1b8988e59e7db1dd630bfb291f16b2759764e778a9d1899 F src/test8.c 206d8f3cc73950d252906656e2646b5de0d580b07187b635fcb3edd8c2c5fbc0 F src/test9.c df9ddc7db6ef1b8cf745866ee229090779728bcbe660c7f297d3127ab21d92af F src/test_autoext.c 14d4bbd3d0bd1eec0f6d16b29e28cf1e2d0b020d454835f0721a5f68121ac10f @@ -811,8 +811,8 @@ F src/test_demovfs.c 3efa2adf4f21e10d95521721687d5ca047aea91fa62dd8cc22ac9e5a9c9 F src/test_devsym.c 649434ed34d0b03fbd5a6b42df80f0f9a7e53f94dd1710aad5dd8831e91c4e86 F src/test_fs.c 6711fd4c6c05914b613cfc99918a24978452f999ce03fc8f89c9794c03b20a5b F src/test_func.c 858d4dddb7acf88222ebcba7cffb585f6dde83e4a15b838c0d05ccdf8d5219b9 -F src/test_hexio.c 3fa6b830863872a89ad0e175ea5dcc1ac29fedc257687bc27fb6a4f873e70d92 -F src/test_init.c 17313332d58e90defc527129d5eda4a08bd6b6e8de7207a231523c8d98fb445e +F src/test_hexio.c a90baa0a8ab5e7cfe2216a61c9a31cfd1f8378353a3d23e25fa94c09aa755bb0 +F src/test_init.c 1649e02448f536e53172f6b1ff873254fe9a0c6c8a4502a2d25c0cc7b11945ea F src/test_intarray.c 3fcf8ca7bb5c8776ea83f6aa9b66f8df0d1f37a99207b0097c8486f9c15cedbf F src/test_intarray.h 6c3534641108cd1bea517a8e117dcba237081310a29a4c35bd2190caa8972293 F src/test_journal.c a0b9709b2f12b1ec819eea8a1176f283bca6d688a6d4a502bd6fd79786f4e287 @@ -836,7 +836,7 @@ F src/test_tclsh.c c01706ac60bd3176754d3ccd37da74c6ad97c2e14489f8ed71b497c1c0ac0 F src/test_tclvar.c ae873248a0188459b1c16ca7cc431265dacce524399e8b46725c2b3b7e048424 F src/test_thread.c 3edb4a5b5aeb1a6e9a275dccc848ac95acab7f496b3e9230f6d2d04953a2b862 F src/test_vdbecov.c 5c426d9cd2b351f5f9ceb30cabf8c64a63bfcad644c507e0bd9ce2f6ae1a3bf3 -F src/test_vfs.c 0280aa8ada70e8b23b258e28afb1d49b8228b057fbae0bcde11db099b790b318 +F src/test_vfs.c b4135c1308516adf0dfd494e6d6c33114e03732be899eace0502919b674586b5 F src/test_windirent.c a895e2c068a06644eef91a7f0a32182445a893b9a0f33d0cdb4283dca2486ac1 F src/test_windirent.h da2e5b73c32d09905fbdd00f27cd802212a32a58ead882736fe4f5eb775ebc50 F src/test_window.c 6d80e11fba89a1796525e6f0048ff0c7789aa2c6b0b11c80827dc1437bd8ea72 @@ -940,7 +940,7 @@ F test/avfs.test 76f59743dc1f5fa533840d1818b420fe1ee45e21c0fd6bbac7942ba67790312 F test/avtrans.test b7dc25459ecbd86c6fa9c606ee3068f59d81e225118617dcf2bbb6ded2ade89e F test/backcompat.test f2431465ed668f09fc3f6998e56e893a1506ccea6e8b6f409f085f759f431b48 F test/backup.test 3b08fd4af69f0fa786931103a31f4542b184aba16e239e5f22b18c3c2476697f -F test/backup2.test 8facb54df1388419d34b362ab1f7e233310ff3a3af64e8ad5ec47ba3c2bbe5cf +F test/backup2.test b153553ee5667b0748b43346b0725fbf80ce1f5544613bf087d669778b60ec56 F test/backup4.test 8f6fd48e0dfde77b9a3bb26dc471ede3e101df32 F test/backup5.test ee5da6d7fe5082f5b9b0bbfa31d016f52412a2e4 F test/backup_ioerr.test 4c3c7147cee85b024ecf6e150e090c32fdbb5135 @@ -1060,7 +1060,7 @@ F test/crash4.test fe2821baf37168dc59dd733dcf7dba2a401487bc F test/crash5.test 4aa55e7ac3c4bc511873e457aa65d2827d52da9b51e061511899dadcfe22b1e8 F test/crash6.test 4c56f1e40d0291e1110790a99807aa875b1647ba F test/crash7.test 1a194c4900a255258cf94b7fcbfd29536db572df -F test/crash8.test 64366e459c28dd62edfb7ad87253a409c7533b92d16fcc479a6a8131bdcc3100 +F test/crash8.test 3a0c39c079b441a9b1da22e3edb58817f9dd330c4c3a7f9dd1f9f7c8368ea352 F test/crashM.test d95f59046fa749b0d0822edf18a717788c8f318d F test/crashtest1.c 09c1c7d728ccf4feb9e481671e29dda5669bbcc2 F test/createtab.test 85cdfdae5c3de331cd888d6c66e1aba575b47c2e3c3cc4a1d6f54140699f5165 @@ -1141,8 +1141,8 @@ F test/expr.test 5c06696478212e5a04e04b043f993373f6f8e5ce5a80f5548a84703b123b6ca F test/expr2.test c27327ae9c017a7ff6280123f67aff496f912da74d78c888926d68b46ec75fd8 F test/exprfault.test da33606d799718e2f8e34efd0e5858884a1ad87f608774c552a7f5517cc27181 F test/exprfault2.test c49e84273898969af5dbc4fe6a3f4335f14639799f343590336c9ddf84425965 -F test/extension01.test 00d13cec817f331a687a243e0e5a2d87b0e358c9 -F test/external_reader.test c7d34694f1b25c32d866f56ac80c1e29edddc42b4ef90cad589263ffac2cde0c +F test/extension01.test 5de412c66276105901c370770175003381fdcb0c4da7054fa43cf4a31e0bfa3a +F test/external_reader.test 6fdec43eeca23eb32faad1e95a4d1abc402bc8b3db70df12d6fc08a637f4a2b5 F test/extraquick.test cb254400bd42bfb777ff675356aabf3287978f79 F test/fallocate.test 37a62e396a68eeede8f8d2ecf23573a80faceb630788d314d0a073d862616717 F test/filectrl.test 7e6788759997139632eb700765d5f73d53fc5ff5d9d778e773911750ab134321 @@ -1349,7 +1349,7 @@ F test/interrupt.test ac1ef50ec9ab8e4f0e17c47629f82539d4b22558904e321ed5abea2e61 F test/interrupt2.test e4408ca770a6feafbadb0801e54a0dcd1a8d108d F test/intpkey.test aee694afed1a65c86c4e69ad030224b3fc268113d00685234d40079fca16bad3 F test/intreal.test 68829a8bb073ee1610ca3f8f9e0f99b0371fb36e0fa64862dd5ced4ef03c2343 -F test/io.test f138f3fe696d1ed8c51dfea5b325910d319a1b29e1d25ea57231a02092f02cca +F test/io.test 998a37d03bb45477ad0d5ad1c118b2940c06fcc34ac54ccd2784efd1bd45a93e F test/ioerr.test c94eef1cd8bfc36f9aa493e41e151e9160281ac8e2d960cc9dcdcc8e6aa99ab3 F test/ioerr2.test 2593563599e2cc6b6b4fcf5878b177bdd5d8df26 F test/ioerr3.test d3cec5e1a11ad6d27527d0d38573fbff14c71bdd @@ -1375,7 +1375,7 @@ F test/joinF.test 53dd66158806823ea680dd7543b5406af151b5aafa5cd06a7f3231cd949381 F test/joinH.test 55f69e64da74d4eca2235237f3acb657aef181e22e45daa228e35bba865e0255 F test/journal1.test c7b768041b7f494471531e17abc2f4f5ebf9e5096984f43ed17c4eb80ba34497 F test/journal2.test 9dac6b4ba0ca79c3b21446bbae993a462c2397c4 -F test/journal3.test 7c3cf23ffc77db06601c1fcfc9743de8441cb77db9d1aa931863d94f5ffa140e +F test/journal3.test e5aeff93a7776cf644dbc48dec277655cff80a1cd24689036abc87869b120ea6 F test/jrnlmode.test 9b5bc01dac22223cb60ec2d5f97acf568d73820794386de5634dcadbea9e1946 F test/jrnlmode2.test 8759a1d4657c064637f8b079592651530db738419e1d649c6df7048cd724363d F test/jrnlmode3.test 556b447a05be0e0963f4311e95ab1632b11c9eaa @@ -1408,7 +1408,7 @@ F test/limit2.test 9409b033284642a859fafc95f29a5a6a557bd57c1f0d7c3f554bd64ed69df F test/literal.test a65dca9fef86e51b8e45544268e37abbd4bb94ba35fd65f6fdcab2f288cd8f79 F test/literal2.tcl 1499037beaf661aeecdbe48801220a181d805372a64c6128d5f26bb6a4a8f0ce F test/literal2.test b149e16b5fc9ee6249069a8858ed41052f222014fe0ba7ad43c2fb989c2dada2 -F test/loadext.test faa4f6eed07a5aac35d57fdd7bc07f8fc82464cfd327567c10cf0ba3c86cde04 +F test/loadext.test 878db71cf74b48250dbe9033bbfe6088ff869db3353ffd4febc68c0cd459959e F test/loadext2.test 0408380b57adca04004247179837a18e866a74f7 F test/lock.test 05f346b65040b9a27c032c984e1e509dfef1661135b4f26a3ab6d21358277803 F test/lock2.test 5242d8ac4e2d59c403aebff606af449b455aceff @@ -1517,11 +1517,11 @@ F test/oserror.test ee3fad06ec8671c4d047c2c92a567fc2e0e8161caaec7edd6d48325c5ac9 F test/ossfuzz.c 9636dad2092a05a32110df0ca06713038dd0c43dd89a77dabe4b8b0d71096715 F test/ossshell.c f125c5bd16e537a2549aa579b328dd1c59905e7ab1338dfc210e755bb7b69f17 F test/ovfl.test 199c482696defceacee8c8e0e0ef36da62726b2f -F test/pager1.test ffd885cdc98b986c9f746496508c0c4810ed0eaade3575ddf53c222e85880552 +F test/pager1.test 05531a43594663fd67de7048201dafc35164d93f209995ce4afffae05f30ef05 F test/pager2.test c0ede15952b607f9a38f653acdfa73c19e657958e9104aab1a71950ea7b71831 F test/pager3.test 4e9a83d6ca0838d7c602c9eb93d1357562d9059c1e02ffb138a8271020838370 -F test/pager4.test 98837730b0d3fe8002706e1c7c3b2e43db19f9a369d671c20307473c39efc64e -F test/pagerfault.test 63c5da625562c66345ab4528790327ca63db2f6f9cbae2aba8cb7c51de3d1628 +F test/pager4.test b995066c699472614eb5949db5a2e2c51fd463863518afe68675d7fac09216bd +F test/pagerfault.test 43692e660fe480812dc5d44171fdcb8da1a65a644428def1ee9de79edace4028 F test/pagerfault2.test caf4c7facb914fd3b03a17b31ae2b180c8d6ca1f F test/pagerfault3.test 1003fcda009bf48a8e22a516e193b6ef0dd1bbd8 F test/pageropt.test 84e4cc5cbca285357f7906e99b21be4f2bf5abc0 @@ -1630,7 +1630,7 @@ F test/shared.test c99510b83a6ad650d7335e4733568b9d7b4f5ee88f4f2167b6138950a795b F test/shared2.test 03eb4a8d372e290107d34b6ce1809919a698e879 F test/shared3.test f8cd07c1a2b7cdb315c01671a0b2f8e3830b11ef31da6baa9a9cd8da88965403 F test/shared4.test c75f476804e76e26bf6fa0e7b421fb0ca7d07558 -F test/shared6.test 866bb4982c45ce216c61ded5e8fde4e7e2f3ffa9 +F test/shared6.test 104e1e25b4c4f47aaccca7dba75b3d87bb505b46b009af03ae49bf55b7c4976c F test/shared7.test a81e99f83e6c51b02ac99c96fb3a2a7b5978c956 F test/shared8.test 933ed7d71f598bb6c7a8c192a3cd30f2562fdccf514df383798599c34ffa672f F test/shared9.test 600a257fe9d8b0272746b230e761aa1bd8802ca4cf3ba5b2136b9204f3d51efa @@ -1648,7 +1648,7 @@ F test/shell7.test 43fd8e511c533bab5232e95c7b4be93b243451709e89582600d4b6e67693d F test/shell8.test aea51ecbcd4494c746b096aeff51d841d04d5f0dc4b62eb42427f16109b87acd F test/shell9.test 8742a5b390cdcef6369f5aa223e415aa4255a4129ef249b177887dc635a87209 F test/shellA.test 079c05c11947ade4ea8d51053d3abb687ec96a3dce6680d01838519b705190c5 -F test/shmlock.test ca560c2cd8197ca2c75be31060918c39fb1cd44de9434b61d1b376b96c0e42fa +F test/shmlock.test 9f1f729a7fe2c46c88b156af819ac9b72c0714ac6f7246638a73c5752b5fd13c F test/shortread1.test bb591ef20f0fd9ed26d0d12e80eee6d7ac8897a3 F test/show_speedtest1_rtree.tcl 32e6c5f073d7426148a6936a0408f4b5b169aba5 F test/shrink.test 2668e607dcdfa19c52828c09b69685b38da793856582ae31debf79d90c7bbbdc @@ -1711,10 +1711,10 @@ F test/swarmvtab.test 250231404fcac88f61a6c147bb0e3a118ed879278cd3ccb0ae2d3a729e F test/swarmvtab2.test c948cb2fdfc5b01d85e8f6d6504854202dc1a0782ab2a0ed61538f27cbd0aa5c F test/swarmvtab3.test 41a3ab47cb7a834d4e5336425103b617410a67bb95d335ef536f887587ece073 F test/swarmvtabfault.test 8a67a9f27c61073a47990829e92bc0c64420a807cb642b15a25f6c788210ed95 -F test/symlink.test 4368af0e213dd6e726a6240a16f2bb96a5a58f83f2d5d60652f27547b28cbf06 +F test/symlink.test 60e16915cd0ee068244563f354ae012149cf7541e922025e31ac613e3fa3e389 F test/symlink2.test bf932ff7fe95c9dbb39d2a990df9098b0ea943233c97e40098e0a8d6b559a96f -F test/sync.test 89539f4973c010eda5638407e71ca7fddbcd8e0594f4c9980229f804d4333092 -F test/sync2.test 8f9f7d4f6d5be8ca8941a8dadcc4299e558cb6a1ff653a9469146c7a76ef2039 +F test/sync.test a619e407ede58a7b6e3e44375328628559fc9695a9c24c47cb5690a866b0031b +F test/sync2.test 06152269ed73128782c450c355988fe8dd794d305833af75e1a5e79edd4dae47 F test/syscall.test a067468b43b8cb2305e9f9fe414e5f40c875bb5d2cba5f00b8154396e95fcf37 F test/sysfault.test c9f2b0d8d677558f74de750c75e12a5454719d04 F test/tabfunc01.test 7be82bd50c7ede7f01b2dd17cd1b84f352c516078222d0b067d858f081e3f9a7 @@ -1997,11 +1997,11 @@ F test/vtabdistinct.test 7688f0889358f849fd60bbfde1ded38b014b18066076d4bfbb75395 F test/vtabdrop.test 65d4cf6722972e5499bdaf0c0d70ee3b8133944a4e4bc31862563f32a7edca12 F test/vtabrhs1.test 9b5ecbc74a689500c33a4b2b36761f9bcc22fcc4e3f9d21066ee0c9c74cf5f6c F test/wal.test 519c550255c78f55959e9159b93ebbfad2b4e9f36f5b76284da41f572f9d27da -F test/wal2.test e89ca97593b5e92849039f6b68ce1719a853ef20fa22c669ec1ac452fbc31cab +F test/wal2.test f058016abe4627d2664db4b4b87990298d925e66a4c5a2c8e674a0ff6f4c841d F test/wal3.test 5de023bb862fd1eb9d2ad26fa8d9c43abb5370582e5b08b2ae0d6f93661bc310 F test/wal4.test 4744e155cd6299c6bd99d3eab1c82f77db9cdb3c F test/wal5.test 9c11da7aeccd83a46d79a556ad11a18d3cb15aa9 -F test/wal6.test b602704e4b066199bc89d91ca9000f335dcf4572 +F test/wal6.test 6a773eff47b989c5142d17f2a7778c02d8260149a648d44ef8345aa080e428e3 F test/wal64k.test bb8c52f0140aae1de877ffed86e2a97d903f98cf9ac263f185d51c58cde92327 F test/wal7.test 2ae8f427d240099cc4b2dfef63cff44e2a68a1bd F test/wal8.test d9df3fba4caad5854ed69ed673c68482514203c8 @@ -2018,13 +2018,13 @@ F test/walcrash4.test e7b6e7639a950a0cca8e210e248c8dad4d63bf20 F test/walfault.test 09b8ad7e52d2f54bce50e31aa7ea51412bb9f70ac13c74e669ddcd8b48b0d98d F test/walfault2.test e039ac66c78d5561683cacde04097213cdad3b58e2b3f3fe1112862217bfd915 F test/walhook.test ed00a40ba7255da22d6b66433ab61fab16a63483 -F test/walmode.test cd6e7cff618eaaa5910ce57c3657aa50110397f86213886a2400afb9bfec7b7b +F test/walmode.test 2a5530972948948a17211e070263fcf25ef1ca4e06d742a32d81a470b91441dc F test/walnoshm.test 844b3eb7d8e8ee76c834ef723babec57b0be51fa52ef7e321c289ed0fe3cddc2 F test/waloverwrite.test dad2f26567f1b45174e54fbf9a8dc1cb876a7f03 F test/walpersist.test 8d78a1ec91299163451417b451a2bac3481f8eb9f455b1ca507a6625c927ca6e F test/walprotocol.test 1b3f922125e341703f6e946d77fdc564d38fb3e07a9385cfdc6c99cac1ecf878 F test/walprotocol2.test 7d3b6b4bf0b12f8007121b1e6ef714bc99101fb3b48e46371df1db868eebc131 -F test/walro.test cb438d05ba0d191f10b688e39c4f0cd5b71569a1d1f4440e5bdf3c6880e08c20 +F test/walro.test 78a84bc0fdae1385c06b017215c426b6845734d6a5a3ac75c918dd9b801b1b9d F test/walro2.test 33955a6fd874dd9724005e17f77fef89d334b3171454a1256fe4941a96766cdc F test/walrofault.test c70cb6e308c443867701856cce92ad8288cd99488fa52afab77cca6cfd51af68 F test/walseh1.test bae700eb99519b6d5cd3f893c04759accc5a59c391d4189fe4dd6995a533442b @@ -2193,7 +2193,7 @@ F tool/speedtest8inst1.c 7ce07da76b5e745783e703a834417d725b7d45fd F tool/spellsift.tcl 52b4b04dc4333c7ab024f09d9d66ed6b6f7c6eb00b38497a09f338fa55d40618 x F tool/split-sqlite3c.tcl 07e18a1d8cc3f6b3a4a1f3528e63c9b29a5c8a7bca0b8d394b231da464ce1247 F tool/sqldiff.c 134be7866be19f8beb32043d5aea5657f01aaeae2df8d33d758ff722c78666b9 -F tool/sqlite3_analyzer.c.in fc7735c499d226a49d843d8209b2543e4e5229eeb71a674c331323a2217b65b4 +F tool/sqlite3_analyzer.c.in 51bb46e23ee549474f246094dc4f2fdf176b40a02d8ff84aaabebec3ba4cf0eb F tool/sqlite3_rsync.c 9a1cca2ab1271c59b37a6493c15dc1bcd0ab9149197a9125926bc08dd26b83fb F tool/sqltclsh.c.in 1bcc2e9da58fadf17b0bf6a50e68c1159e602ce057210b655d50bad5aaaef898 F tool/sqltclsh.tcl 862f4cf1418df5e1315b5db3b5ebe88969e2a784525af5fbf9596592f14ed848 @@ -2213,8 +2213,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P a7863b2e2fbea0ea11c494016b99921f70aae09607868aa65af988cbd173b31a -R ea5818813fceadcfc7cbbe3fe0406646 +P 655c60d1926adb552d37441bf9857263eae92e3806a8524e8443b81fdfd8c258 +R dedab2d958c1519d729d7e43fcb4e763 U stephan -Z 4d833d4901925f4ec5cc4c393f5e8b1d +Z 95c4e252b087a749ba1f87b7c9a4b7ac # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index a5d9460fb5..9e4d522ee4 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -655c60d1926adb552d37441bf9857263eae92e3806a8524e8443b81fdfd8c258 +84d8fcfca19cd183d05a702d0eb1742bfae462d3383a3db72741a48cefac1058 diff --git a/src/test1.c b/src/test1.c index ac3070886e..70fb305f39 100644 --- a/src/test1.c +++ b/src/test1.c @@ -3350,7 +3350,7 @@ static int SQLITE_TCLAPI test_collate( bad_args: Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetStringFromObj(objv[0], 0), " ", 0); + Tcl_GetStringFromObj(objv[0], 0), " ", NULL); return TCL_ERROR; } @@ -3629,7 +3629,7 @@ static int SQLITE_TCLAPI test_function( return TCL_OK; bad_args: Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetStringFromObj(objv[0], 0), " ", 0); + Tcl_GetStringFromObj(objv[0], 0), " ", NULL); #endif /* SQLITE_OMIT_UTF16 */ return TCL_ERROR; } @@ -3777,7 +3777,7 @@ static int SQLITE_TCLAPI test_bind_int( if( objc!=4 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetStringFromObj(objv[0], 0), " STMT N VALUE", 0); + Tcl_GetStringFromObj(objv[0], 0), " STMT N VALUE", NULL); return TCL_ERROR; } @@ -3954,7 +3954,7 @@ static int SQLITE_TCLAPI test_bind_int64( if( objc!=4 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetStringFromObj(objv[0], 0), " STMT N VALUE", 0); + Tcl_GetStringFromObj(objv[0], 0), " STMT N VALUE", NULL); return TCL_ERROR; } @@ -4010,7 +4010,7 @@ static int SQLITE_TCLAPI test_bind_double( if( objc!=4 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetStringFromObj(objv[0], 0), " STMT N VALUE", 0); + Tcl_GetStringFromObj(objv[0], 0), " STMT N VALUE", NULL); return TCL_ERROR; } @@ -4067,7 +4067,7 @@ static int SQLITE_TCLAPI test_bind_null( if( objc!=3 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetStringFromObj(objv[0], 0), " STMT N", 0); + Tcl_GetStringFromObj(objv[0], 0), " STMT N", NULL); return TCL_ERROR; } @@ -4107,7 +4107,7 @@ static int SQLITE_TCLAPI test_bind_text( if( objc!=5 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetStringFromObj(objv[0], 0), " STMT N VALUE BYTES", 0); + Tcl_GetStringFromObj(objv[0], 0), " STMT N VALUE BYTES", NULL); return TCL_ERROR; } @@ -4167,7 +4167,7 @@ static int SQLITE_TCLAPI test_bind_text16( if( objc!=5 && objc!=6){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetStringFromObj(objv[0], 0), " STMT N VALUE BYTES", 0); + Tcl_GetStringFromObj(objv[0], 0), " STMT N VALUE BYTES", NULL); return TCL_ERROR; } @@ -4220,7 +4220,7 @@ static int SQLITE_TCLAPI test_bind_blob( if( objc!=5 && objc!=6 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetStringFromObj(objv[0], 0), " STMT N DATA BYTES", 0); + Tcl_GetStringFromObj(objv[0], 0), " STMT N DATA BYTES", NULL); return TCL_ERROR; } @@ -4718,7 +4718,7 @@ static int SQLITE_TCLAPI test_ex_errcode( if( objc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " DB", 0); + Tcl_GetString(objv[0]), " DB", NULL); return TCL_ERROR; } if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR; @@ -4745,7 +4745,7 @@ static int SQLITE_TCLAPI test_errcode( if( objc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " DB", 0); + Tcl_GetString(objv[0]), " DB", NULL); return TCL_ERROR; } if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR; @@ -4771,7 +4771,7 @@ static int SQLITE_TCLAPI test_errmsg( if( objc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " DB", 0); + Tcl_GetString(objv[0]), " DB", NULL); return TCL_ERROR; } if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR; @@ -4799,7 +4799,7 @@ static int SQLITE_TCLAPI test_error_offset( if( objc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " DB", 0); + Tcl_GetString(objv[0]), " DB", NULL); return TCL_ERROR; } if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR; @@ -4831,7 +4831,7 @@ static int SQLITE_TCLAPI test_errmsg16( if( objc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " DB", 0); + Tcl_GetString(objv[0]), " DB", NULL); return TCL_ERROR; } if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR; @@ -4870,7 +4870,7 @@ static int SQLITE_TCLAPI test_prepare( if( objc!=5 && objc!=4 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " DB sql bytes ?tailvar?", 0); + Tcl_GetString(objv[0]), " DB sql bytes ?tailvar?", NULL); return TCL_ERROR; } if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR; @@ -4929,7 +4929,7 @@ static int SQLITE_TCLAPI test_prepare_v2( if( objc!=5 && objc!=4 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " DB sql bytes tailvar", 0); + Tcl_GetString(objv[0]), " DB sql bytes tailvar", NULL); return TCL_ERROR; } if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR; @@ -5003,7 +5003,7 @@ static int SQLITE_TCLAPI test_prepare_v3( if( objc!=6 && objc!=5 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " DB sql bytes flags tailvar", 0); + Tcl_GetString(objv[0]), " DB sql bytes flags tailvar", NULL); return TCL_ERROR; } if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR; @@ -5070,7 +5070,7 @@ static int SQLITE_TCLAPI test_prepare_tkt3134( if( objc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " DB sql bytes tailvar", 0); + Tcl_GetString(objv[0]), " DB sql bytes tailvar", NULL); return TCL_ERROR; } if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR; @@ -5118,7 +5118,7 @@ static int SQLITE_TCLAPI test_prepare16( if( objc!=5 && objc!=4 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " DB sql bytes ?tailvar?", 0); + Tcl_GetString(objv[0]), " DB sql bytes ?tailvar?", NULL); return TCL_ERROR; } if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR; @@ -5178,7 +5178,7 @@ static int SQLITE_TCLAPI test_prepare16_v2( if( objc!=5 && objc!=4 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " DB sql bytes ?tailvar?", 0); + Tcl_GetString(objv[0]), " DB sql bytes ?tailvar?", NULL); return TCL_ERROR; } if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR; @@ -5226,7 +5226,7 @@ static int SQLITE_TCLAPI test_open( if( objc!=3 && objc!=2 && objc!=1 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " filename options-list", 0); + Tcl_GetString(objv[0]), " filename options-list", NULL); return TCL_ERROR; } @@ -5325,7 +5325,7 @@ static int SQLITE_TCLAPI test_open16( if( objc!=3 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " filename options-list", 0); + Tcl_GetString(objv[0]), " filename options-list", NULL); return TCL_ERROR; } @@ -5409,7 +5409,7 @@ static int SQLITE_TCLAPI test_step( if( objc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " STMT", 0); + Tcl_GetString(objv[0]), " STMT", NULL); return TCL_ERROR; } @@ -5493,7 +5493,7 @@ static int SQLITE_TCLAPI test_column_count( if( objc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " STMT column", 0); + Tcl_GetString(objv[0]), " STMT column", NULL); return TCL_ERROR; } @@ -5520,7 +5520,7 @@ static int SQLITE_TCLAPI test_column_type( if( objc!=3 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " STMT column", 0); + Tcl_GetString(objv[0]), " STMT column", NULL); return TCL_ERROR; } @@ -5569,7 +5569,7 @@ static int SQLITE_TCLAPI test_column_int64( if( objc!=3 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " STMT column", 0); + Tcl_GetString(objv[0]), " STMT column", NULL); return TCL_ERROR; } @@ -5598,7 +5598,7 @@ static int SQLITE_TCLAPI test_column_blob( if( objc!=3 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " STMT column", 0); + Tcl_GetString(objv[0]), " STMT column", NULL); return TCL_ERROR; } @@ -5628,7 +5628,7 @@ static int SQLITE_TCLAPI test_column_double( if( objc!=3 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " STMT column", 0); + Tcl_GetString(objv[0]), " STMT column", NULL); return TCL_ERROR; } @@ -5655,7 +5655,7 @@ static int SQLITE_TCLAPI test_data_count( if( objc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " STMT column", 0); + Tcl_GetString(objv[0]), " STMT column", NULL); return TCL_ERROR; } @@ -5688,7 +5688,7 @@ static int SQLITE_TCLAPI test_stmt_utf8( xFuncU = (const unsigned char*(*)(sqlite3_stmt*,int))xFunc; if( objc!=3 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " STMT column", 0); + Tcl_GetString(objv[0]), " STMT column", NULL); return TCL_ERROR; } @@ -5746,7 +5746,7 @@ static int SQLITE_TCLAPI test_stmt_utf16( xFunc = (const void *(*)(sqlite3_stmt*, int))clientData; if( objc!=3 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " STMT column", 0); + Tcl_GetString(objv[0]), " STMT column", NULL); return TCL_ERROR; } @@ -5787,7 +5787,7 @@ static int SQLITE_TCLAPI test_stmt_int( xFunc = (int (*)(sqlite3_stmt*, int))clientData; if( objc!=3 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " STMT column", 0); + Tcl_GetString(objv[0]), " STMT column", NULL); return TCL_ERROR; } @@ -5936,7 +5936,7 @@ static int SQLITE_TCLAPI test_busy_timeout( sqlite3 *db; if( argc!=3 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " DB", 0); + " DB", NULL); return TCL_ERROR; } if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR; @@ -5970,7 +5970,7 @@ static int SQLITE_TCLAPI test_setlk_timeout( } if( argc!=(3+bBlockOnConnect) ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ?-blockonconnect? DB MS", 0); + " ?-blockonconnect? DB MS", NULL); return TCL_ERROR; } if( getDbPointer(interp, argv[argc-2], &db) ) return TCL_ERROR; @@ -6390,7 +6390,7 @@ static int SQLITE_TCLAPI test_pager_refcounts( if( objc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetStringFromObj(objv[0], 0), " DB", 0); + Tcl_GetStringFromObj(objv[0], 0), " DB", NULL); return TCL_ERROR; } if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR; @@ -6632,7 +6632,7 @@ static int SQLITE_TCLAPI file_control_test( if( objc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetStringFromObj(objv[0], 0), " DB", 0); + Tcl_GetStringFromObj(objv[0], 0), " DB", NULL); return TCL_ERROR; } if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR; @@ -6667,7 +6667,7 @@ static int SQLITE_TCLAPI file_control_lasterrno_test( if( objc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetStringFromObj(objv[0], 0), " DB", 0); + Tcl_GetStringFromObj(objv[0], 0), " DB", NULL); return TCL_ERROR; } if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ){ @@ -6680,7 +6680,7 @@ static int SQLITE_TCLAPI file_control_lasterrno_test( } if( iArg!=0 ) { Tcl_AppendResult(interp, "Unexpected non-zero errno: ", - Tcl_GetStringFromObj(Tcl_NewIntObj(iArg), 0), " ", 0); + Tcl_GetStringFromObj(Tcl_NewIntObj(iArg), 0), " ", NULL); return TCL_ERROR; } return TCL_OK; @@ -6816,7 +6816,7 @@ static int SQLITE_TCLAPI file_control_lockproxy_test( if( objc!=3 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetStringFromObj(objv[0], 0), " DB PWD", 0); + Tcl_GetStringFromObj(objv[0], 0), " DB PWD", NULL); return TCL_ERROR; } if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ){ @@ -6852,7 +6852,7 @@ static int SQLITE_TCLAPI file_control_lockproxy_test( rc = sqlite3_file_control(db, NULL, SQLITE_GET_LOCKPROXYFILE, &testPath); if( strncmp(proxyPath,testPath,11) ){ Tcl_AppendResult(interp, "Lock proxy file did not match the " - "previously assigned value", 0); + "previously assigned value", NULL); return TCL_ERROR; } if( rc ){ @@ -6889,7 +6889,7 @@ static int SQLITE_TCLAPI file_control_win32_av_retry( if( objc!=4 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetStringFromObj(objv[0], 0), " DB NRETRY DELAY", 0); + Tcl_GetStringFromObj(objv[0], 0), " DB NRETRY DELAY", NULL); return TCL_ERROR; } if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ){ @@ -6922,7 +6922,7 @@ static int file_control_win32_get_handle( if( objc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetStringFromObj(objv[0], 0), " DB", 0); + Tcl_GetStringFromObj(objv[0], 0), " DB", NULL); return TCL_ERROR; } if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ){ @@ -6954,7 +6954,7 @@ static int SQLITE_TCLAPI file_control_win32_set_handle( if( objc!=3 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetStringFromObj(objv[0], 0), " DB HANDLE", 0); + Tcl_GetStringFromObj(objv[0], 0), " DB HANDLE", NULL); return TCL_ERROR; } if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ){ @@ -6990,7 +6990,7 @@ static int SQLITE_TCLAPI file_control_persist_wal( if( objc!=3 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetStringFromObj(objv[0], 0), " DB FLAG", 0); + Tcl_GetStringFromObj(objv[0], 0), " DB FLAG", NULL); return TCL_ERROR; } if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ){ @@ -7022,7 +7022,7 @@ static int SQLITE_TCLAPI file_control_powersafe_overwrite( if( objc!=3 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetStringFromObj(objv[0], 0), " DB FLAG", 0); + Tcl_GetStringFromObj(objv[0], 0), " DB FLAG", NULL); return TCL_ERROR; } if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ){ @@ -7053,7 +7053,7 @@ static int SQLITE_TCLAPI file_control_vfsname( if( objc!=2 && objc!=3 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetStringFromObj(objv[0], 0), " DB ?AUXDB?", 0); + Tcl_GetStringFromObj(objv[0], 0), " DB ?AUXDB?", NULL); return TCL_ERROR; } if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ){ @@ -7115,7 +7115,7 @@ static int SQLITE_TCLAPI file_control_tempfilename( if( objc!=2 && objc!=3 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetStringFromObj(objv[0], 0), " DB ?AUXDB?", 0); + Tcl_GetStringFromObj(objv[0], 0), " DB ?AUXDB?", NULL); return TCL_ERROR; } if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ){ @@ -7148,7 +7148,7 @@ static int SQLITE_TCLAPI file_control_external_reader( if( objc!=2 && objc!=3 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetStringFromObj(objv[0], 0), " DB ?AUXDB?", 0); + Tcl_GetStringFromObj(objv[0], 0), " DB ?AUXDB?", NULL); return TCL_ERROR; } if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ){ @@ -7232,7 +7232,7 @@ static int SQLITE_TCLAPI test_limit( if( objc!=4 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetStringFromObj(objv[0], 0), " DB ID VALUE", 0); + Tcl_GetStringFromObj(objv[0], 0), " DB ID VALUE", NULL); return TCL_ERROR; } if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR; diff --git a/src/test2.c b/src/test2.c index 07b3b7d901..899728ead9 100644 --- a/src/test2.c +++ b/src/test2.c @@ -51,7 +51,7 @@ static int SQLITE_TCLAPI pager_open( char zBuf[100]; if( argc!=3 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " FILENAME N-PAGE\"", 0); + " FILENAME N-PAGE\"", NULL); return TCL_ERROR; } if( Tcl_GetInt(interp, argv[2], &nPage) ) return TCL_ERROR; @@ -85,7 +85,7 @@ static int SQLITE_TCLAPI pager_close( int rc; if( argc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); + " ID\"", NULL); return TCL_ERROR; } pPager = sqlite3TestTextToPtr(argv[1]); @@ -112,7 +112,7 @@ static int SQLITE_TCLAPI pager_rollback( int rc; if( argc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); + " ID\"", NULL); return TCL_ERROR; } pPager = sqlite3TestTextToPtr(argv[1]); @@ -139,7 +139,7 @@ static int SQLITE_TCLAPI pager_commit( int rc; if( argc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); + " ID\"", NULL); return TCL_ERROR; } pPager = sqlite3TestTextToPtr(argv[1]); @@ -171,7 +171,7 @@ static int SQLITE_TCLAPI pager_stmt_begin( int rc; if( argc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); + " ID\"", NULL); return TCL_ERROR; } pPager = sqlite3TestTextToPtr(argv[1]); @@ -198,7 +198,7 @@ static int SQLITE_TCLAPI pager_stmt_rollback( int rc; if( argc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); + " ID\"", NULL); return TCL_ERROR; } pPager = sqlite3TestTextToPtr(argv[1]); @@ -226,7 +226,7 @@ static int SQLITE_TCLAPI pager_stmt_commit( int rc; if( argc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); + " ID\"", NULL); return TCL_ERROR; } pPager = sqlite3TestTextToPtr(argv[1]); @@ -253,7 +253,7 @@ static int SQLITE_TCLAPI pager_stats( int i, *a; if( argc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); + " ID\"", NULL); return TCL_ERROR; } pPager = sqlite3TestTextToPtr(argv[1]); @@ -287,7 +287,7 @@ static int SQLITE_TCLAPI pager_pagecount( int nPage; if( argc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); + " ID\"", NULL); return TCL_ERROR; } pPager = sqlite3TestTextToPtr(argv[1]); @@ -315,7 +315,7 @@ static int SQLITE_TCLAPI page_get( int rc; if( argc!=3 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID PGNO\"", 0); + " ID PGNO\"", NULL); return TCL_ERROR; } pPager = sqlite3TestTextToPtr(argv[1]); @@ -351,7 +351,7 @@ static int SQLITE_TCLAPI page_lookup( int pgno; if( argc!=3 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID PGNO\"", 0); + " ID PGNO\"", NULL); return TCL_ERROR; } pPager = sqlite3TestTextToPtr(argv[1]); @@ -377,7 +377,7 @@ static int SQLITE_TCLAPI pager_truncate( int pgno; if( argc!=3 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID PGNO\"", 0); + " ID PGNO\"", NULL); return TCL_ERROR; } pPager = sqlite3TestTextToPtr(argv[1]); @@ -401,7 +401,7 @@ static int SQLITE_TCLAPI page_unref( DbPage *pPage; if( argc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " PAGE\"", 0); + " PAGE\"", NULL); return TCL_ERROR; } pPage = (DbPage *)sqlite3TestTextToPtr(argv[1]); @@ -424,7 +424,7 @@ static int SQLITE_TCLAPI page_read( DbPage *pPage; if( argc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " PAGE\"", 0); + " PAGE\"", NULL); return TCL_ERROR; } pPage = sqlite3TestTextToPtr(argv[1]); @@ -448,7 +448,7 @@ static int SQLITE_TCLAPI page_number( DbPage *pPage; if( argc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " PAGE\"", 0); + " PAGE\"", NULL); return TCL_ERROR; } pPage = (DbPage *)sqlite3TestTextToPtr(argv[1]); @@ -473,7 +473,7 @@ static int SQLITE_TCLAPI page_write( int rc; if( argc!=3 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " PAGE DATA\"", 0); + " PAGE DATA\"", NULL); return TCL_ERROR; } pPage = (DbPage *)sqlite3TestTextToPtr(argv[1]); @@ -513,7 +513,7 @@ static int SQLITE_TCLAPI fake_big_file( int nFile; if( argc!=3 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " N-MEGABYTES FILE\"", 0); + " N-MEGABYTES FILE\"", NULL); return TCL_ERROR; } if( Tcl_GetInt(interp, argv[1], &n) ) return TCL_ERROR; diff --git a/src/test3.c b/src/test3.c index fade30149a..8fbb96a80d 100644 --- a/src/test3.c +++ b/src/test3.c @@ -46,9 +46,10 @@ static int SQLITE_TCLAPI btree_open( char *zFilename; if( argc!=3 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " FILENAME NCACHE FLAGS\"", 0); + " FILENAME NCACHE FLAGS\"", NULL); return TCL_ERROR; } + if( Tcl_GetInt(interp, argv[2], &nCache) ) return TCL_ERROR; nRefSqlite3++; if( nRefSqlite3==1 ){ @@ -89,7 +90,7 @@ static int SQLITE_TCLAPI btree_close( int rc; if( argc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); + " ID\"", NULL); return TCL_ERROR; } pBt = sqlite3TestTextToPtr(argv[1]); @@ -124,7 +125,7 @@ static int SQLITE_TCLAPI btree_begin_transaction( int rc; if( argc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); + " ID\"", NULL); return TCL_ERROR; } pBt = sqlite3TestTextToPtr(argv[1]); @@ -155,7 +156,7 @@ static int SQLITE_TCLAPI btree_pager_stats( if( argc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); + " ID\"", NULL); return TCL_ERROR; } pBt = sqlite3TestTextToPtr(argv[1]); @@ -208,7 +209,7 @@ static int SQLITE_TCLAPI btree_cursor( if( argc!=4 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID TABLENUM WRITEABLE\"", 0); + " ID TABLENUM WRITEABLE\"", NULL); return TCL_ERROR; } pBt = sqlite3TestTextToPtr(argv[1]); @@ -253,7 +254,7 @@ static int SQLITE_TCLAPI btree_close_cursor( if( argc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); + " ID\"", NULL); return TCL_ERROR; } pCur = sqlite3TestTextToPtr(argv[1]); @@ -297,7 +298,7 @@ static int SQLITE_TCLAPI btree_next( if( argc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); + " ID\"", NULL); return TCL_ERROR; } pCur = sqlite3TestTextToPtr(argv[1]); @@ -336,7 +337,7 @@ static int SQLITE_TCLAPI btree_first( if( argc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); + " ID\"", NULL); return TCL_ERROR; } pCur = sqlite3TestTextToPtr(argv[1]); @@ -370,7 +371,7 @@ static int SQLITE_TCLAPI btree_eof( if( argc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); + " ID\"", NULL); return TCL_ERROR; } pCur = sqlite3TestTextToPtr(argv[1]); @@ -399,7 +400,7 @@ static int SQLITE_TCLAPI btree_payload_size( if( argc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); + " ID\"", NULL); return TCL_ERROR; } pCur = sqlite3TestTextToPtr(argv[1]); @@ -437,7 +438,7 @@ static int SQLITE_TCLAPI btree_varint_test( unsigned char zBuf[100]; if( argc!=5 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " START MULTIPLIER COUNT INCREMENT\"", 0); + " START MULTIPLIER COUNT INCREMENT\"", NULL); return TCL_ERROR; } if( Tcl_GetInt(interp, argv[1], (int*)&start) ) return TCL_ERROR; @@ -523,7 +524,7 @@ static int SQLITE_TCLAPI btree_from_db( if( argc!=2 && argc!=3 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " DB-HANDLE ?N?\"", 0); + " DB-HANDLE ?N?\"", NULL); return TCL_ERROR; } @@ -561,7 +562,7 @@ static int SQLITE_TCLAPI btree_ismemdb( if( argc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID\"", 0); + " ID\"", NULL); return TCL_ERROR; } pBt = sqlite3TestTextToPtr(argv[1]); @@ -591,7 +592,7 @@ static int SQLITE_TCLAPI btree_set_cache_size( if( argc!=3 ){ Tcl_AppendResult( - interp, "wrong # args: should be \"", argv[0], " BT NCACHE\"", 0); + interp, "wrong # args: should be \"", argv[0], " BT NCACHE\"", NULL); return TCL_ERROR; } pBt = sqlite3TestTextToPtr(argv[1]); diff --git a/src/test4.c b/src/test4.c index ea67908c23..07236b3e5d 100644 --- a/src/test4.c +++ b/src/test4.c @@ -143,7 +143,7 @@ static int SQLITE_TCLAPI tcl_thread_create( if( argc!=3 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID FILENAME", 0); + " ID FILENAME", NULL); return TCL_ERROR; } i = parse_thread_id(interp, argv[1]); @@ -192,7 +192,7 @@ static int SQLITE_TCLAPI tcl_thread_wait( if( argc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID", 0); + " ID", NULL); return TCL_ERROR; } i = parse_thread_id(interp, argv[1]); @@ -236,7 +236,7 @@ static int SQLITE_TCLAPI tcl_thread_halt( if( argc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID", 0); + " ID", NULL); return TCL_ERROR; } if( argv[1][0]=='*' && argv[1][1]==0 ){ @@ -272,7 +272,7 @@ static int SQLITE_TCLAPI tcl_thread_argc( if( argc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID", 0); + " ID", NULL); return TCL_ERROR; } i = parse_thread_id(interp, argv[1]); @@ -304,7 +304,7 @@ static int SQLITE_TCLAPI tcl_thread_argv( if( argc!=3 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID N", 0); + " ID N", NULL); return TCL_ERROR; } i = parse_thread_id(interp, argv[1]); @@ -340,7 +340,7 @@ static int SQLITE_TCLAPI tcl_thread_colname( if( argc!=3 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID N", 0); + " ID N", NULL); return TCL_ERROR; } i = parse_thread_id(interp, argv[1]); @@ -376,7 +376,7 @@ static int SQLITE_TCLAPI tcl_thread_result( if( argc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID", 0); + " ID", NULL); return TCL_ERROR; } i = parse_thread_id(interp, argv[1]); @@ -407,7 +407,7 @@ static int SQLITE_TCLAPI tcl_thread_error( if( argc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID", 0); + " ID", NULL); return TCL_ERROR; } i = parse_thread_id(interp, argv[1]); @@ -451,7 +451,7 @@ static int SQLITE_TCLAPI tcl_thread_compile( int i; if( argc!=3 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID SQL", 0); + " ID SQL", NULL); return TCL_ERROR; } i = parse_thread_id(interp, argv[1]); @@ -505,7 +505,7 @@ static int SQLITE_TCLAPI tcl_thread_step( int i; if( argc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " IDL", 0); + " IDL", NULL); return TCL_ERROR; } i = parse_thread_id(interp, argv[1]); @@ -548,7 +548,7 @@ static int SQLITE_TCLAPI tcl_thread_finalize( int i; if( argc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " IDL", 0); + " IDL", NULL); return TCL_ERROR; } i = parse_thread_id(interp, argv[1]); @@ -581,7 +581,7 @@ static int SQLITE_TCLAPI tcl_thread_swap( sqlite3 *temp; if( argc!=3 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID1 ID2", 0); + " ID1 ID2", NULL); return TCL_ERROR; } i = parse_thread_id(interp, argv[1]); @@ -622,7 +622,7 @@ static int SQLITE_TCLAPI tcl_thread_db_get( extern int sqlite3TestMakePointerStr(Tcl_Interp*, char*, void*); if( argc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID", 0); + " ID", NULL); return TCL_ERROR; } i = parse_thread_id(interp, argv[1]); @@ -653,7 +653,7 @@ static int SQLITE_TCLAPI tcl_thread_db_put( extern void *sqlite3TestTextToPtr(const char *); if( argc!=3 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID DB", 0); + " ID DB", NULL); return TCL_ERROR; } i = parse_thread_id(interp, argv[1]); @@ -685,7 +685,7 @@ static int SQLITE_TCLAPI tcl_thread_stmt_get( extern int sqlite3TestMakePointerStr(Tcl_Interp*, char*, void*); if( argc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ID", 0); + " ID", NULL); return TCL_ERROR; } i = parse_thread_id(interp, argv[1]); diff --git a/src/test5.c b/src/test5.c index 76e6197558..06d2de911d 100644 --- a/src/test5.c +++ b/src/test5.c @@ -67,7 +67,7 @@ static int SQLITE_TCLAPI test_value_overhead( if( objc!=3 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetStringFromObj(objv[0], 0), " ", 0); + Tcl_GetStringFromObj(objv[0], 0), " ", NULL); return TCL_ERROR; } @@ -135,7 +135,7 @@ static int SQLITE_TCLAPI test_translate( if( objc!=4 && objc!=5 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", Tcl_GetStringFromObj(objv[0], 0), - " ", 0 + " ", NULL ); return TCL_ERROR; } diff --git a/src/test6.c b/src/test6.c index b57759150b..aee7bf12aa 100644 --- a/src/test6.c +++ b/src/test6.c @@ -755,12 +755,12 @@ static int processDevSymArgs( ){ Tcl_AppendResult(interp, "Bad option: \"", zOpt, - "\" - must be \"-characteristics\" or \"-sectorsize\"", 0 + "\" - must be \"-characteristics\" or \"-sectorsize\"", NULL ); return TCL_ERROR; } if( i==objc-1 ){ - Tcl_AppendResult(interp, "Option requires an argument: \"", zOpt, "\"",0); + Tcl_AppendResult(interp, "Option requires an argument: \"", zOpt, "\"", NULL); return TCL_ERROR; } @@ -1044,7 +1044,7 @@ static int SQLITE_TCLAPI jtObjCmd( if( objc==3 ){ if( strcmp(zParent, "-default") ){ Tcl_AppendResult(interp, - "bad option \"", zParent, "\": must be -default", 0 + "bad option \"", zParent, "\": must be -default", NULL ); return TCL_ERROR; } diff --git a/src/test_hexio.c b/src/test_hexio.c index a4a86c2096..048ab13246 100644 --- a/src/test_hexio.c +++ b/src/test_hexio.c @@ -329,7 +329,7 @@ static int SQLITE_TCLAPI utf8_to_utf8( return TCL_OK; #else Tcl_AppendResult(interp, - "[utf8_to_utf8] unavailable - SQLITE_DEBUG not defined", 0 + "[utf8_to_utf8] unavailable - SQLITE_DEBUG not defined", NULL ); return TCL_ERROR; #endif diff --git a/src/test_init.c b/src/test_init.c index f7b85875b0..0c6ac8eb56 100644 --- a/src/test_init.c +++ b/src/test_init.c @@ -201,7 +201,7 @@ static int SQLITE_TCLAPI init_wrapper_install( }else if( strcmp(z, "pcache")==0 ){ wrapped.pcache_fail = 1; }else{ - Tcl_AppendResult(interp, "Unknown argument: \"", z, "\""); + Tcl_AppendResult(interp, "Unknown argument: \"", z, "\"", NULL); return TCL_ERROR; } } diff --git a/src/test_vfs.c b/src/test_vfs.c index f44914c207..0d90a53a53 100644 --- a/src/test_vfs.c +++ b/src/test_vfs.c @@ -1138,7 +1138,7 @@ static int SQLITE_TCLAPI testvfs_obj_cmd( ); if( rc!=SQLITE_OK ){ Tcl_AppendResult(interp, "failed to get full path: ", - Tcl_GetString(objv[2]), 0); + Tcl_GetString(objv[2]), NULL); ckfree(zName); return TCL_ERROR; } diff --git a/test/backup2.test b/test/backup2.test index 1822e2dbf0..095ecc752d 100644 --- a/test/backup2.test +++ b/test/backup2.test @@ -141,7 +141,7 @@ do_test backup2-9 { # Try to restore from an unreadable file. # -if {$tcl_platform(platform)=="windows"} { +if {$::tcl_platform(os) eq "Windows NT"} { set msg {cannot open source database: unable to open database file} } elseif {[string match *BSD $tcl_platform(os)]} { set msg {} diff --git a/test/crash8.test b/test/crash8.test index c07829979f..b2b01183fd 100644 --- a/test/crash8.test +++ b/test/crash8.test @@ -356,7 +356,7 @@ ifcapable pragma { # is not created on F2FS file-systems that support atomic # write. So do not run these tests in that case either. # -if {$::tcl_platform(platform)=="unix" && [atomic_batch_write test.db]==0 } { +if {$::tcl_platform(os) ne "Windows NT" && [atomic_batch_write test.db]==0 } { for {set i 1} {$i < 10} {incr i} { catch { db close } forcedelete test.db test.db-journal diff --git a/test/extension01.test b/test/extension01.test index 97b772680e..ba8a44edb5 100644 --- a/test/extension01.test +++ b/test/extension01.test @@ -60,7 +60,7 @@ do_test 1.5 { } {0} do_test 1.6 { - if {$::tcl_platform(platform)=="unix"} { + if {$::tcl_platform(os) ne "Windows NT"} { file attributes ./file2.txt -permissions r--r--r-- } else { file attributes ./file2.txt -readonly 1 @@ -70,7 +70,7 @@ do_test 1.6 { } } {nil} do_test 1.7 { - if {$::tcl_platform(platform)=="unix"} { + if {$::tcl_platform(os) ne "Windows NT"} { file attributes ./file2.txt -permissions rw-r--r-- } else { file attributes ./file2.txt -readonly 0 diff --git a/test/external_reader.test b/test/external_reader.test index 5d293981c5..d56aa4e261 100644 --- a/test/external_reader.test +++ b/test/external_reader.test @@ -19,7 +19,7 @@ ifcapable !wal { finish_test return } -if {$::tcl_platform(platform)!="unix"} { +if {$::tcl_platform(os) eq "Windows NT"} { finish_test return } diff --git a/test/io.test b/test/io.test index dfadcd1362..0024fefd65 100644 --- a/test/io.test +++ b/test/io.test @@ -443,7 +443,7 @@ sqlite3_simulate_device -char safe_append # on the journal file between steps (2) and (3) above. # set expected_sync_count 2 -if {$::tcl_platform(platform)=="unix"} { +if {$::tcl_platform(os) ne "Windows NT"} { ifcapable dirsync { incr expected_sync_count } diff --git a/test/journal3.test b/test/journal3.test index c3e3d12db6..a29b68d54a 100644 --- a/test/journal3.test +++ b/test/journal3.test @@ -20,7 +20,7 @@ source $testdir/malloc_common.tcl # If a connection is required to create a journal file, it creates it with # the same file-system permissions as the database file itself. Test this. # -if {$::tcl_platform(platform) == "unix" +if {$::tcl_platform(os) ne "Windows NT" && [atomic_batch_write test.db]==0 } { diff --git a/test/loadext.test b/test/loadext.test index 6da8a52894..e95d5f6eb8 100644 --- a/test/loadext.test +++ b/test/loadext.test @@ -66,9 +66,13 @@ if {$::tcl_platform(os) eq "Darwin"} { set dlerror_nosymbol {dlsym.XXX, %2$s.: symbol not found} } -if {$::tcl_platform(platform) eq "windows"} { +if {$::tcl_platform(os) eq "Windows NT"} { set dlerror_nosuchfile {The specified module could not be found.*} - set dlerror_notadll {%%1 is not a valid Win32 application.*} + if {$::tcl_platform(platform) eq "unix"} { + set dlerror_notadll $dlerror_nosuchfile + } else { + set dlerror_notadll {%%1 is not a valid Win32 application.*} + } set dlerror_nosymbol {The specified procedure could not be found.*} } diff --git a/test/pager1.test b/test/pager1.test index 79598e2a70..91a32c2c64 100644 --- a/test/pager1.test +++ b/test/pager1.test @@ -454,7 +454,7 @@ do_test pager1.4.2.1 { tstvfs delete } {} -if {$::tcl_platform(platform)!="windows"} { +if {$::tcl_platform(os) ne "Windows NT"} { do_test pager1.4.2.2 { faultsim_restore_and_reopen execsql { @@ -1714,7 +1714,7 @@ do_execsql_test pager1-13.1.1 { UPDATE t1 SET b = a_string(400); } {persist} -if {$::tcl_platform(platform)!="windows"} { +if {$::tcl_platform(os) ne "Windows NT"} { # Run transactions of increasing sizes. Eventually, one (or more than one) # of these will write just enough content that one of the old headers created # by the transaction in the block above lies immediately after the content @@ -1739,7 +1739,7 @@ for {set nUp 1} {$nUp<64} {incr nUp} { } } -if {$::tcl_platform(platform)!="windows"} { +if {$::tcl_platform(os) ne "Windows NT"} { # Same test as above. But this time with an index on the table. # do_execsql_test pager1-13.2.1 { @@ -2538,7 +2538,7 @@ do_test pager1-30.1 { # file can still be rolled back. This is required for backward compatibility - # versions of SQLite prior to 3.5.8 always set this field to zero. # -if {$tcl_platform(platform)=="unix"} { +if {$::tcl_platform(os) ne "Windows NT"} { do_test pager1-31.1 { faultsim_delete_and_reopen execsql { @@ -2612,7 +2612,7 @@ forcedelete test.db # and the call to unlink() returns an ENOENT error, the COMMIT does not # succeed. # -if {$::tcl_platform(platform)=="unix"} { +if {$::tcl_platform(os) ne "Windows NT"} { do_test pager1-33.1 { sqlite3 db test.db execsql { diff --git a/test/pager4.test b/test/pager4.test index bec5bb645d..537f529dd3 100644 --- a/test/pager4.test +++ b/test/pager4.test @@ -13,7 +13,7 @@ # is unlinked or renamed out from under SQLite. # -if {$tcl_platform(os)=="Windows NT"} return +if {$tcl_platform(os) eq "Windows NT"} return set testdir [file dirname $argv0] source $testdir/tester.tcl diff --git a/test/pagerfault.test b/test/pagerfault.test index 3006dad7cc..6e82b90090 100644 --- a/test/pagerfault.test +++ b/test/pagerfault.test @@ -20,7 +20,7 @@ if {[permutation] == "inmemory_journal"} { return } -if {$::tcl_platform(platform)=="windows"} { +if {$::tcl_platform(os) eq "Windows NT"} { finish_test return } diff --git a/test/shared6.test b/test/shared6.test index 499cbb0eb5..18f9f537b6 100644 --- a/test/shared6.test +++ b/test/shared6.test @@ -139,7 +139,7 @@ do_test shared6-1.X { # that connect to the same file using different VFS implementations do # not share a cache. # -if {$::tcl_platform(platform) eq "unix"} { +if {$::tcl_platform(os) ne "Windows NT"} { do_test shared6-2.1 { sqlite3 db1 test.db -vfs unix sqlite3 db2 test.db -vfs unix diff --git a/test/shmlock.test b/test/shmlock.test index 69c79ecc0a..fce0cf8f5e 100644 --- a/test/shmlock.test +++ b/test/shmlock.test @@ -114,7 +114,7 @@ sqlite3 db0 test.db sqlite3 db1 test.db do_test 3.1 { execsql { SELECT * FROM t1 } db0 } {1 2} do_test 3.2 { execsql { SELECT * FROM t1 } db1 } {1 2} -if {$tcl_platform(os)=="Windows NT"} { +if {$tcl_platform(os) eq "Windows NT"} { set isWindows 1 } else { set isWindows 0 diff --git a/test/symlink.test b/test/symlink.test index 685cae5a41..fc78a04720 100644 --- a/test/symlink.test +++ b/test/symlink.test @@ -17,7 +17,7 @@ source $testdir/tester.tcl set testprefix symlink # This only runs on unix. -if {$::tcl_platform(platform)!="unix"} { +if {$::tcl_platform(os) eq "Windows NT"} { finish_test return } diff --git a/test/sync.test b/test/sync.test index 023425e6b1..b24800d100 100644 --- a/test/sync.test +++ b/test/sync.test @@ -34,7 +34,7 @@ if {[atomic_batch_write test.db]} { set sqlite_sync_count 0 proc cond_incr_sync_count {adj} { global sqlite_sync_count - if {$::tcl_platform(platform) == "windows"} { + if {$::tcl_platform(os) eq "Windows NT"} { incr sqlite_sync_count $adj } else { ifcapable !dirsync { diff --git a/test/sync2.test b/test/sync2.test index 89e66c8455..ce8132c714 100644 --- a/test/sync2.test +++ b/test/sync2.test @@ -26,7 +26,7 @@ ifcapable !pager_pragmas||!attach||!dirsync { finish_test return } -if {$::tcl_platform(platform)!="unix" +if {$::tcl_platform(os) eq "Windows NT" || [permutation] == "journaltest" || [permutation] == "inmemory_journal" || [atomic_batch_write test.db] diff --git a/test/wal2.test b/test/wal2.test index 5ef303edc6..064bed0b20 100644 --- a/test/wal2.test +++ b/test/wal2.test @@ -26,7 +26,7 @@ ifcapable !wal {finish_test ; return } set sqlite_sync_count 0 proc cond_incr_sync_count {adj} { global sqlite_sync_count - if {$::tcl_platform(platform) == "windows"} { + if {$::tcl_platform(os) eq "Windows NT"} { incr sqlite_sync_count $adj } { ifcapable !dirsync { @@ -1038,7 +1038,7 @@ tvfs delete # the new files with the same file-system permissions as the database # file itself. Test this. # -if {$::tcl_platform(platform) == "unix"} { +if {$::tcl_platform(os) ne "Windows NT"} { faultsim_delete_and_reopen # Changed on 2012-02-13: umask is deliberately ignored for -wal files. #set umask [exec /bin/sh -c umask] @@ -1094,7 +1094,7 @@ if {$::tcl_platform(platform) == "unix"} { # database, wal or shm files cannot be opened, or can only be opened # read-only. # -if {$::tcl_platform(platform) == "unix"} { +if {$::tcl_platform(os) ne "Windows NT"} { proc perm {} { set L [list] foreach f {test.db test.db-wal test.db-shm} { diff --git a/test/wal6.test b/test/wal6.test index 9bbc58409d..081608cd30 100644 --- a/test/wal6.test +++ b/test/wal6.test @@ -46,7 +46,7 @@ foreach jmode $all_journal_modes { # Under Windows, you'll get an error trying to delete # a file this is already opened. Close the first connection # so the other tests work. -if {$tcl_platform(platform)=="windows"} { +if {$::tcl_platform(os) eq "Windows NT"} { if {$jmode=="persist" || $jmode=="truncate"} { db close } @@ -61,7 +61,7 @@ if {$tcl_platform(platform)=="windows"} { } db2 } {wal 1 2 3 4} -if {$tcl_platform(platform)=="windows"} { +if {$::tcl_platform(os) eq "Windows NT"} { if {$jmode=="persist" || $jmode=="truncate"} { sqlite3 db test.db } diff --git a/test/walmode.test b/test/walmode.test index f760823c8d..1c3325acf2 100644 --- a/test/walmode.test +++ b/test/walmode.test @@ -47,7 +47,7 @@ do_test walmode-1.2 { if {[atomic_batch_write test.db]==0} { set expected_sync_count 3 - if {$::tcl_platform(platform)!="windows"} { + if {$::tcl_platform(os) ne "Windows NT"} { ifcapable dirsync { incr expected_sync_count } diff --git a/test/walro.test b/test/walro.test index cae52db6d3..a39b844d9d 100644 --- a/test/walro.test +++ b/test/walro.test @@ -19,7 +19,7 @@ set ::testprefix walro # These tests are only going to work on unix. # -if {$::tcl_platform(platform) != "unix"} { +if {$::tcl_platform(os) eq "Windows NT"} { finish_test return } diff --git a/tool/sqlite3_analyzer.c.in b/tool/sqlite3_analyzer.c.in index 9c11752b81..5aef4639b4 100644 --- a/tool/sqlite3_analyzer.c.in +++ b/tool/sqlite3_analyzer.c.in @@ -55,7 +55,7 @@ static int subst_puts( }else if( strcmp(zArg, "-nonewline")==0 ){ addNewLine = 0; }else{ - Tcl_AppendResult(interp, "bad argument: ", zArg, 0); + Tcl_AppendResult(interp, "bad argument: ", zArg, NULL); return TCL_ERROR; } } From 49a5da1138fcfd0856de8e0a4b0801506dba734d Mon Sep 17 00:00:00 2001 From: stephan Date: Mon, 10 Mar 2025 09:54:01 +0000 Subject: [PATCH 005/120] Add tf.bat target to Makefile.msc to facilitate running of individual test scripts via testfixture.exe. FossilOrigin-Name: 6f24da264cf8d4c9fef706e6ab89e8c002ac4abfb79516f65ff4eb806f864959 --- Makefile.msc | 6 ++++++ manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Makefile.msc b/Makefile.msc index e0bf60978c..6f94ec6c93 100644 --- a/Makefile.msc +++ b/Makefile.msc @@ -2593,6 +2593,11 @@ testfixture.exe: $(TESTFIXTURE_SRC) $(TESTFIXTURE_DEP) $(SQLITE3H) $(LIBRESOBJS) $(TESTFIXTURE_SRC) \ /link $(LDFLAGS) $(LTLINKOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) $(LIBRESOBJS) $(TCLLIBS) $(LTLIBS) $(TLIBS) +# A small helper for manually running individual tests +tf.bat: testfixture.exe Makefile.msc + echo @set PATH=$(LIBTCLPATH);%PATH% > $@ + echo .\testfixture.exe %* >> $@ + extensiontest: testfixture.exe testloadext.dll @set PATH=$(LIBTCLPATH);$(PATH) .\testfixture.exe $(TOP)\test\loadext.test $(TESTOPTS) @@ -2830,6 +2835,7 @@ clean: del /Q *.bsc *.cod *.da *.bb *.bbg *.vc gmon.out 2>NUL del /Q sqlite3.def tclsqlite3.def ctime.c pragma.h 2>NUL del /Q $(SQLITE3EXE) $(SQLITE3DLL) Replace.exe 2>NUL + del /Q tf.bat 2>NUL # <> del /Q $(SQLITE3TCLDLL) pkgIndex.tcl 2>NUL del /Q opcodes.c opcodes.h 2>NUL diff --git a/manifest b/manifest index e4a0cf25eb..264d05ba31 100644 --- a/manifest +++ b/manifest @@ -1,11 +1,11 @@ -C Test\sapp/script\spatches\sfrom\sJan\sNijtmans\sfor\scygwin.\sAdd/replace\smany\smore\ssentinel\sarguments\sfor\sTCL\svariadic\sfunctions\swhich\sspecifically\sneed\sa\sNULL\strailing\sargument.\sWith\sthis,\s'make\stest'\son\scygwin\sruns\sto\scompletion\sfor\sme,\swith\s134\sof\s329227\stests\sfailing.\sMSC\sbuild\sfails\sthe\ssame\s13\stests\swhich\sfail\sfor\sme\sin\strunk. -D 2025-03-08T06:53:06.819 +C Add\stf.bat\starget\sto\sMakefile.msc\sto\sfacilitate\srunning\sof\sindividual\stest\sscripts\svia\stestfixture.exe. +D 2025-03-10T09:54:01.422 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d F Makefile.in 88f74a1b9fcd903fe3414fe9f8484f8491dc403615dbf1c28c6f415f5220b8b2 F Makefile.linux-generic bd3e3cacd369821a6241d4ea1967395c962dfe3057e38cb0a435cee0e8b789d0 -F Makefile.msc ef04498c7e227a0f459b105bb4952f26cc985d1d6340a367e62d5a79c4689dfb +F Makefile.msc 36ec765308c6da65d1a7fd4e4820c46f672034885843761a2e733fe5b931ee82 F README.md a953c0cffd6e4f2501a306c00ee2b6e1e6630c25031e094629307fe99dd003d1 F VERSION 001dea55eb8304ec9130b6b44a32d3fc349f279d45a7e224fc0730c3cb8e2372 F art/icon-243x273.gif 9750b734f82fdb3dc43127753d5e6fbf3b62c9f4e136c2fbf573b2f57ea87af5 @@ -2213,8 +2213,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 655c60d1926adb552d37441bf9857263eae92e3806a8524e8443b81fdfd8c258 -R dedab2d958c1519d729d7e43fcb4e763 +P 84d8fcfca19cd183d05a702d0eb1742bfae462d3383a3db72741a48cefac1058 +R ea7c3c063bd620bb195b3ee137e59828 U stephan -Z 95c4e252b087a749ba1f87b7c9a4b7ac +Z a3a62485c6c45d45c142214550c57efd # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 9e4d522ee4..b77d311f9f 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -84d8fcfca19cd183d05a702d0eb1742bfae462d3383a3db72741a48cefac1058 +6f24da264cf8d4c9fef706e6ab89e8c002ac4abfb79516f65ff4eb806f864959 From 05ba11fc95c64628256f2d485b13ccc5704d2576 Mon Sep 17 00:00:00 2001 From: stephan Date: Mon, 10 Mar 2025 14:10:46 +0000 Subject: [PATCH 006/120] Tweak [6f24da264cf8d] so that it has no side-effects on autoconf/Makefile.msc. FossilOrigin-Name: d3d322f122e88ea7d7f086f1c7d3ba8ab5ba7c2899d6d1e18b0b593001f01dcf --- Makefile.msc | 3 +-- manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Makefile.msc b/Makefile.msc index 6f94ec6c93..8beefb1879 100644 --- a/Makefile.msc +++ b/Makefile.msc @@ -2835,7 +2835,6 @@ clean: del /Q *.bsc *.cod *.da *.bb *.bbg *.vc gmon.out 2>NUL del /Q sqlite3.def tclsqlite3.def ctime.c pragma.h 2>NUL del /Q $(SQLITE3EXE) $(SQLITE3DLL) Replace.exe 2>NUL - del /Q tf.bat 2>NUL # <> del /Q $(SQLITE3TCLDLL) pkgIndex.tcl 2>NUL del /Q opcodes.c opcodes.h 2>NUL @@ -2850,7 +2849,7 @@ clean: del /Q lsm.dll lsmtest.exe 2>NUL del /Q atrc.exe changesetfuzz.exe dbtotxt.exe index_usage.exe 2>NUL del /Q testloadext.dll 2>NUL - del /Q testfixture.exe test.db 2>NUL + del /Q testfixture.exe test.db tf.bat 2>NUL del /Q LogEst.exe fts3view.exe rollback-test.exe showdb.exe dbdump.exe 2>NUL del /Q changeset.exe 2>NUL del /Q showjournal.exe showstat4.exe showwal.exe speedtest1.exe 2>NUL diff --git a/manifest b/manifest index 264d05ba31..3d7276e805 100644 --- a/manifest +++ b/manifest @@ -1,11 +1,11 @@ -C Add\stf.bat\starget\sto\sMakefile.msc\sto\sfacilitate\srunning\sof\sindividual\stest\sscripts\svia\stestfixture.exe. -D 2025-03-10T09:54:01.422 +C Tweak\s[6f24da264cf8d]\sso\sthat\sit\shas\sno\sside-effects\son\sautoconf/Makefile.msc. +D 2025-03-10T14:10:46.234 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d F Makefile.in 88f74a1b9fcd903fe3414fe9f8484f8491dc403615dbf1c28c6f415f5220b8b2 F Makefile.linux-generic bd3e3cacd369821a6241d4ea1967395c962dfe3057e38cb0a435cee0e8b789d0 -F Makefile.msc 36ec765308c6da65d1a7fd4e4820c46f672034885843761a2e733fe5b931ee82 +F Makefile.msc bdf7fa08bbc3f4da2b66840adf599b8249bebe9282e64f48fa9d897405184e70 F README.md a953c0cffd6e4f2501a306c00ee2b6e1e6630c25031e094629307fe99dd003d1 F VERSION 001dea55eb8304ec9130b6b44a32d3fc349f279d45a7e224fc0730c3cb8e2372 F art/icon-243x273.gif 9750b734f82fdb3dc43127753d5e6fbf3b62c9f4e136c2fbf573b2f57ea87af5 @@ -2213,8 +2213,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 84d8fcfca19cd183d05a702d0eb1742bfae462d3383a3db72741a48cefac1058 -R ea7c3c063bd620bb195b3ee137e59828 +P 6f24da264cf8d4c9fef706e6ab89e8c002ac4abfb79516f65ff4eb806f864959 +R 9018a2364511c477dd8496777615a210 U stephan -Z a3a62485c6c45d45c142214550c57efd +Z 93cb67b1fac012060f97bb3b6f1aa4aa # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index b77d311f9f..2b56635ac8 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -6f24da264cf8d4c9fef706e6ab89e8c002ac4abfb79516f65ff4eb806f864959 +d3d322f122e88ea7d7f086f1c7d3ba8ab5ba7c2899d6d1e18b0b593001f01dcf From 42e5ceb093fc634d0f3a696c831502dff73ab575 Mon Sep 17 00:00:00 2001 From: stephan Date: Mon, 10 Mar 2025 15:15:13 +0000 Subject: [PATCH 007/120] Reimplement pathname conversion on Cygwin. MSC test passes/failures are on par with trunk and 'make test' running on cygwin is down to a single failure. FossilOrigin-Name: 57a4de09149663ac001848773c9dffe53e30f9263e4dacc792a0267401147d25 --- manifest | 12 +- manifest.uuid | 2 +- src/os_win.c | 295 +++++++++++++++++++++++++++++++++++++++++++++++--- 3 files changed, 284 insertions(+), 25 deletions(-) diff --git a/manifest b/manifest index 3d7276e805..d676229fec 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Tweak\s[6f24da264cf8d]\sso\sthat\sit\shas\sno\sside-effects\son\sautoconf/Makefile.msc. -D 2025-03-10T14:10:46.234 +C Reimplement\spathname\sconversion\son\sCygwin.\sMSC\stest\spasses/failures\sare\son\spar\swith\strunk\sand\s'make\stest'\srunning\son\scygwin\sis\sdown\sto\sa\ssingle\sfailure. +D 2025-03-10T15:15:13.945 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -767,7 +767,7 @@ F src/os_common.h 6c0eb8dd40ef3e12fe585a13e709710267a258e2c8dd1c40b1948a1d14582e F src/os_kv.c 4d39e1f1c180b11162c6dc4aa8ad34053873a639bac6baae23272fc03349986a F src/os_setup.h 6011ad7af5db4e05155f385eb3a9b4470688de6f65d6166b8956e58a3d872107 F src/os_unix.c 410185df4900817c218c0efdb8064b3481af88cb3f7cea7392f820b6eebc7889 -F src/os_win.c e58f0861b3b939a8f32c52fb8bfeaac45cabf13a5e0a546292b19df1700c0de5 +F src/os_win.c 9862c27eba30a684d51b07b542e3b286346edf14e2b92b6b1391df43bd1b611e F src/os_win.h 4c247cdb6d407c75186c94a1e84d5a22cbae4adcec93fcae8d2bc1f956fd1f19 F src/pager.c 9fbb541b46125dfa8914827575e6bb4d15048caa008073b1709112d495d7983b F src/pager.h 6137149346e6c8a3ddc1eeb40aee46381e9bc8b0fcc6dda8a1efde993c2275b8 @@ -2213,8 +2213,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 6f24da264cf8d4c9fef706e6ab89e8c002ac4abfb79516f65ff4eb806f864959 -R 9018a2364511c477dd8496777615a210 +P d3d322f122e88ea7d7f086f1c7d3ba8ab5ba7c2899d6d1e18b0b593001f01dcf +R bb2c8958e651ad26411f925c0c07a756 U stephan -Z 93cb67b1fac012060f97bb3b6f1aa4aa +Z c605801bdf07518cea6a7c66b5f5a8cb # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 2b56635ac8..6f0953f13b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -d3d322f122e88ea7d7f086f1c7d3ba8ab5ba7c2899d6d1e18b0b593001f01dcf +57a4de09149663ac001848773c9dffe53e30f9263e4dacc792a0267401147d25 diff --git a/src/os_win.c b/src/os_win.c index feb7bd2c7e..e0fbe968c2 100644 --- a/src/os_win.c +++ b/src/os_win.c @@ -906,7 +906,7 @@ static struct win_syscall { { "LockFile", (SYSCALL)0, 0 }, #endif -#ifndef osLockFile +#if !defined(osLockFile) && defined(SQLITE_WIN32_HAS_ANSI) #define osLockFile ((BOOL(WINAPI*)(HANDLE,DWORD,DWORD,DWORD, \ DWORD))aSyscall[47].pCurrent) #endif @@ -979,7 +979,7 @@ static struct win_syscall { { "UnlockFile", (SYSCALL)0, 0 }, #endif -#ifndef osUnlockFile +#if !defined(osUnlockFile) && defined(SQLITE_WIN32_HAS_ANSI) #define osUnlockFile ((BOOL(WINAPI*)(HANDLE,DWORD,DWORD,DWORD, \ DWORD))aSyscall[57].pCurrent) #endif @@ -1781,6 +1781,7 @@ void sqlite3MemSetDefault(void){ } #endif /* SQLITE_WIN32_MALLOC */ +#ifdef _WIN32 /* ** Convert a UTF-8 string to Microsoft Unicode. ** @@ -1806,6 +1807,7 @@ static LPWSTR winUtf8ToUnicode(const char *zText){ } return zWideText; } +#endif /* _WIN32 */ /* ** Convert a Microsoft Unicode string to UTF-8. @@ -2652,9 +2654,11 @@ static BOOL winLockFile( ovlp.Offset = offsetLow; ovlp.OffsetHigh = offsetHigh; return osLockFileEx(*phFile, flags, 0, numBytesLow, numBytesHigh, &ovlp); +#ifdef SQLITE_WIN32_HAS_ANSI }else{ return osLockFile(*phFile, offsetLow, offsetHigh, numBytesLow, numBytesHigh); +#endif } #endif } @@ -2762,9 +2766,11 @@ static BOOL winUnlockFile( ovlp.Offset = offsetLow; ovlp.OffsetHigh = offsetHigh; return osUnlockFileEx(*phFile, 0, numBytesLow, numBytesHigh, &ovlp); +#ifdef SQLITE_WIN32_HAS_ANSI }else{ return osUnlockFile(*phFile, offsetLow, offsetHigh, numBytesLow, numBytesHigh); +#endif } #endif } @@ -4178,12 +4184,89 @@ static int winLockSharedMemory(winShmNode *pShmNode, DWORD nMs){ ** Convert a UTF-8 filename into whatever form the underlying ** operating system wants filenames in. Space to hold the result ** is obtained from malloc and must be freed by the calling -** function. +** function +** +** On Cygwin, 3 possible input forms are accepted: +** - If the filename starts with ":/" or ":\", +** it is converted to UTF-16 as-is. +** - If the filename contains '/', it is assumed to be a +** Cygwin absolute path, it is converted to a win32 +** absolute path in UTF-16. +** - Otherwise it must be a filename only, the win32 filename +** is returned in UTF-16. +** Note: If the function cygwin_conv_path() fails, only +** UTF-8 -> UTF-16 conversion will be done. This can only +** happen when the file path >32k, in which case winUtf8ToUnicode() +** will fail too. */ static void *winConvertFromUtf8Filename(const char *zFilename){ void *zConverted = 0; if( osIsNT() ){ +#ifdef __CYGWIN__ + int nChar; + LPWSTR zWideFilename; + + if( osCygwin_conv_path && !(winIsDriveLetterAndColon(zFilename) + && winIsDirSep(zFilename[2])) ){ + int nByte; + int convertflag = CCP_POSIX_TO_WIN_W; + if( !strchr(zFilename, '/') ) convertflag |= CCP_RELATIVE; + nByte = (int)osCygwin_conv_path(convertflag, + zFilename, 0, 0); + if( nByte>0 ){ + zConverted = sqlite3MallocZero(nByte+12); + if ( zConverted==0 ){ + return zConverted; + } + zWideFilename = zConverted; + /* Filenames should be prefixed, except when converted + * full path already starts with "\\?\". */ + if( osCygwin_conv_path(convertflag, zFilename, + zWideFilename+4, nByte)==0 ){ + if( (convertflag&CCP_RELATIVE) ){ + memmove(zWideFilename, zWideFilename+4, nByte); + }else if( memcmp(zWideFilename+4, L"\\\\", 4) ){ + memcpy(zWideFilename, L"\\\\?\\", 8); + }else if( zWideFilename[6]!='?' ){ + memmove(zWideFilename+6, zWideFilename+4, nByte); + memcpy(zWideFilename, L"\\\\?\\UNC", 14); + }else{ + memmove(zWideFilename, zWideFilename+4, nByte); + } + return zConverted; + } + sqlite3_free(zConverted); + } + } + nChar = osMultiByteToWideChar(CP_UTF8, 0, zFilename, -1, NULL, 0); + if( nChar==0 ){ + return 0; + } + zWideFilename = sqlite3MallocZero( nChar*sizeof(WCHAR)+12 ); + if( zWideFilename==0 ){ + return 0; + } + nChar = osMultiByteToWideChar(CP_UTF8, 0, zFilename, -1, + zWideFilename, nChar); + if( nChar==0 ){ + sqlite3_free(zWideFilename); + zWideFilename = 0; + }else if( nChar>MAX_PATH + && winIsDriveLetterAndColon(zFilename) + && winIsDirSep(zFilename[2]) ){ + memmove(zWideFilename+4, zWideFilename, nChar*sizeof(WCHAR)); + zWideFilename[2] = '\\'; + memcpy(zWideFilename, L"\\\\?\\", 8); + }else if( nChar>MAX_PATH + && winIsDirSep(zFilename[0]) && winIsDirSep(zFilename[1]) + && zFilename[2] != '?' ){ + memmove(zWideFilename+6, zWideFilename, nChar*sizeof(WCHAR)); + memcpy(zWideFilename, L"\\\\?\\UNC", 14); + } + zConverted = zWideFilename; +#else zConverted = winUtf8ToUnicode(zFilename); +#endif /* __CYGWIN__ */ } #if defined(SQLITE_WIN32_HAS_ANSI) && defined(_WIN32) else{ @@ -5014,7 +5097,7 @@ static winVfsAppData winNolockAppData = { ** sqlite3_vfs object. */ -#ifndef _WIN32 +#if 0 /* No longer necessary */ /* ** Convert a filename from whatever the underlying operating system ** supports for filenames into UTF-8. Space to hold the result is @@ -5047,7 +5130,14 @@ static int winMakeEndInDirSep(int nBuf, char *zBuf){ if( winIsDirSep(zBuf[nLen-1]) ){ return 1; }else if( nLen+1nOut ){ + /* SQLite assumes that xFullPathname() nul-terminates the output buffer + ** even if it returns an error. */ + zOut[iOff] = '\0'; + return SQLITE_CANTOPEN_BKPT; + } + sqlite3_snprintf(nOut-iOff, &zOut[iOff], "%s", zPath); + return SQLITE_OK; +} +#endif /* __CYGWIN__ */ /* ** Turn a relative pathname into a full pathname. Write the full @@ -5928,8 +6087,8 @@ static int winFullPathnameNoMutex( int nFull, /* Size of output buffer in bytes */ char *zFull /* Output buffer */ ){ -#if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT && defined(_WIN32) - DWORD nByte; +#if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT + int nByte; void *zConverted; char *zOut; #endif @@ -5942,7 +6101,83 @@ static int winFullPathnameNoMutex( zRelative++; } -#ifndef _WIN32 + SimulateIOError( return SQLITE_ERROR ); + +#ifdef __CYGWIN__ + if( osGetcwd ){ + zFull[nFull-1] = '\0'; + if( !winIsDriveLetterAndColon(zRelative) || !winIsDirSep(zRelative[2]) ){ + int rc = SQLITE_OK; + int nLink = 1; /* Number of symbolic links followed so far */ + const char *zIn = zRelative; /* Input path for each iteration of loop */ + char *zDel = 0; + struct stat buf; + + UNUSED_PARAMETER(pVfs); + + do { + /* Call lstat() on path zIn. Set bLink to true if the path is a symbolic + ** link, or false otherwise. */ + int bLink = 0; + if( osLstat && osReadlink ) { + if( osLstat(zIn, &buf)!=0 ){ + int myErrno = osErrno; + if( myErrno!=ENOENT ){ + rc = winLogError(SQLITE_CANTOPEN_BKPT, (DWORD)myErrno, "lstat", zIn); + } + }else{ + bLink = ((buf.st_mode & 0170000) == 0120000); + } + + if( bLink ){ + if( zDel==0 ){ + zDel = sqlite3MallocZero(nFull); + if( zDel==0 ) rc = SQLITE_NOMEM; + }else if( ++nLink>SQLITE_MAX_SYMLINKS ){ + rc = SQLITE_CANTOPEN_BKPT; + } + + if( rc==SQLITE_OK ){ + nByte = osReadlink(zIn, zDel, nFull-1); + if( nByte ==(DWORD)-1 ){ + rc = winLogError(SQLITE_CANTOPEN_BKPT, (DWORD)osErrno, "readlink", zIn); + }else{ + if( zDel[0]!='/' ){ + int n; + for(n = sqlite3Strlen30(zIn); n>0 && zIn[n-1]!='/'; n--); + if( nByte+n+1>nFull ){ + rc = SQLITE_CANTOPEN_BKPT; + }else{ + memmove(&zDel[n], zDel, nByte+1); + memcpy(zDel, zIn, n); + nByte += n; + } + } + zDel[nByte] = '\0'; + } + } + + zIn = zDel; + } + } + + assert( rc!=SQLITE_OK || zIn!=zFull || zIn[0]=='/' ); + if( rc==SQLITE_OK && zIn!=zFull ){ + rc = mkFullPathname(zIn, zFull, nFull); + } + if( bLink==0 ) break; + zIn = zFull; + }while( rc==SQLITE_OK ); + + sqlite3_free(zDel); + winSimplifyName(zFull); + return rc; + } + } +#endif /* __CYGWIN__ */ +#if 0 /* This doesn't work correctly at all! See: + +*/ SimulateIOError( return SQLITE_ERROR ); UNUSED_PARAMETER(nFull); assert( nFull>=pVfs->mxPathname ); @@ -5988,7 +6223,8 @@ static int winFullPathnameNoMutex( return SQLITE_OK; #endif -#if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT && defined(_WIN32) +#if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT +#if defined(_WIN32) /* It's odd to simulate an io-error here, but really this is just ** using the io-error infrastructure to test that SQLite handles this ** function failing. This function could fail if, for example, the @@ -6006,6 +6242,7 @@ static int winFullPathnameNoMutex( sqlite3_data_directory, winGetDirSep(), zRelative); return SQLITE_OK; } +#endif zConverted = winConvertFromUtf8Filename(zRelative); if( zConverted==0 ){ return SQLITE_IOERR_NOMEM_BKPT; @@ -6018,12 +6255,13 @@ static int winFullPathnameNoMutex( return winLogError(SQLITE_CANTOPEN_FULLPATH, osGetLastError(), "winFullPathname1", zRelative); } - zTemp = sqlite3MallocZero( nByte*sizeof(zTemp[0]) + 3*sizeof(zTemp[0]) ); + nByte += 3; + zTemp = sqlite3MallocZero( nByte*sizeof(zTemp[0]) ); if( zTemp==0 ){ sqlite3_free(zConverted); return SQLITE_IOERR_NOMEM_BKPT; } - nByte = osGetFullPathNameW((LPCWSTR)zConverted, nByte+3, zTemp, 0); + nByte = osGetFullPathNameW((LPCWSTR)zConverted, nByte, zTemp, 0); if( nByte==0 ){ sqlite3_free(zConverted); sqlite3_free(zTemp); @@ -6061,7 +6299,26 @@ static int winFullPathnameNoMutex( } #endif if( zOut ){ +#ifdef __CYGWIN__ + if( memcmp(zOut, "\\\\?\\", 4) ){ + sqlite3_snprintf(MIN(nFull, pVfs->mxPathname), zFull, "%s", zOut); + }else if( memcmp(zOut+4, "UNC\\", 4) ){ + sqlite3_snprintf(MIN(nFull, pVfs->mxPathname), zFull, "%s", zOut+4); + }else{ + char *p = zOut+6; + *p = '\\'; + if( osGetcwd ){ + /* On Cygwin, UNC paths use forward slashes */ + while( *p ){ + if( *p=='\\' ) *p = '/'; + ++p; + } + } + sqlite3_snprintf(MIN(nFull, pVfs->mxPathname), zFull, "%s", zOut+6); + } +#else sqlite3_snprintf(MIN(nFull, pVfs->mxPathname), zFull, "%s", zOut); +#endif /* __CYGWIN__ */ sqlite3_free(zOut); return SQLITE_OK; }else{ @@ -6091,7 +6348,9 @@ static int winFullPathname( */ static void *winDlOpen(sqlite3_vfs *pVfs, const char *zFilename){ HANDLE h; -#ifndef _WIN32 +#if 0 /* This doesn't work correctly at all! See: + +*/ int nFull = pVfs->mxPathname+1; char *zFull = sqlite3MallocZero( nFull ); void *zConverted = 0; From 4cd6c0b81bb725f4a64f8794c86fdcd435e13c14 Mon Sep 17 00:00:00 2001 From: stephan Date: Mon, 10 Mar 2025 15:27:17 +0000 Subject: [PATCH 008/120] Ensure that the 'clean' target for Makefile.msc cleans up the testdir dir, analog to how the canonical makefile works, as stale files there have been leading to test failures. FossilOrigin-Name: a591c018558af70e0ddfdd2d4d61905f030bac01df19ac9b204aed09d44517be --- Makefile.msc | 2 ++ manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Makefile.msc b/Makefile.msc index 8beefb1879..13207c0751 100644 --- a/Makefile.msc +++ b/Makefile.msc @@ -2850,6 +2850,8 @@ clean: del /Q atrc.exe changesetfuzz.exe dbtotxt.exe index_usage.exe 2>NUL del /Q testloadext.dll 2>NUL del /Q testfixture.exe test.db tf.bat 2>NUL + del /Q /S testdir 2>/NUL + -rmdir /Q /S testdir 2>NUL del /Q LogEst.exe fts3view.exe rollback-test.exe showdb.exe dbdump.exe 2>NUL del /Q changeset.exe 2>NUL del /Q showjournal.exe showstat4.exe showwal.exe speedtest1.exe 2>NUL diff --git a/manifest b/manifest index d676229fec..0bf4153df8 100644 --- a/manifest +++ b/manifest @@ -1,11 +1,11 @@ -C Reimplement\spathname\sconversion\son\sCygwin.\sMSC\stest\spasses/failures\sare\son\spar\swith\strunk\sand\s'make\stest'\srunning\son\scygwin\sis\sdown\sto\sa\ssingle\sfailure. -D 2025-03-10T15:15:13.945 +C Ensure\sthat\sthe\s'clean'\starget\sfor\sMakefile.msc\scleans\sup\sthe\stestdir\sdir,\sanalog\sto\show\sthe\scanonical\smakefile\sworks,\sas\sstale\sfiles\sthere\shave\sbeen\sleading\sto\stest\sfailures. +D 2025-03-10T15:27:17.633 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d F Makefile.in 88f74a1b9fcd903fe3414fe9f8484f8491dc403615dbf1c28c6f415f5220b8b2 F Makefile.linux-generic bd3e3cacd369821a6241d4ea1967395c962dfe3057e38cb0a435cee0e8b789d0 -F Makefile.msc bdf7fa08bbc3f4da2b66840adf599b8249bebe9282e64f48fa9d897405184e70 +F Makefile.msc bb2cc6f75bbcb2d690fbdd1489914a2febd5e99bad9c77538cb3330d304694c6 F README.md a953c0cffd6e4f2501a306c00ee2b6e1e6630c25031e094629307fe99dd003d1 F VERSION 001dea55eb8304ec9130b6b44a32d3fc349f279d45a7e224fc0730c3cb8e2372 F art/icon-243x273.gif 9750b734f82fdb3dc43127753d5e6fbf3b62c9f4e136c2fbf573b2f57ea87af5 @@ -2213,8 +2213,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P d3d322f122e88ea7d7f086f1c7d3ba8ab5ba7c2899d6d1e18b0b593001f01dcf -R bb2c8958e651ad26411f925c0c07a756 +P 57a4de09149663ac001848773c9dffe53e30f9263e4dacc792a0267401147d25 +R 00e398144b1c8021c6a6644aea3ea6c1 U stephan -Z c605801bdf07518cea6a7c66b5f5a8cb +Z 15bf01d5a4aeb25a1a9a9747fc0d920b # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 6f0953f13b..6263c0d4d4 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -57a4de09149663ac001848773c9dffe53e30f9263e4dacc792a0267401147d25 +a591c018558af70e0ddfdd2d4d61905f030bac01df19ac9b204aed09d44517be From b37f8b97143b6796ef794edcf004014288c21923 Mon Sep 17 00:00:00 2001 From: stephan Date: Mon, 10 Mar 2025 15:35:43 +0000 Subject: [PATCH 009/120] Patch an unnecessary size_t-to-int conversion which warns on some compilers. FossilOrigin-Name: 8681dfdb59d3258663ec176daafd7a52446a207db21fbd1a4d151508092dcbc5 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/test1.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index 0bf4153df8..c7c40d4626 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Ensure\sthat\sthe\s'clean'\starget\sfor\sMakefile.msc\scleans\sup\sthe\stestdir\sdir,\sanalog\sto\show\sthe\scanonical\smakefile\sworks,\sas\sstale\sfiles\sthere\shave\sbeen\sleading\sto\stest\sfailures. -D 2025-03-10T15:27:17.633 +C Patch\san\sunnecessary\ssize_t-to-int\sconversion\swhich\swarns\son\ssome\scompilers. +D 2025-03-10T15:35:43.346 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -792,7 +792,7 @@ F src/status.c 0e72e4f6be6ccfde2488eb63210297e75f569f3ce9920f6c3d77590ec6ce5ffd F src/table.c 0f141b58a16de7e2fbe81c308379e7279f4c6b50eb08efeec5892794a0ba30d1 F src/tclsqlite.c 5875b959c3262d93b32893540c40d4ebb111495adc80db3ee0ddd440966ddcd5 F src/tclsqlite.h 65e2c761446e1c9fa0342b7d2612a703483643c8b6a316d12a65b745a4727395 -F src/test1.c ccfef3b483ce4204741347cb1514d997365f21d6aef79343a216f3c126e79282 +F src/test1.c e89a11192dd15da20e8f7dc0731297182b2fff56cf4afe6ca6f9aeab890595c5 F src/test2.c 62f0830958f9075692c29c6de51b495ae8969e1bef85f239ffcd9ba5fb44a5ff F src/test3.c 432646f581d8af1bb495e58fc98234380250954f5d5535e507fc785eccc3987a F src/test4.c 0ac87fc13cdb334ab3a71823f99b6c32a6bebe5d603cd6a71d84c823d43a25a0 @@ -2213,8 +2213,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 57a4de09149663ac001848773c9dffe53e30f9263e4dacc792a0267401147d25 -R 00e398144b1c8021c6a6644aea3ea6c1 +P a591c018558af70e0ddfdd2d4d61905f030bac01df19ac9b204aed09d44517be +R 6bed3060a5a54ab64492dc249411b575 U stephan -Z 15bf01d5a4aeb25a1a9a9747fc0d920b +Z 690380eef0b46b079ce996dc120adcaf # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 6263c0d4d4..1b1d18ef72 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a591c018558af70e0ddfdd2d4d61905f030bac01df19ac9b204aed09d44517be +8681dfdb59d3258663ec176daafd7a52446a207db21fbd1a4d151508092dcbc5 diff --git a/src/test1.c b/src/test1.c index 70fb305f39..f86fef36ff 100644 --- a/src/test1.c +++ b/src/test1.c @@ -5963,7 +5963,7 @@ static int SQLITE_TCLAPI test_setlk_timeout( if( argc==4 ){ const char *zArg = argv[1]; - int nArg = strlen(zArg); + const size_t nArg = strlen(zArg); if( nArg>=2 && nArg<=15 && memcmp(zArg, "-blockonconnect", nArg)==0 ){ bBlockOnConnect = 1; } From 1fc7844d40f9c18b74c6105762b28a94dc6f2083 Mon Sep 17 00:00:00 2001 From: stephan Date: Tue, 11 Mar 2025 11:24:52 +0000 Subject: [PATCH 010/120] Teach testrunner.tcl to distinguish Cygwin from Windows. This gets it running but then all downstream tests fail, at least in part because of the build target name discrepancies between the platform which requires .exe and those which do not. FossilOrigin-Name: 2861788e479aea12354f2d34d8e6a2706d193642674ef1f4f852f24c877e0140 --- manifest | 12 ++++++------ manifest.uuid | 2 +- test/testrunner.tcl | 11 +++++++++++ 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/manifest b/manifest index 119efea57a..ffb3378cc9 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Merge\strunk\sinto\sthe\scygwin-fixes\sbranch. -D 2025-03-10T17:35:00.466 +C Teach\stestrunner.tcl\sto\sdistinguish\sCygwin\sfrom\sWindows.\sThis\sgets\sit\srunning\sbut\sthen\sall\sdownstream\stests\sfail,\sat\sleast\sin\spart\sbecause\sof\sthe\sbuild\starget\sname\sdiscrepancies\sbetween\sthe\splatform\swhich\srequires\s.exe\sand\sthose\swhich\sdo\snot. +D 2025-03-11T11:24:52.588 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -1730,7 +1730,7 @@ F test/temptable2.test 76821347810ecc88203e6ef0dd6897b6036ac788e9dd3e6b04fd4d163 F test/temptable3.test d11a0974e52b347e45ee54ef1923c91ed91e4637 F test/temptrigger.test 38f0ca479b1822d3117069e014daabcaacefffcc F test/tester.tcl 2244752d5dd5135c03370fa09fec3d02c87440521ca600c09c635b1c2cded9ef -F test/testrunner.tcl 0ffa67806e75aa2c186c63d7d00b16bb45adb91ed6560461fda6dbe3e18c885e x +F test/testrunner.tcl c876f1ee06c69c9aaf4a1df9e4f288d20f6ae9aa8bb8b7ba73ba909e7e4dee4f x F test/testrunner_data.tcl 6d7e7824bb36278ea65c33f7da6dd3ca101fc7d6f7a765b807dce0aa68c52521 F test/thread001.test a0985c117eab62c0c65526e9fa5d1360dd1cac5b03bde223902763274ce21899 F test/thread002.test c24c83408e35ba5a952a3638b7ac03ccdf1ce4409289c54a050ac4c5f1de7502 @@ -2213,8 +2213,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 8681dfdb59d3258663ec176daafd7a52446a207db21fbd1a4d151508092dcbc5 f418de109335cd7cb29d2b587540c163bbaaa7129c662c2908ef67492139b2d7 -R bee86888a7151d2e80a9568beca57317 +P f3d14433f24f89558e72a9085c950bc72440e9933d6b4ff59d6e603d25e39422 +R 968a0e10f0c24011977fed73e0794469 U stephan -Z f13475192cf48b8c4466aedb50a415e2 +Z be3a86ec9d9425377cdfb1a28cbfe62e # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index df41f537a0..f8d75d88c9 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -f3d14433f24f89558e72a9085c950bc72440e9933d6b4ff59d6e603d25e39422 +2861788e479aea12354f2d34d8e6a2706d193642674ef1f4f852f24c877e0140 diff --git a/test/testrunner.tcl b/test/testrunner.tcl index 6ff414c4bd..43f05def07 100755 --- a/test/testrunner.tcl +++ b/test/testrunner.tcl @@ -263,6 +263,17 @@ switch -nocase -glob -- $tcl_platform(os) { set TRG(shell) sqlite3.exe set TRG(run) run.bat set TRG(runcmd) "run.bat" + if {"unix" eq $tcl_platform(platform)} { + # Presumably cygwin. This block gets testrunner.tcl started on + # Cygwin but then downstream tests all fail, at least in part + # because of the discrepancies in build target names which need + # .exe on cygwin but not on other Unix-like platforms. + set TRG(platform) cygwin + set TRG(make) make.sh + set TRG(makecmd) "bash make.sh" + set TRG(run) run.sh + set TRG(runcmd) "bash run.sh" + } } default { puts "tcl_platform(os)=$::tcl_platform(os)" From ff3c451428fb2cbadaa38acea1ef47c20368daf4 Mon Sep 17 00:00:00 2001 From: stephan Date: Wed, 12 Mar 2025 11:41:12 +0000 Subject: [PATCH 011/120] Document that sqlite_update_hook() can unset the current hook by passing a NULL callback, to address [forum:652aef4747|forum post 652aef4747]. FossilOrigin-Name: 2b582c0097e3374beb280dfa6b03e0dacb9911da1bceb0dce0468e6b7291e74f --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/sqlite.h.in | 2 ++ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/manifest b/manifest index ffb3378cc9..aa26f838be 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Teach\stestrunner.tcl\sto\sdistinguish\sCygwin\sfrom\sWindows.\sThis\sgets\sit\srunning\sbut\sthen\sall\sdownstream\stests\sfail,\sat\sleast\sin\spart\sbecause\sof\sthe\sbuild\starget\sname\sdiscrepancies\sbetween\sthe\splatform\swhich\srequires\s.exe\sand\sthose\swhich\sdo\snot. -D 2025-03-11T11:24:52.588 +C Document\sthat\ssqlite_update_hook()\scan\sunset\sthe\scurrent\shook\sby\spassing\sa\sNULL\scallback,\sto\saddress\s[forum:652aef4747|forum\spost\s652aef4747]. +D 2025-03-12T11:41:12.314 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -783,7 +783,7 @@ F src/resolve.c 626c24b258b111f75c22107aa5614ad89810df3026f5ca071116d3fe75925c75 F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97 F src/select.c df63f64ef91c132dd12d37c876653f8b5493d2d5cf330a27158912ee5a065451 F src/shell.c.in ad3cb02ead5551be11ecf1433899d7585ad3bed669de0de9a70dabfd6a8a7256 -F src/sqlite.h.in 3db05f6603c78d9e6fe035e9e12bed4ca8140135d05ff092becc2cf7d7d1fefb +F src/sqlite.h.in fd70afd92948cf7cc93f687ac960bad1b0b6fbc436752419eff2fd65a1809380 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h 3f046c04ea3595d6bfda99b781926b17e672fd6d27da2ba6d8d8fc39981dcb54 F src/sqliteInt.h 130217107c0425ab43d098c6eadf8aa2e1a037e26d79384127e2d950b27eec77 @@ -2213,8 +2213,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P f3d14433f24f89558e72a9085c950bc72440e9933d6b4ff59d6e603d25e39422 -R 968a0e10f0c24011977fed73e0794469 +P 2861788e479aea12354f2d34d8e6a2706d193642674ef1f4f852f24c877e0140 +R 39ece01250415efbd73e452eb44cdc31 U stephan -Z be3a86ec9d9425377cdfb1a28cbfe62e +Z 0209cd6647f7cb13545ac5e22f3084f2 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index f8d75d88c9..0702ddd0ac 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -2861788e479aea12354f2d34d8e6a2706d193642674ef1f4f852f24c877e0140 +2b582c0097e3374beb280dfa6b03e0dacb9911da1bceb0dce0468e6b7291e74f diff --git a/src/sqlite.h.in b/src/sqlite.h.in index c53218aa00..71338031c8 100644 --- a/src/sqlite.h.in +++ b/src/sqlite.h.in @@ -7071,6 +7071,8 @@ int sqlite3_autovacuum_pages( ** ** ^The second argument is a pointer to the function to invoke when a ** row is updated, inserted or deleted in a rowid table. +** ^The update hook is disabled by invoking sqlite3_update_hook() +** with a NULL pointer as the second parameter. ** ^The first argument to the callback is a copy of the third argument ** to sqlite3_update_hook(). ** ^The second callback argument is one of [SQLITE_INSERT], [SQLITE_DELETE], From 52e2a7930474cb7d1c7550a9174d98acf76a4104 Mon Sep 17 00:00:00 2001 From: stephan Date: Wed, 19 Mar 2025 13:49:34 +0000 Subject: [PATCH 012/120] Test script patches from Jan Nijtmans: always use -DUSE_TCL_STUBS in buildtclext.tcl and improvements in how TRG is populated in testrunner.tcl. FossilOrigin-Name: aa192203aa1aa188866fe00a5d40dc7b7c72b4f38b06da8708ed0a6c8b8638a6 --- manifest | 14 +++++++------- manifest.uuid | 2 +- test/testrunner.tcl | 2 ++ tool/buildtclext.tcl | 15 ++++++++++----- 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/manifest b/manifest index 341d72e3b2..82a488dae2 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Merge\strunk\sinto\sthe\scygwin-fixes\sbranch\sfor\sthe\sshell\stest\simprovements\son\sWindows.\sAn\sMSC\sbuild's\smake\stest\snow\shas\szero\sfailures. -D 2025-03-19T13:13:12.804 +C Test\sscript\spatches\sfrom\sJan\sNijtmans:\salways\suse\s-DUSE_TCL_STUBS\sin\sbuildtclext.tcl\sand\simprovements\sin\show\sTRG\sis\spopulated\sin\stestrunner.tcl. +D 2025-03-19T13:49:34.348 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -1732,7 +1732,7 @@ F test/temptable2.test 76821347810ecc88203e6ef0dd6897b6036ac788e9dd3e6b04fd4d163 F test/temptable3.test d11a0974e52b347e45ee54ef1923c91ed91e4637 F test/temptrigger.test 38f0ca479b1822d3117069e014daabcaacefffcc F test/tester.tcl e7f0c903b2d9dcaa44e707db183d22a5fe17b3f9a3c05a5eed1f4cb5c8fe63bc -F test/testrunner.tcl c876f1ee06c69c9aaf4a1df9e4f288d20f6ae9aa8bb8b7ba73ba909e7e4dee4f x +F test/testrunner.tcl 331e5babe5ffff8adb4be91439e698f12aed80d4b137d2f40346ac84e0b3c03f x F test/testrunner_data.tcl 6d7e7824bb36278ea65c33f7da6dd3ca101fc7d6f7a765b807dce0aa68c52521 F test/thread001.test a0985c117eab62c0c65526e9fa5d1360dd1cac5b03bde223902763274ce21899 F test/thread002.test c24c83408e35ba5a952a3638b7ac03ccdf1ce4409289c54a050ac4c5f1de7502 @@ -2120,7 +2120,7 @@ F tool/GetTclKit.bat d84033c6a93dfe735d247f48ba00292a1cc284dcf69963e5e672444e045 F tool/Replace.cs 02c67258801c2fb5f63231e0ac0f220b4b36ba91 F tool/build-all-msvc.bat 1960a7a3e5d8176c4329e31476f6e3dfa9543675355fa9020a569f4452628458 x F tool/build-shell.sh 369c4b171cc877ad974fef691e4da782b4c1e99fe8f4361316c735f64d49280f -F tool/buildtclext.tcl 20726b6b73c7911baa8519a9467b4062104339a5ce57947819884525c56d79e3 +F tool/buildtclext.tcl 11087f26ba6893b0dab4f1df2d5fa9a62ce60523d8955f83c3c5a06e0ef2e65e F tool/cg_anno.tcl c1f875f5a4c9caca3d59937b16aff716f8b1883935f1b4c9ae23124705bc8099 x F tool/checkSpacing.c 810e51703529a204fc4e1eb060e9ab663e3c06d2 F tool/cktclsh.sh 6075eef9c6b9ba4b38fef2ca2a66d25f2311bd3c610498d18a9b01f861629cca @@ -2215,8 +2215,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 34eadd374b3c0a8c9e1f5f4a1c60fda8f16b1c56213b8c4047f96390c676b695 c7fd71c77f1716c9c85d0f41a07ebd7c96f2e9d5e4c1392fefa1fb53f3cbb746 -R 845242d912ca9bbb3e29d43c1ca0e37f +P 2de4efe10c2591192edca3833fc9e2fae10ebc925fb556f5b53ad483b491b5b3 +R a1f9b9c695690bc937b92783cf4b7ead U stephan -Z 041683d3233cddf8d81113a8c4a0a404 +Z 5451b318439ae9b1137b5b0735e64e79 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 15da4f043f..d2300f9236 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -2de4efe10c2591192edca3833fc9e2fae10ebc925fb556f5b53ad483b491b5b3 +aa192203aa1aa188866fe00a5d40dc7b7c72b4f38b06da8708ed0a6c8b8638a6 diff --git a/test/testrunner.tcl b/test/testrunner.tcl index 43f05def07..2c7a9f891d 100755 --- a/test/testrunner.tcl +++ b/test/testrunner.tcl @@ -271,6 +271,8 @@ switch -nocase -glob -- $tcl_platform(os) { set TRG(platform) cygwin set TRG(make) make.sh set TRG(makecmd) "bash make.sh" + set TRG(testfixture) testfixture + set TRG(shell) sqlite3 set TRG(run) run.sh set TRG(runcmd) "bash run.sh" } diff --git a/tool/buildtclext.tcl b/tool/buildtclext.tcl index 905087d1da..a3e8783cd8 100644 --- a/tool/buildtclext.tcl +++ b/tool/buildtclext.tcl @@ -149,15 +149,20 @@ if {$tcl_platform(platform)=="windows"} { append INC " $inc" } set cmd {${CC} ${CFLAGS} ${LDFLAGS} -shared} - regexp {TCL_SHLIB_LD='([^']+)'} $tclConfig all cmd + regexp {TCL_SHLIB_LD='([^']+)(-Wl,--out-implib.*)?'} $tclConfig all cmd set LDFLAGS "$INC -DUSE_TCL_STUBS" if {[string length $OPTS]>1} { append LDFLAGS $OPTS } - if {$TCLMAJOR>8} { - set OUT libtcl9sqlite$VERSION.$SUFFIX + if {$tcl_platform(os)=="Windows NT"} { + set OUT cyg } else { - set OUT libsqlite$VERSION.$SUFFIX + set OUT lib + } + if {$TCLMAJOR>8} { + set OUT ${OUT}tcl9sqlite$VERSION.$SUFFIX + } else { + set OUT ${OUT}sqlite$VERSION.$SUFFIX } set @ $OUT; # Workaround for https://sqlite.org/forum/forumpost/0683a49cb02f31a1 # in which Gentoo edits their tclConfig.sh to include an soname @@ -295,7 +300,7 @@ package ifneeded sqlite3 $VERSION \\ # Generate and execute the command with which to do the compilation. # - set cmd "$CMD tclsqlite3.c -o $OUT $LIBS" + set cmd "$CMD -DUSE_TCL_STUBS tclsqlite3.c -o $OUT $LIBS" puts $cmd file delete -force $OUT catch {exec {*}$cmd} errmsg From f715576a6c3758e60949d3d00cb0ef2b6bf0f988 Mon Sep 17 00:00:00 2001 From: stephan Date: Wed, 19 Mar 2025 14:52:39 +0000 Subject: [PATCH 013/120] Add some explicit db close calls to work around a process-reaping timing problem on cygwin builds. FossilOrigin-Name: 7126a51ed8a1b90b7f4cf3f1c13f7a1d560ff7a3ae73897ce8d9194df40356ed --- ext/session/sessionconflict.test | 2 +- ext/session/sessioninvert.test | 1 + manifest | 14 +++++++------- manifest.uuid | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-) mode change 100644 => 100755 ext/session/sessionconflict.test mode change 100644 => 100755 ext/session/sessioninvert.test diff --git a/ext/session/sessionconflict.test b/ext/session/sessionconflict.test old mode 100644 new mode 100755 index 25b2602998..a8be01320b --- a/ext/session/sessionconflict.test +++ b/ext/session/sessionconflict.test @@ -72,5 +72,5 @@ do_execsql_test -db db2 1.3 { } - +db2 close finish_test diff --git a/ext/session/sessioninvert.test b/ext/session/sessioninvert.test old mode 100644 new mode 100755 index b7c157d2e7..e5cf453550 --- a/ext/session/sessioninvert.test +++ b/ext/session/sessioninvert.test @@ -144,6 +144,7 @@ do_test 3.0 { }] list [catch { sqlite3changeset_apply_v2 -invert db2 $P {} } msg] $msg + db2 close } {1 SQLITE_CORRUPT} do_test 3.1 { diff --git a/manifest b/manifest index 82a488dae2..181d640b85 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Test\sscript\spatches\sfrom\sJan\sNijtmans:\salways\suse\s-DUSE_TCL_STUBS\sin\sbuildtclext.tcl\sand\simprovements\sin\show\sTRG\sis\spopulated\sin\stestrunner.tcl. -D 2025-03-19T13:49:34.348 +C Add\ssome\sexplicit\sdb\sclose\scalls\sto\swork\saround\sa\sprocess-reaping\stiming\sproblem\son\scygwin\sbuilds. +D 2025-03-19T14:52:39.421 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -600,12 +600,12 @@ F ext/session/sessionat.test 00c8badb35e43a2f12a716d2734a44d614ff62361979b6b8541 F ext/session/sessionbig.test 47c381e7acfabeef17d98519a3080d69151723354d220afa2053852182ca7adf F ext/session/sessionblob.test 87faf667870b72f08e91969abd9f52a383ab7b514506ee194d64a39d8faff00a F ext/session/sessionchange.test 77c4702050f24270b58070e2cf01c95c3d232a3ef164b70f31974b386ce69903 -F ext/session/sessionconflict.test 8b8cbd98548e2e636ddc17d0986276f60e833fb865617dd4f88ea5bbe3a16b96 +F ext/session/sessionconflict.test 19e4a53795c4c930bfec49e809311e09b2a9e202d9446e56d7a8b139046a0c07 x F ext/session/sessiondiff.test e89f7aedcdd89e5ebac3a455224eb553a171e9586fc3e1e6a7b3388d2648ba8d F ext/session/sessionfault.test c2b43d01213b389a3f518e90775fca2120812ba51e50444c4066962263e45c11 F ext/session/sessionfault2.test b0d6a7c1d7398a7e800d84657404909c7d385965ea8576dc79ed344c46fbf41c F ext/session/sessionfault3.test ce0b5d182133935c224d72507dbf1c5be1a1febf7e85d0b0fbd6d2f724b32b96 -F ext/session/sessioninvert.test 04075517a9497a80d39c495ba6b44f3982c7371129b89e2c52219819bc105a25 +F ext/session/sessioninvert.test 526474af44eff2e10294917156157351c1ef8d0b0e11a471c3455ac307a39f33 x F ext/session/sessionmem.test f2a735db84a3e9e19f571033b725b0b2daf847f3f28b1da55a0c1a4e74f1de09 F ext/session/sessionnoact.test 4c7ae5c7d351cb5323bca62b6b095592ad24bd90a6713c178b62ab0063d23e19 F ext/session/sessionnoop.test a9366a36a95ef85f8a3687856ebef46983df399541174cb1ede2ee53b8011bc7 @@ -2215,8 +2215,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 2de4efe10c2591192edca3833fc9e2fae10ebc925fb556f5b53ad483b491b5b3 -R a1f9b9c695690bc937b92783cf4b7ead +P aa192203aa1aa188866fe00a5d40dc7b7c72b4f38b06da8708ed0a6c8b8638a6 +R edf7734e5412e3ba5b84bd2ff897b04b U stephan -Z 5451b318439ae9b1137b5b0735e64e79 +Z 6f02f8b1b56e149fdce26078a0f8b42a # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index d2300f9236..fff12aed11 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -aa192203aa1aa188866fe00a5d40dc7b7c72b4f38b06da8708ed0a6c8b8638a6 +7126a51ed8a1b90b7f4cf3f1c13f7a1d560ff7a3ae73897ce8d9194df40356ed From 18b250e9c9ad980deb04594ab762b1e9f897389a Mon Sep 17 00:00:00 2001 From: stephan Date: Wed, 19 Mar 2025 14:57:32 +0000 Subject: [PATCH 014/120] Correct part of [04075517] which changed the implicit return value of a test function. FossilOrigin-Name: 505d9e49f7af619eda9e46e7ed19c4446c64628233528e1ab3f70264e1640ace --- ext/session/sessioninvert.test | 3 ++- manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/ext/session/sessioninvert.test b/ext/session/sessioninvert.test index e5cf453550..37095b9f22 100755 --- a/ext/session/sessioninvert.test +++ b/ext/session/sessioninvert.test @@ -143,8 +143,9 @@ do_test 3.0 { DELETE FROM t2 WHERE d = 3; }] - list [catch { sqlite3changeset_apply_v2 -invert db2 $P {} } msg] $msg + set rv [list [catch { sqlite3changeset_apply_v2 -invert db2 $P {} } msg] $msg] db2 close + return $rv } {1 SQLITE_CORRUPT} do_test 3.1 { diff --git a/manifest b/manifest index 181d640b85..6dc2c82e5d 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\ssome\sexplicit\sdb\sclose\scalls\sto\swork\saround\sa\sprocess-reaping\stiming\sproblem\son\scygwin\sbuilds. -D 2025-03-19T14:52:39.421 +C Correct\spart\sof\s[04075517]\swhich\schanged\sthe\simplicit\sreturn\svalue\sof\sa\stest\sfunction. +D 2025-03-19T14:57:32.611 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -605,7 +605,7 @@ F ext/session/sessiondiff.test e89f7aedcdd89e5ebac3a455224eb553a171e9586fc3e1e6a F ext/session/sessionfault.test c2b43d01213b389a3f518e90775fca2120812ba51e50444c4066962263e45c11 F ext/session/sessionfault2.test b0d6a7c1d7398a7e800d84657404909c7d385965ea8576dc79ed344c46fbf41c F ext/session/sessionfault3.test ce0b5d182133935c224d72507dbf1c5be1a1febf7e85d0b0fbd6d2f724b32b96 -F ext/session/sessioninvert.test 526474af44eff2e10294917156157351c1ef8d0b0e11a471c3455ac307a39f33 x +F ext/session/sessioninvert.test 61e686ddfede3a73235e95eca9955d747bdaf8f817ca8687c15c524fc8257701 x F ext/session/sessionmem.test f2a735db84a3e9e19f571033b725b0b2daf847f3f28b1da55a0c1a4e74f1de09 F ext/session/sessionnoact.test 4c7ae5c7d351cb5323bca62b6b095592ad24bd90a6713c178b62ab0063d23e19 F ext/session/sessionnoop.test a9366a36a95ef85f8a3687856ebef46983df399541174cb1ede2ee53b8011bc7 @@ -2215,8 +2215,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P aa192203aa1aa188866fe00a5d40dc7b7c72b4f38b06da8708ed0a6c8b8638a6 -R edf7734e5412e3ba5b84bd2ff897b04b +P 7126a51ed8a1b90b7f4cf3f1c13f7a1d560ff7a3ae73897ce8d9194df40356ed +R e63576a4439e1023f4363a8cd98ac65c U stephan -Z 6f02f8b1b56e149fdce26078a0f8b42a +Z ec876770a21d7686f86f9c0d8c202700 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index fff12aed11..644f90f52e 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -7126a51ed8a1b90b7f4cf3f1c13f7a1d560ff7a3ae73897ce8d9194df40356ed +505d9e49f7af619eda9e46e7ed19c4446c64628233528e1ab3f70264e1640ace From 339f9a33b4a9c675b9e7e0457868a2a1b99833fe Mon Sep 17 00:00:00 2001 From: stephan Date: Wed, 19 Mar 2025 15:21:21 +0000 Subject: [PATCH 015/120] Correct part of [505d9e49f7] and [7126a51ed8] to get sessioninvert tests working on cygwin. FossilOrigin-Name: 83c34decbe336c76062e6b1bfe4c2e8f786841a4b6efa001747e786e872c8c71 --- ext/session/sessioninvert.test | 6 +++--- manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ext/session/sessioninvert.test b/ext/session/sessioninvert.test index 37095b9f22..b9921f5e64 100755 --- a/ext/session/sessioninvert.test +++ b/ext/session/sessioninvert.test @@ -143,9 +143,7 @@ do_test 3.0 { DELETE FROM t2 WHERE d = 3; }] - set rv [list [catch { sqlite3changeset_apply_v2 -invert db2 $P {} } msg] $msg] - db2 close - return $rv + list [catch { sqlite3changeset_apply_v2 -invert db2 $P {} } msg] $msg } {1 SQLITE_CORRUPT} do_test 3.1 { @@ -157,6 +155,8 @@ do_test 3.2 { compare_db db db2 } {} +db2 close + #------------------------------------------------------------------------- # reset_db diff --git a/manifest b/manifest index 6dc2c82e5d..58d6822f2f 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Correct\spart\sof\s[04075517]\swhich\schanged\sthe\simplicit\sreturn\svalue\sof\sa\stest\sfunction. -D 2025-03-19T14:57:32.611 +C Correct\spart\sof\s[505d9e49f7]\sand\s[7126a51ed8]\sto\sget\ssessioninvert\stests\sworking\son\scygwin. +D 2025-03-19T15:21:21.407 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -605,7 +605,7 @@ F ext/session/sessiondiff.test e89f7aedcdd89e5ebac3a455224eb553a171e9586fc3e1e6a F ext/session/sessionfault.test c2b43d01213b389a3f518e90775fca2120812ba51e50444c4066962263e45c11 F ext/session/sessionfault2.test b0d6a7c1d7398a7e800d84657404909c7d385965ea8576dc79ed344c46fbf41c F ext/session/sessionfault3.test ce0b5d182133935c224d72507dbf1c5be1a1febf7e85d0b0fbd6d2f724b32b96 -F ext/session/sessioninvert.test 61e686ddfede3a73235e95eca9955d747bdaf8f817ca8687c15c524fc8257701 x +F ext/session/sessioninvert.test 9018f6a7387ac745084b6374c5e1aa14d648b372e6e1181cfab3df632b662d26 x F ext/session/sessionmem.test f2a735db84a3e9e19f571033b725b0b2daf847f3f28b1da55a0c1a4e74f1de09 F ext/session/sessionnoact.test 4c7ae5c7d351cb5323bca62b6b095592ad24bd90a6713c178b62ab0063d23e19 F ext/session/sessionnoop.test a9366a36a95ef85f8a3687856ebef46983df399541174cb1ede2ee53b8011bc7 @@ -2215,8 +2215,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 7126a51ed8a1b90b7f4cf3f1c13f7a1d560ff7a3ae73897ce8d9194df40356ed -R e63576a4439e1023f4363a8cd98ac65c +P 505d9e49f7af619eda9e46e7ed19c4446c64628233528e1ab3f70264e1640ace +R 08c1a7493121908afbb1dcd042c1e7a8 U stephan -Z ec876770a21d7686f86f9c0d8c202700 +Z 7f697af593c155277b9e5f1e31c153ef # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 644f90f52e..bc4be40e96 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -505d9e49f7af619eda9e46e7ed19c4446c64628233528e1ab3f70264e1640ace +83c34decbe336c76062e6b1bfe4c2e8f786841a4b6efa001747e786e872c8c71 From 515b51f635263d0c46f4c541e4aef64b4964ca47 Mon Sep 17 00:00:00 2001 From: stephan Date: Sat, 22 Mar 2025 16:14:34 +0000 Subject: [PATCH 016/120] Add a mechanism to the configure script to allow certain client-specific builds to extend or override the configure options without having to edit sqlite-config.tcl, the goal being to reduce merge conflicts in those builds when updating sqlite-config.tcl from the canonical copy. FossilOrigin-Name: bafab4ee5545c6cf6eafc5e352a7f25dfcbc7e58d4cc9064d05658c39de2af0d --- autosetup/sqlite-config.tcl | 31 +++++++++++++++++++++++++------ manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 32 insertions(+), 13 deletions(-) diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl index 15c0995500..ab2b80956e 100644 --- a/autosetup/sqlite-config.tcl +++ b/autosetup/sqlite-config.tcl @@ -180,6 +180,8 @@ proc sqlite-configure {buildMode configScript} { threadsafe=1 => {Disable mutexing} with-tempstore:=no => {Use an in-RAM database for temporary tables: never,no,yes,always} load-extension=1 => {Disable loading of external extensions} + # ^^^ one of the downstream custom builds overrides the load-extension default to 0, which + # confuses the --help text generator. https://github.com/msteveb/autosetup/issues/77 math=1 => {Disable math functions} json=1 => {Disable JSON functions} memsys5 => {Enable MEMSYS5} @@ -307,9 +309,9 @@ proc sqlite-configure {buildMode configScript} { # out-implib: https://sqlite.org/forum/forumpost/0c7fc097b2 out-implib:=auto => {Enable use of --out-implib linker flag to generate an - "import library" for the DLL. The output's base name name is - specified by the value, with "auto" meaning to figure out a - name automatically. On some platforms this flag gets + "import library" for the DLL. The output's base name is + specified by this flag's value, with "auto" meaning to figure + out a name automatically. On some platforms this flag gets automatically enabled if it is not provided. Use "none" to explicitly disable this feature on such platforms.} } @@ -353,9 +355,20 @@ proc sqlite-configure {buildMode configScript} { (for build debugging)} } } - }; # $allOpts + }; # $allFlags - # Filter allOpts to create the set of [options] legal for this build + set allFlags [proj-strip-hash-comments $allFlags] + # ^^^ lappend of [sqlite-custom-flags] introduces weirdness if + # we delay [proj-strip-hash-comments] until after that. + + if {[llength [info proc sqlite-custom-flags]] > 0} { + # sqlite-custom-flags is assumed to be imported via a + # client-specific import: autosetup/local.tcl, autosetup/*.auto, + # or autosetup/*/*.auto. + lappend allFlags sqlite-custom-flags [sqlite-custom-flags] + } + + # Filter allFlags to create the set of [options] legal for this build set opts {} foreach {group XY} [subst -nobackslashes -nocommands \ [proj-strip-hash-comments $allFlags]] { @@ -1353,7 +1366,7 @@ proc sqlite-handle-load-extension {} { if {$found} { msg-result "Loadable extension support enabled." } else { - msg-result "Disabling loadable extension support. Use --enable-load-extensions to enable them." + msg-result "Disabling loadable extension support. Use --enable-load-extension to enable them." sqlite-add-feature-flag {-DSQLITE_OMIT_LOAD_EXTENSION=1} } return $found @@ -1579,6 +1592,12 @@ proc sqlite-handle-env-quirks {} { sqlite-handle-dll-basename sqlite-handle-out-implib sqlite-handle-mac-cversion + if {[llength [info proc sqlite-handle-custom-flags]] > 0} { + # sqlite-handle-custom-flags is assumed to be imported via a + # client-specific import: autosetup/local.tcl, autosetup/*.auto, + # or autosetup/*/*.auto. + sqlite-handle-custom-flags + } } ######################################################################## diff --git a/manifest b/manifest index 45d50e3329..aaae7f9c85 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Configure\sscript\sinternal\scleanups\sand\sre-orgs.\sNo\sfunctional\schanges. -D 2025-03-22T12:43:22.020 +C Add\sa\smechanism\sto\sthe\sconfigure\sscript\sto\sallow\scertain\sclient-specific\sbuilds\sto\sextend\sor\soverride\sthe\sconfigure\soptions\swithout\shaving\sto\sedit\ssqlite-config.tcl,\sthe\sgoal\sbeing\sto\sreduce\smerge\sconflicts\sin\sthose\sbuilds\swhen\supdating\ssqlite-config.tcl\sfrom\sthe\scanonical\scopy. +D 2025-03-22T16:14:34.864 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -50,7 +50,7 @@ F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba F autosetup/proj.tcl 49faf960df88a374686234105def663dbfc297ab79c87686df0a0b973dd77018 -F autosetup/sqlite-config.tcl 6e1dce27dfb69910bc28c3d3d4e33470fffc3c68f1d6a87799d34a2cc27f79dd +F autosetup/sqlite-config.tcl c7c8dc9b864f0212bda4a1dfd30777f3757ff12d7b18adce1420c0f717c4c284 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x F contrib/sqlitecon.tcl eb4c6578e08dd353263958da0dc620f8400b869a50d06e271ab0be85a51a08d3 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 6d2e57bd34c562a9cd618c178c3f92b869bf5420907057b8d2438b16a7f91d46 -R 62beb2007ca701c04bb0d952df27e3be +P f619e40fb05d3e09dca2ad9d9bbf38c66b4b93dd3d4e7c2071db28e671ee6a9c +R f67c95dd2f17cb92eaf9fc59dd22ee04 U stephan -Z 0c3e870740ca71059ff9bfd7fd177692 +Z 9a64dbd75b7ea845562f9902f8b1107a # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 3b86c2d55b..34f2f2d47f 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -f619e40fb05d3e09dca2ad9d9bbf38c66b4b93dd3d4e7c2071db28e671ee6a9c +bafab4ee5545c6cf6eafc5e352a7f25dfcbc7e58d4cc9064d05658c39de2af0d From d9535334c651f1c9bd609d29f51d1e03244ff1dd Mon Sep 17 00:00:00 2001 From: stephan Date: Sat, 22 Mar 2025 17:00:32 +0000 Subject: [PATCH 017/120] Teach mkautoconfamal.sh to avoid copying autosetup/local.tcl and autosetup/*.auto except for autosetup/lib/CURRENT-BRANCH-NAME.auto (if any), the intent being to use lib/CURRENT-BRANCH-NAME.auto for branch-specific configuration customizations. FossilOrigin-Name: dfe24f13c446de5fdd736ed52fec0fca4637b4151ba008de7a598a2fc9398816 --- manifest | 12 ++++++------ manifest.uuid | 2 +- tool/mkautoconfamal.sh | 17 +++++++++++++++++ 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/manifest b/manifest index aaae7f9c85..04fb6abb82 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sa\smechanism\sto\sthe\sconfigure\sscript\sto\sallow\scertain\sclient-specific\sbuilds\sto\sextend\sor\soverride\sthe\sconfigure\soptions\swithout\shaving\sto\sedit\ssqlite-config.tcl,\sthe\sgoal\sbeing\sto\sreduce\smerge\sconflicts\sin\sthose\sbuilds\swhen\supdating\ssqlite-config.tcl\sfrom\sthe\scanonical\scopy. -D 2025-03-22T16:14:34.864 +C Teach\smkautoconfamal.sh\sto\savoid\scopying\sautosetup/local.tcl\sand\sautosetup/*.auto\sexcept\sfor\sautosetup/lib/CURRENT-BRANCH-NAME.auto\s(if\sany),\sthe\sintent\sbeing\sto\suse\slib/CURRENT-BRANCH-NAME.auto\sfor\sbranch-specific\sconfiguration\scustomizations. +D 2025-03-22T17:00:32.967 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -2151,7 +2151,7 @@ F tool/logest.c c34e5944318415de513d29a6098df247a9618c96d83c38d4abd88641fe46e669 F tool/max-limits.c cbb635fbb37ae4d05f240bfb5b5270bb63c54439 F tool/merge-test.tcl de76b62f2de2a92d4c1ca4f976bce0aea6899e0229e250479b229b2a1914b176 F tool/mkamalzip.tcl 8aa5ebe7973c8b8774062d34e15fea9815c4cc2ceea3a9b184695f005910876a -F tool/mkautoconfamal.sh c5e65fa1c922f2e3b3e4f6cd0331ec7d84bdef085f32cb1c46673cdf95ec8090 +F tool/mkautoconfamal.sh 6b040e008a318c2b92b0b8cf9b7879f2843433aea6834e89897a0f21ebc46e5b F tool/mkccode.tcl c42a8f8cf78f92e83795d5447460dbce7aaf78a3bbf9082f1507dc71a3665f3c x F tool/mkctimec.tcl f76dbfc74cefad8d126384ba3263677939f077bd184fcdf8c592a1daf64f50c3 x F tool/mkkeywordhash.c 6b0be901c47f9ad42215fc995eb2f4384ac49213b1fba395102ec3e999acf559 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P f619e40fb05d3e09dca2ad9d9bbf38c66b4b93dd3d4e7c2071db28e671ee6a9c -R f67c95dd2f17cb92eaf9fc59dd22ee04 +P bafab4ee5545c6cf6eafc5e352a7f25dfcbc7e58d4cc9064d05658c39de2af0d +R 6b1a45c990d67ff1ce7361064641b32c U stephan -Z 9a64dbd75b7ea845562f9902f8b1107a +Z 2e3346333053a23fc85b7950d2cfe6bb # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 34f2f2d47f..84fd431ba3 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -bafab4ee5545c6cf6eafc5e352a7f25dfcbc7e58d4cc9064d05658c39de2af0d +dfe24f13c446de5fdd736ed52fec0fca4637b4151ba008de7a598a2fc9398816 diff --git a/tool/mkautoconfamal.sh b/tool/mkautoconfamal.sh index c26ac8c73c..afe60fd66f 100644 --- a/tool/mkautoconfamal.sh +++ b/tool/mkautoconfamal.sh @@ -24,6 +24,12 @@ TMPSPACE=./mkpkg_tmp_dir VERSION=`cat $TOP/VERSION` HASH=`cut -c1-10 $TOP/manifest.uuid` DATETIME=`grep '^D' $TOP/manifest | tr -c -d '[0-9]' | cut -c1-12` +BRANCH=`fossil whatis $HASH | awk '/tags:/{print $2}'` + +if [ x = "x${BRANCH}" ]; then + echo "Cannot determine the current branch" 1>&2 + exit 1 +fi # Inject the current version into the TEA autoconf file. # @@ -37,6 +43,8 @@ then echo "TEA version number ok" else echo "TEA version number mismatch. Should be $VERSION"; exit 1 fi + + # If this script is given an argument of --snapshot, then generate a # snapshot tarball named for the current checkout SHA hash, rather than # the version number. @@ -59,6 +67,15 @@ fi rm -rf $TMPSPACE cp -R $TOP/autoconf $TMPSPACE cp -R $TOP/autosetup $TMPSPACE +# Do not include build-specific customizations in the autoconf build: +rm -f $TMPSPACE/autosetup/local.tcl $TMPSPACE/autosetup/*.auto $TMPSPACE/autosetup/*/*.auto +# ... unless we find one which matches the current branch name: +bac=$TOP/autosetup/lib/${BRANCH}.auto +if [ -f $bac ]; then + echo "Copying branch-specific autosetup configuration: $bac" + mkdir -p $TMPSPACE/autosetup/lib + cp $bac $TMPSPACE/autosetup/lib +fi cp -p $TOP/configure $TMPSPACE cp sqlite3.c $TMPSPACE cp sqlite3.h $TMPSPACE From 77dc2d8fb1dfe967396c208bb655f83a9128c016 Mon Sep 17 00:00:00 2001 From: stephan Date: Sat, 22 Mar 2025 17:28:29 +0000 Subject: [PATCH 018/120] Document the new configuration customization approach and extend it to enable sqlite-custom-flags to return an empty string to denote that it does not require any new flags (it may still customize flag default values in such cases). FossilOrigin-Name: b0c7800b0106e90cb7bf7e5d9f48d21f9b058eff6e42339a1621d713ab2dd03c --- autosetup/README.md | 68 +++++++++++++++++++++++++++++++++++++ autosetup/sqlite-config.tcl | 5 ++- manifest | 14 ++++---- manifest.uuid | 2 +- 4 files changed, 80 insertions(+), 9 deletions(-) diff --git a/autosetup/README.md b/autosetup/README.md index a61f94fbda..c0aeff15d0 100644 --- a/autosetup/README.md +++ b/autosetup/README.md @@ -15,6 +15,8 @@ build infrastructure. It is not an [Autosetup][] reference. - Do Not Update Global Shared State - [Updating Autosetup](#updating) - ***[Patching Autosetup for Project-local changes](#patching)*** +- [Branch-specific Customization](#branch-customization) + ------------------------------------------------------------------------ @@ -385,6 +387,72 @@ If autosetup is upgraded and this patch is _not_ applied the invoking `./configure` will fail loudly because of the declaration of the `debug` flag in `auto.def` - duplicated flags are not permitted. + +Branch-specific Customization +======================================================================== + +Certain vendor-specific branches require slight configure script +customization. Rather than editing `sqlite-config.tcl` for this, +which frequently leads to merge conflicts, the following approach +is recommended: + +In the vendor-specific branch, create a file named +`autosetup/lib/THE-BRANCH-NAME.auto`. Autosetup will automatically +load any files named `autosetup/*.auto` or `autosetup/*/*.auto` when +it starts up. + +That file should contain the following content... + +If flag customization is required, add: + +> +``` +proc sqlite-custom-flags {} { + # If any existing --flags require different default values + # then call: + options-defaults { + flag-name new-default-value + } + # ^^^ That will replace the default value but will not update + # the --help text, which may lead to some confusion: + # https://github.com/msteveb/autosetup/issues/77 + + return { + {*} { + new-flag-name {Help text} + ... + } + }; #see below +} +``` + +That function must return either an empty string or a list in the form +used internally by `sqlite-config.tcl:sqlite-configure`. + +Next, define: + +> +``` +proc sqlite-handle-custom-flags {} { + ... do any custom flag handling here ... +} +``` + +That function will be called relatively late in the configure process, +before any filtered files are generated but after all other +significant processing. + +It is important that no more than one `*.auto` or `local.tcl` file +defines these functions. Autosetup will load these in an unspecified +order, and the _last_ one which is loaded will overwrite any procs +defined in files loaded before it. + +When running [mkautoconfamal.sh](/file/tool/mkautoconfamal.sh) +(typically via `make amalgamation-tarball` or `make snapshot-tarball`), +all `autosetup/local.tcl` and `autosetup/[*/]*.auto` files will be +elided from the tarball except for `autosetup/lib/X.auto`, where `X` +is the name of the current checkout's branch. + [Autosetup]: https://msteveb.github.io/autosetup/ [auto.def]: /file/auto.def diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl index ab2b80956e..0ead4cd77e 100644 --- a/autosetup/sqlite-config.tcl +++ b/autosetup/sqlite-config.tcl @@ -365,7 +365,10 @@ proc sqlite-configure {buildMode configScript} { # sqlite-custom-flags is assumed to be imported via a # client-specific import: autosetup/local.tcl, autosetup/*.auto, # or autosetup/*/*.auto. - lappend allFlags sqlite-custom-flags [sqlite-custom-flags] + set scf [sqlite-custom-flags] + if {"" ne $scf} { + lappend allFlags sqlite-custom-flags $scf + } } # Filter allFlags to create the set of [options] legal for this build diff --git a/manifest b/manifest index 04fb6abb82..53b12829eb 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Teach\smkautoconfamal.sh\sto\savoid\scopying\sautosetup/local.tcl\sand\sautosetup/*.auto\sexcept\sfor\sautosetup/lib/CURRENT-BRANCH-NAME.auto\s(if\sany),\sthe\sintent\sbeing\sto\suse\slib/CURRENT-BRANCH-NAME.auto\sfor\sbranch-specific\sconfiguration\scustomizations. -D 2025-03-22T17:00:32.967 +C Document\sthe\snew\sconfiguration\scustomization\sapproach\sand\sextend\sit\sto\senable\ssqlite-custom-flags\sto\sreturn\san\sempty\sstring\sto\sdenote\sthat\sit\sdoes\snot\srequire\sany\snew\sflags\s(it\smay\sstill\scustomize\sflag\sdefault\svalues\sin\ssuch\scases). +D 2025-03-22T17:28:29.220 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -37,7 +37,7 @@ F autoconf/tea/win/rules.vc 94a18c3e453535459b4a643983acca52fb8756e79055bd2ad4b0 F autoconf/tea/win/targets.vc 96a25a1fa6e9e9cfb348fd3760a5395b4ce8acafc8ed10f0412937ec200d5dbd F autosetup/LICENSE 41a26aebdd2cd185d1e2b210f71b7ce234496979f6b35aef2cbf6b80cbed4ce4 F autosetup/README.autosetup a78ff8c4a3d2636a4268736672a74bf14a82f42687fcf0631a70c516075c031e -F autosetup/README.md f98cc827a162a1da4877e9656d749d414ba3f408d457d30e029afc66590c00c3 +F autosetup/README.md 564fd67ce77466e502af1af1967c4b4bc6401558051f7a2f1d9ab67e689f3e6e F autosetup/autosetup 74a9782b68d07934510190fbd03fc6ad92e63f0ea3b5cbffa5f0bd271ad60f01 x F autosetup/autosetup-config.guess dfa101c5e8220e864d5e9c72a85e87110df60260d36cb951ad0a85d6d9eaa463 x F autosetup/autosetup-config.sub a38fb074d0dece01cf919e9fb534a26011608aa8fa606490864295328526cd73 x @@ -50,7 +50,7 @@ F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba F autosetup/proj.tcl 49faf960df88a374686234105def663dbfc297ab79c87686df0a0b973dd77018 -F autosetup/sqlite-config.tcl c7c8dc9b864f0212bda4a1dfd30777f3757ff12d7b18adce1420c0f717c4c284 +F autosetup/sqlite-config.tcl 9d4ccbfd24f97be0e7e2be05a211700033521fc1d8d3bab40c1e923028e56e6c F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x F contrib/sqlitecon.tcl eb4c6578e08dd353263958da0dc620f8400b869a50d06e271ab0be85a51a08d3 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P bafab4ee5545c6cf6eafc5e352a7f25dfcbc7e58d4cc9064d05658c39de2af0d -R 6b1a45c990d67ff1ce7361064641b32c +P dfe24f13c446de5fdd736ed52fec0fca4637b4151ba008de7a598a2fc9398816 +R 8b1428f131d956d6b5e603417734bbed U stephan -Z 2e3346333053a23fc85b7950d2cfe6bb +Z 9e1837e75f17b5dbb42e5442891f4dea # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 84fd431ba3..5dea685a7c 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -dfe24f13c446de5fdd736ed52fec0fca4637b4151ba008de7a598a2fc9398816 +b0c7800b0106e90cb7bf7e5d9f48d21f9b058eff6e42339a1621d713ab2dd03c From 0fce9c935fac6c6ac6ccbd5be049e44438900c7b Mon Sep 17 00:00:00 2001 From: stephan Date: Sat, 22 Mar 2025 17:56:20 +0000 Subject: [PATCH 019/120] Slight corrections to the new docs in autosetup/README.md. FossilOrigin-Name: 55029e41e03d9b61b8a53f86d7f69afe71459846f3a1a1723f6934e0d37ca77f --- autosetup/README.md | 3 ++- manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/autosetup/README.md b/autosetup/README.md index c0aeff15d0..5e37fdfce8 100644 --- a/autosetup/README.md +++ b/autosetup/README.md @@ -412,6 +412,7 @@ proc sqlite-custom-flags {} { # then call: options-defaults { flag-name new-default-value + ... } # ^^^ That will replace the default value but will not update # the --help text, which may lead to some confusion: @@ -419,7 +420,7 @@ proc sqlite-custom-flags {} { return { {*} { - new-flag-name {Help text} + new-flag-name => {Help text} ... } }; #see below diff --git a/manifest b/manifest index 53b12829eb..e4841c914e 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Document\sthe\snew\sconfiguration\scustomization\sapproach\sand\sextend\sit\sto\senable\ssqlite-custom-flags\sto\sreturn\san\sempty\sstring\sto\sdenote\sthat\sit\sdoes\snot\srequire\sany\snew\sflags\s(it\smay\sstill\scustomize\sflag\sdefault\svalues\sin\ssuch\scases). -D 2025-03-22T17:28:29.220 +C Slight\scorrections\sto\sthe\snew\sdocs\sin\sautosetup/README.md. +D 2025-03-22T17:56:20.782 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -37,7 +37,7 @@ F autoconf/tea/win/rules.vc 94a18c3e453535459b4a643983acca52fb8756e79055bd2ad4b0 F autoconf/tea/win/targets.vc 96a25a1fa6e9e9cfb348fd3760a5395b4ce8acafc8ed10f0412937ec200d5dbd F autosetup/LICENSE 41a26aebdd2cd185d1e2b210f71b7ce234496979f6b35aef2cbf6b80cbed4ce4 F autosetup/README.autosetup a78ff8c4a3d2636a4268736672a74bf14a82f42687fcf0631a70c516075c031e -F autosetup/README.md 564fd67ce77466e502af1af1967c4b4bc6401558051f7a2f1d9ab67e689f3e6e +F autosetup/README.md 824d12ee3c094419084f31dc5408afc4d950b041497f9f21b357fd2e1070c8c9 F autosetup/autosetup 74a9782b68d07934510190fbd03fc6ad92e63f0ea3b5cbffa5f0bd271ad60f01 x F autosetup/autosetup-config.guess dfa101c5e8220e864d5e9c72a85e87110df60260d36cb951ad0a85d6d9eaa463 x F autosetup/autosetup-config.sub a38fb074d0dece01cf919e9fb534a26011608aa8fa606490864295328526cd73 x @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P dfe24f13c446de5fdd736ed52fec0fca4637b4151ba008de7a598a2fc9398816 -R 8b1428f131d956d6b5e603417734bbed +P b0c7800b0106e90cb7bf7e5d9f48d21f9b058eff6e42339a1621d713ab2dd03c +R 04399760b25701e54cab662a55267fa0 U stephan -Z 9e1837e75f17b5dbb42e5442891f4dea +Z b23822ed77b6b288de67fa220f936c97 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 5dea685a7c..8958a86852 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -b0c7800b0106e90cb7bf7e5d9f48d21f9b058eff6e42339a1621d713ab2dd03c +55029e41e03d9b61b8a53f86d7f69afe71459846f3a1a1723f6934e0d37ca77f From bf698fd69dcdf5f7a9a21b20549331101eef8fce Mon Sep 17 00:00:00 2001 From: stephan Date: Sat, 22 Mar 2025 18:41:48 +0000 Subject: [PATCH 020/120] In the post-configure validation, ensure than no more than one autosetup/lib/*.auto file is found, for reasons explained in the validation's error message. FossilOrigin-Name: 50bbd69a684988a1df4c9c7616b76ae62bc4eb755cde18616de58aa0880fd4a7 --- autosetup/sqlite-config.tcl | 35 +++++++++++++++++++++++++++++++++-- manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 40 insertions(+), 9 deletions(-) diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl index 0ead4cd77e..55c2c0f8d8 100644 --- a/autosetup/sqlite-config.tcl +++ b/autosetup/sqlite-config.tcl @@ -11,7 +11,7 @@ if {[string first " " $autosetup(builddir)] != -1} { user-error "The pathname of the build directory\ may not contain space characters" } - +#parray ::autosetup; exit 0 use proj # # We want the package version info to be emitted early on, but doing @@ -1634,7 +1634,12 @@ proc sqlite-process-dot-in-files {} { # 1) Ensure that no unresolved @VAR@ placeholders are in files which # use those. # -# 2) TBD +# 2) Ensure that no more than one autosetup/lib/*.auto file is found. +# Those are used for vendor-branch-specific customization of the +# configure process (see autosetup/README.md#branch-customization) +# and having more than one can lead to subtle errors. +# +# 3) TBD proc sqlite-post-config-validation {} { # Check #1: ensure that files which get filtered for @VAR@ do not # contain any unresolved @VAR@ refs. That may indicate an @@ -1652,6 +1657,32 @@ proc sqlite-post-config-validation {} { incr lnno } } + + # Check #2: ensure that no more than one autosetup/lib/*.auto file + # is found. + set libdir $::autosetup(libdir) + set li [glob -nocomplain $libdir/lib/*.auto] + if {[llength $li] > 1} { + puts stderr "Configuration validation error:" + proj-indented-notice -error [subst { + Multiple $libdir/lib/*.auto files found: + + $li + + This probably means one of the following: + + 1) Multiple vendor branches have been merged together, each with + their own configure-script customizations. They will be loaded + and applied in an unpredictable order, so the tree should have, + at most one lib/*.auto file, conventionally named after the + current vendor branch. + + 2) It can also mean that files have been left lying around from + another branch after doing "fossil update", in which case they + can all be deleted, then do "fossil update" again to replace + only the intended one (if any). + }] + } } ######################################################################## diff --git a/manifest b/manifest index e4841c914e..92ae29cb4c 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Slight\scorrections\sto\sthe\snew\sdocs\sin\sautosetup/README.md. -D 2025-03-22T17:56:20.782 +C In\sthe\spost-configure\svalidation,\sensure\sthan\sno\smore\sthan\sone\sautosetup/lib/*.auto\sfile\sis\sfound,\sfor\sreasons\sexplained\sin\sthe\svalidation's\serror\smessage. +D 2025-03-22T18:41:48.016 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -50,7 +50,7 @@ F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba F autosetup/proj.tcl 49faf960df88a374686234105def663dbfc297ab79c87686df0a0b973dd77018 -F autosetup/sqlite-config.tcl 9d4ccbfd24f97be0e7e2be05a211700033521fc1d8d3bab40c1e923028e56e6c +F autosetup/sqlite-config.tcl 7349901814106dee86ee2b9daf68afd26c13f7f92be69ffda9f6fdc7aedc442e F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x F contrib/sqlitecon.tcl eb4c6578e08dd353263958da0dc620f8400b869a50d06e271ab0be85a51a08d3 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P b0c7800b0106e90cb7bf7e5d9f48d21f9b058eff6e42339a1621d713ab2dd03c -R 04399760b25701e54cab662a55267fa0 +P 55029e41e03d9b61b8a53f86d7f69afe71459846f3a1a1723f6934e0d37ca77f +R f7433d2d6b9b7224d419751c11759d8c U stephan -Z b23822ed77b6b288de67fa220f936c97 +Z ce4dace35b5c51a050a3591235a1b475 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 8958a86852..1be3a9acb3 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -55029e41e03d9b61b8a53f86d7f69afe71459846f3a1a1723f6934e0d37ca77f +50bbd69a684988a1df4c9c7616b76ae62bc4eb755cde18616de58aa0880fd4a7 From 3f911b12e6df9f79468d07c739ceeafa4c837d83 Mon Sep 17 00:00:00 2001 From: stephan Date: Sat, 22 Mar 2025 19:07:54 +0000 Subject: [PATCH 021/120] Replace use of autosetup/lib/*.auto for sqlite-custom-... features to avoid the possibility of multiple files being loaded (in an unpredictable order) for that purpose. Instead look for autosetup/sqlite-custom.tcl and source it if it exists. The intent is that sqlite-custom.tcl only ever be added in vendor-specific branches and never in the trunk. FossilOrigin-Name: f3c0071284fbe1c0a8c3fe73792a79f9df6be983e5c9bd1a7e2fe71ba7b2d400 --- autosetup/README.md | 23 ++++----------- autosetup/sqlite-config.tcl | 56 +++++++++++-------------------------- manifest | 16 +++++------ manifest.uuid | 2 +- tool/mkautoconfamal.sh | 15 ---------- 5 files changed, 30 insertions(+), 82 deletions(-) diff --git a/autosetup/README.md b/autosetup/README.md index 5e37fdfce8..3301f57395 100644 --- a/autosetup/README.md +++ b/autosetup/README.md @@ -397,9 +397,7 @@ which frequently leads to merge conflicts, the following approach is recommended: In the vendor-specific branch, create a file named -`autosetup/lib/THE-BRANCH-NAME.auto`. Autosetup will automatically -load any files named `autosetup/*.auto` or `autosetup/*/*.auto` when -it starts up. +`autosetup/sqlite-custom.tcl`. That file should contain the following content... @@ -434,25 +432,14 @@ Next, define: > ``` -proc sqlite-handle-custom-flags {} { +proc sqlite-custom-handle-flags {} { ... do any custom flag handling here ... } ``` -That function will be called relatively late in the configure process, -before any filtered files are generated but after all other -significant processing. - -It is important that no more than one `*.auto` or `local.tcl` file -defines these functions. Autosetup will load these in an unspecified -order, and the _last_ one which is loaded will overwrite any procs -defined in files loaded before it. - -When running [mkautoconfamal.sh](/file/tool/mkautoconfamal.sh) -(typically via `make amalgamation-tarball` or `make snapshot-tarball`), -all `autosetup/local.tcl` and `autosetup/[*/]*.auto` files will be -elided from the tarball except for `autosetup/lib/X.auto`, where `X` -is the name of the current checkout's branch. +That function, if defined, will be called relatively late in the +configure process, before any filtered files are generated but after +all other significant processing. [Autosetup]: https://msteveb.github.io/autosetup/ diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl index 55c2c0f8d8..d1347c0fda 100644 --- a/autosetup/sqlite-config.tcl +++ b/autosetup/sqlite-config.tcl @@ -361,10 +361,18 @@ proc sqlite-configure {buildMode configScript} { # ^^^ lappend of [sqlite-custom-flags] introduces weirdness if # we delay [proj-strip-hash-comments] until after that. + + ######################################################################## + # sqlite-custom.tcl is intended only for vendor-branch-specific + # customization. See autosetup/README.md#branch-customization for + # details. + if {[file exists $::autosetup(libdir)/sqlite-custom.tcl]} { + uplevel 1 {source $::autosetup(libdir)/sqlite-custom.tcl} + } + if {[llength [info proc sqlite-custom-flags]] > 0} { - # sqlite-custom-flags is assumed to be imported via a - # client-specific import: autosetup/local.tcl, autosetup/*.auto, - # or autosetup/*/*.auto. + # sqlite-custom-flags is assumed to be imported via + # autosetup/sqlite-custom.tcl. set scf [sqlite-custom-flags] if {"" ne $scf} { lappend allFlags sqlite-custom-flags $scf @@ -1595,11 +1603,10 @@ proc sqlite-handle-env-quirks {} { sqlite-handle-dll-basename sqlite-handle-out-implib sqlite-handle-mac-cversion - if {[llength [info proc sqlite-handle-custom-flags]] > 0} { - # sqlite-handle-custom-flags is assumed to be imported via a - # client-specific import: autosetup/local.tcl, autosetup/*.auto, - # or autosetup/*/*.auto. - sqlite-handle-custom-flags + if {[llength [info proc sqlite-custom-handle-flags]] > 0} { + # sqlite-custom-handle-flags is assumed to be imported via a + # client-specific import: autosetup/sqlite-custom.tcl. + sqlite-custom-handle-flags } } @@ -1634,12 +1641,7 @@ proc sqlite-process-dot-in-files {} { # 1) Ensure that no unresolved @VAR@ placeholders are in files which # use those. # -# 2) Ensure that no more than one autosetup/lib/*.auto file is found. -# Those are used for vendor-branch-specific customization of the -# configure process (see autosetup/README.md#branch-customization) -# and having more than one can lead to subtle errors. -# -# 3) TBD +# 2) TBD proc sqlite-post-config-validation {} { # Check #1: ensure that files which get filtered for @VAR@ do not # contain any unresolved @VAR@ refs. That may indicate an @@ -1657,32 +1659,6 @@ proc sqlite-post-config-validation {} { incr lnno } } - - # Check #2: ensure that no more than one autosetup/lib/*.auto file - # is found. - set libdir $::autosetup(libdir) - set li [glob -nocomplain $libdir/lib/*.auto] - if {[llength $li] > 1} { - puts stderr "Configuration validation error:" - proj-indented-notice -error [subst { - Multiple $libdir/lib/*.auto files found: - - $li - - This probably means one of the following: - - 1) Multiple vendor branches have been merged together, each with - their own configure-script customizations. They will be loaded - and applied in an unpredictable order, so the tree should have, - at most one lib/*.auto file, conventionally named after the - current vendor branch. - - 2) It can also mean that files have been left lying around from - another branch after doing "fossil update", in which case they - can all be deleted, then do "fossil update" again to replace - only the intended one (if any). - }] - } } ######################################################################## diff --git a/manifest b/manifest index 92ae29cb4c..b134218cf5 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C In\sthe\spost-configure\svalidation,\sensure\sthan\sno\smore\sthan\sone\sautosetup/lib/*.auto\sfile\sis\sfound,\sfor\sreasons\sexplained\sin\sthe\svalidation's\serror\smessage. -D 2025-03-22T18:41:48.016 +C Replace\suse\sof\sautosetup/lib/*.auto\sfor\ssqlite-custom-...\sfeatures\sto\savoid\sthe\spossibility\sof\smultiple\sfiles\sbeing\sloaded\s(in\san\sunpredictable\sorder)\sfor\sthat\spurpose.\sInstead\slook\sfor\sautosetup/sqlite-custom.tcl\sand\ssource\sit\sif\sit\sexists.\sThe\sintent\sis\sthat\ssqlite-custom.tcl\sonly\sever\sbe\sadded\sin\svendor-specific\sbranches\sand\snever\sin\sthe\strunk. +D 2025-03-22T19:07:54.825 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -37,7 +37,7 @@ F autoconf/tea/win/rules.vc 94a18c3e453535459b4a643983acca52fb8756e79055bd2ad4b0 F autoconf/tea/win/targets.vc 96a25a1fa6e9e9cfb348fd3760a5395b4ce8acafc8ed10f0412937ec200d5dbd F autosetup/LICENSE 41a26aebdd2cd185d1e2b210f71b7ce234496979f6b35aef2cbf6b80cbed4ce4 F autosetup/README.autosetup a78ff8c4a3d2636a4268736672a74bf14a82f42687fcf0631a70c516075c031e -F autosetup/README.md 824d12ee3c094419084f31dc5408afc4d950b041497f9f21b357fd2e1070c8c9 +F autosetup/README.md f324bb9f9bf1cc787122034df53fbfdfed28ee2657e6652b763d992ab0d04829 F autosetup/autosetup 74a9782b68d07934510190fbd03fc6ad92e63f0ea3b5cbffa5f0bd271ad60f01 x F autosetup/autosetup-config.guess dfa101c5e8220e864d5e9c72a85e87110df60260d36cb951ad0a85d6d9eaa463 x F autosetup/autosetup-config.sub a38fb074d0dece01cf919e9fb534a26011608aa8fa606490864295328526cd73 x @@ -50,7 +50,7 @@ F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba F autosetup/proj.tcl 49faf960df88a374686234105def663dbfc297ab79c87686df0a0b973dd77018 -F autosetup/sqlite-config.tcl 7349901814106dee86ee2b9daf68afd26c13f7f92be69ffda9f6fdc7aedc442e +F autosetup/sqlite-config.tcl a2a786ccdccead789c8e4cc82408257bf7857dcbdf45accab4a1538d641d3070 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x F contrib/sqlitecon.tcl eb4c6578e08dd353263958da0dc620f8400b869a50d06e271ab0be85a51a08d3 @@ -2151,7 +2151,7 @@ F tool/logest.c c34e5944318415de513d29a6098df247a9618c96d83c38d4abd88641fe46e669 F tool/max-limits.c cbb635fbb37ae4d05f240bfb5b5270bb63c54439 F tool/merge-test.tcl de76b62f2de2a92d4c1ca4f976bce0aea6899e0229e250479b229b2a1914b176 F tool/mkamalzip.tcl 8aa5ebe7973c8b8774062d34e15fea9815c4cc2ceea3a9b184695f005910876a -F tool/mkautoconfamal.sh 6b040e008a318c2b92b0b8cf9b7879f2843433aea6834e89897a0f21ebc46e5b +F tool/mkautoconfamal.sh 401f6378a99bb045b63abe8c2dad6bd6fd5a1c2b9c8cded9d7ac5848ea578994 F tool/mkccode.tcl c42a8f8cf78f92e83795d5447460dbce7aaf78a3bbf9082f1507dc71a3665f3c x F tool/mkctimec.tcl f76dbfc74cefad8d126384ba3263677939f077bd184fcdf8c592a1daf64f50c3 x F tool/mkkeywordhash.c 6b0be901c47f9ad42215fc995eb2f4384ac49213b1fba395102ec3e999acf559 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 55029e41e03d9b61b8a53f86d7f69afe71459846f3a1a1723f6934e0d37ca77f -R f7433d2d6b9b7224d419751c11759d8c +P 50bbd69a684988a1df4c9c7616b76ae62bc4eb755cde18616de58aa0880fd4a7 +R c8205cd2fdc2d6cb1bffef77ec445211 U stephan -Z ce4dace35b5c51a050a3591235a1b475 +Z 9feaa8e098307dad1729b5f1c60b7427 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 1be3a9acb3..5617a3cb74 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -50bbd69a684988a1df4c9c7616b76ae62bc4eb755cde18616de58aa0880fd4a7 +f3c0071284fbe1c0a8c3fe73792a79f9df6be983e5c9bd1a7e2fe71ba7b2d400 diff --git a/tool/mkautoconfamal.sh b/tool/mkautoconfamal.sh index afe60fd66f..9ccf8b6558 100644 --- a/tool/mkautoconfamal.sh +++ b/tool/mkautoconfamal.sh @@ -24,12 +24,6 @@ TMPSPACE=./mkpkg_tmp_dir VERSION=`cat $TOP/VERSION` HASH=`cut -c1-10 $TOP/manifest.uuid` DATETIME=`grep '^D' $TOP/manifest | tr -c -d '[0-9]' | cut -c1-12` -BRANCH=`fossil whatis $HASH | awk '/tags:/{print $2}'` - -if [ x = "x${BRANCH}" ]; then - echo "Cannot determine the current branch" 1>&2 - exit 1 -fi # Inject the current version into the TEA autoconf file. # @@ -67,15 +61,6 @@ fi rm -rf $TMPSPACE cp -R $TOP/autoconf $TMPSPACE cp -R $TOP/autosetup $TMPSPACE -# Do not include build-specific customizations in the autoconf build: -rm -f $TMPSPACE/autosetup/local.tcl $TMPSPACE/autosetup/*.auto $TMPSPACE/autosetup/*/*.auto -# ... unless we find one which matches the current branch name: -bac=$TOP/autosetup/lib/${BRANCH}.auto -if [ -f $bac ]; then - echo "Copying branch-specific autosetup configuration: $bac" - mkdir -p $TMPSPACE/autosetup/lib - cp $bac $TMPSPACE/autosetup/lib -fi cp -p $TOP/configure $TMPSPACE cp sqlite3.c $TMPSPACE cp sqlite3.h $TMPSPACE From 75484481c7764e90b9b7133579fcfb832e641f39 Mon Sep 17 00:00:00 2001 From: drh <> Date: Sat, 22 Mar 2025 22:55:33 +0000 Subject: [PATCH 022/120] Fix the generate_series() enhancement from check-in [d50b784807333c54] so that it works even if the number that "value" is being compared against is a non-integer floating point number. Bug reported by [forum:/forumpost/0d5d63257e3ff4f6|forum post 0d5d63257]. FossilOrigin-Name: c113e31b818d16770bec1edc980f6833dfb27c4d74178e66a778fbb5671c3a13 --- ext/misc/series.c | 50 ++++++++++++++++++++++++++++++--------- manifest | 16 ++++++------- manifest.uuid | 2 +- test/tabfunc01.test | 57 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 105 insertions(+), 20 deletions(-) diff --git a/ext/misc/series.c b/ext/misc/series.c index e8188f1c97..4e328d298c 100644 --- a/ext/misc/series.c +++ b/ext/misc/series.c @@ -115,6 +115,7 @@ SQLITE_EXTENSION_INIT1 #include #include #include +#include #ifndef SQLITE_OMIT_VIRTUALTABLE /* @@ -480,25 +481,52 @@ static int seriesFilter( ** constraints on the "value" column. */ if( idxNum & 0x0080 ){ - iMin = iMax = sqlite3_value_int64(argv[i++]); + if( sqlite3_value_numeric_type(argv[i])==SQLITE_FLOAT ){ + double r = sqlite3_value_double(argv[i++]); + if( r==ceil(r) ){ + iMin = iMax = (sqlite3_int64)r; + }else{ + returnNoRows = 1; + } + }else{ + iMin = iMax = sqlite3_value_int64(argv[i++]); + } }else{ if( idxNum & 0x0300 ){ - iMin = sqlite3_value_int64(argv[i++]); - if( idxNum & 0x0200 ){ - if( iMin==LARGEST_INT64 ){ - returnNoRows = 1; + if( sqlite3_value_numeric_type(argv[i])==SQLITE_FLOAT ){ + double r = sqlite3_value_double(argv[i++]); + if( idxNum & 0x0200 && r==ceil(r) ){ + iMin = (sqlite3_int64)ceil(r+1.0); }else{ - iMin++; + iMin = (sqlite3_int64)ceil(r); + } + }else{ + iMin = sqlite3_value_int64(argv[i++]); + if( idxNum & 0x0200 ){ + if( iMin==LARGEST_INT64 ){ + returnNoRows = 1; + }else{ + iMin++; + } } } } if( idxNum & 0x3000 ){ - iMax = sqlite3_value_int64(argv[i++]); - if( idxNum & 0x2000 ){ - if( iMax==SMALLEST_INT64 ){ - returnNoRows = 1; + if( sqlite3_value_numeric_type(argv[i])==SQLITE_FLOAT ){ + double r = sqlite3_value_double(argv[i++]); + if( (idxNum & 0x2000)!=0 && r==floor(r) ){ + iMax = (sqlite3_int64)(r-1.0); }else{ - iMax--; + iMax = (sqlite3_int64)floor(r); + } + }else{ + iMax = sqlite3_value_int64(argv[i++]); + if( idxNum & 0x2000 ){ + if( iMax==SMALLEST_INT64 ){ + returnNoRows = 1; + }else{ + iMax--; + } } } } diff --git a/manifest b/manifest index b134218cf5..088f57eec8 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Replace\suse\sof\sautosetup/lib/*.auto\sfor\ssqlite-custom-...\sfeatures\sto\savoid\sthe\spossibility\sof\smultiple\sfiles\sbeing\sloaded\s(in\san\sunpredictable\sorder)\sfor\sthat\spurpose.\sInstead\slook\sfor\sautosetup/sqlite-custom.tcl\sand\ssource\sit\sif\sit\sexists.\sThe\sintent\sis\sthat\ssqlite-custom.tcl\sonly\sever\sbe\sadded\sin\svendor-specific\sbranches\sand\snever\sin\sthe\strunk. -D 2025-03-22T19:07:54.825 +C Fix\sthe\sgenerate_series()\senhancement\sfrom\scheck-in\s[d50b784807333c54]\nso\sthat\sit\sworks\seven\sif\sthe\snumber\sthat\s"value"\sis\sbeing\scompared\sagainst\nis\sa\snon-integer\sfloating\spoint\snumber.\s\sBug\sreported\sby\n[forum:/forumpost/0d5d63257e3ff4f6|forum\spost\s0d5d63257]. +D 2025-03-22T22:55:33.194 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -436,7 +436,7 @@ F ext/misc/regexp.c 388e7f237307c7dfbfb8dde44e097946f6c437801d63f0d7ad63f3320d4e F ext/misc/remember.c add730f0f7e7436cd15ea3fd6a90fd83c3f706ab44169f7f048438b7d6baa69c F ext/misc/rot13.c 51ac5f51e9d5fd811db58a9c23c628ad5f333c173f1fc53c8491a3603d38556c F ext/misc/scrub.c 2a44b0d44c69584c0580ad2553f6290a307a49df4668941d2812135bfb96a946 -F ext/misc/series.c 076a4c85dde2ae543d040f1080cdab74ebf3da7f3febfe38e0cd45a2217498bf +F ext/misc/series.c 0c285a21821e71b473e701cb52f6cbd708f76aa1adeb30644909a718ba4f0ba5 F ext/misc/sha1.c cb5002148c2661b5946f34561701e9105e9d339b713ec8ac057fd888b196dcb9 F ext/misc/shathree.c fd22d70620f86a0467acfdd3acd8435d5cb54eb1e2d9ff36ae44e389826993df F ext/misc/showauth.c 732578f0fe4ce42d577e1c86dc89dd14a006ab52 @@ -1719,7 +1719,7 @@ F test/sync.test 89539f4973c010eda5638407e71ca7fddbcd8e0594f4c9980229f804d433309 F test/sync2.test 8f9f7d4f6d5be8ca8941a8dadcc4299e558cb6a1ff653a9469146c7a76ef2039 F test/syscall.test a067468b43b8cb2305e9f9fe414e5f40c875bb5d2cba5f00b8154396e95fcf37 F test/sysfault.test c9f2b0d8d677558f74de750c75e12a5454719d04 -F test/tabfunc01.test 76da0509b01b9d12f4e71f8af28ee702d38166a5306bd77a955fb1a370dcd8b5 +F test/tabfunc01.test e85679a3800aa632dee787966b8482fce0bd47629dad82f102fd52f319d2c281 F test/table.test 7862a00b58b5541511a26757ea9c5c7c3f8298766e98aa099deec703d9c0a8e0 F test/tableapi.test e37c33e6be2276e3a96bb54b00eea7f321277115d10e5b30fdb52a112b432750 F test/tableopts.test dba698ba97251017b7c80d738c198d39ab747930 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 50bbd69a684988a1df4c9c7616b76ae62bc4eb755cde18616de58aa0880fd4a7 -R c8205cd2fdc2d6cb1bffef77ec445211 -U stephan -Z 9feaa8e098307dad1729b5f1c60b7427 +P f3c0071284fbe1c0a8c3fe73792a79f9df6be983e5c9bd1a7e2fe71ba7b2d400 +R bb2b8fb97c5254c022b045f9e204d5a8 +U drh +Z 3b840e739e362fa32d6af0f736408d3e # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 5617a3cb74..c29e8e308c 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -f3c0071284fbe1c0a8c3fe73792a79f9df6be983e5c9bd1a7e2fe71ba7b2d400 +c113e31b818d16770bec1edc980f6833dfb27c4d74178e66a778fbb5671c3a13 diff --git a/test/tabfunc01.test b/test/tabfunc01.test index c16fb9bec2..5938ec6cb6 100644 --- a/test/tabfunc01.test +++ b/test/tabfunc01.test @@ -194,6 +194,63 @@ do_execsql_test tabfunc01-5.2 { WHERE value=67; } 67 +# 2025-03-22 forum post 0d5d63257e3ff4f6 +# +do_execsql_test tabfunc01-6.1 { + SELECT value FROM generate_series(1,10) WHERE value<5.5; +} {1 2 3 4 5} +do_execsql_test tabfunc01-6.2 { + SELECT value FROM generate_series(1,10) WHERE value<5.0; +} {1 2 3 4} +do_execsql_test tabfunc01-6.3 { + SELECT value FROM generate_series(1,10) WHERE value<=5.5; +} {1 2 3 4 5} +do_execsql_test tabfunc01-6.4 { + SELECT value FROM generate_series(1,10) WHERE value<=5.0; +} {1 2 3 4 5} +do_execsql_test tabfunc01-6.5 { + SELECT value FROM generate_series(1,10) WHERE value>5.5; +} {6 7 8 9 10} +do_execsql_test tabfunc01-6.6 { + SELECT value FROM generate_series(1,10) WHERE value>5.0; +} {6 7 8 9 10} +do_execsql_test tabfunc01-6.7 { + SELECT value FROM generate_series(1,10) WHERE value>=5.5; +} {6 7 8 9 10} +do_execsql_test tabfunc01-6.8 { + SELECT value FROM generate_series(1,10) WHERE value>=5.0; +} {5 6 7 8 9 10} +do_execsql_test tabfunc01-6.9 { + SELECT value FROM generate_series(10,1,-1) WHERE value<5.5; +} {5 4 3 2 1} +do_execsql_test tabfunc01-6.10 { + SELECT value FROM generate_series(10,1,-1) WHERE value<5.0; +} {4 3 2 1} +do_execsql_test tabfunc01-6.11 { + SELECT value FROM generate_series(10,1,-1) WHERE value<=5.5; +} {5 4 3 2 1} +do_execsql_test tabfunc01-6.12 { + SELECT value FROM generate_series(10,1,-1) WHERE value<=5.0; +} {5 4 3 2 1} +do_execsql_test tabfunc01-6.13 { + SELECT value FROM generate_series(10,1,-1) WHERE value>5.5; +} {10 9 8 7 6} +do_execsql_test tabfunc01-6.14 { + SELECT value FROM generate_series(10,1,-1) WHERE value>5.0; +} {10 9 8 7 6} +do_execsql_test tabfunc01-6.15 { + SELECT value FROM generate_series(10,1,-1) WHERE value>=5.5; +} {10 9 8 7 6} +do_execsql_test tabfunc01-6.16 { + SELECT value FROM generate_series(10,1,-1) WHERE value>=5.0; +} {10 9 8 7 6 5} +do_execsql_test tabfunc01-6.17 { + SELECT value FROM generate_series(1,10) WHERE value==5.5; +} {} +do_execsql_test tabfunc01-6.18 { + SELECT value FROM generate_series(1,10) WHERE value==5.0; +} {5} + # The next series of tests is verifying that virtual table are able # to optimize the IN operator, even on terms that are not marked "omit". # When the generate_series virtual table is compiled for the testfixture, From 8d80ca2d1cab1f42a2430e249adcee28c19fd587 Mon Sep 17 00:00:00 2001 From: stephan Date: Sun, 23 Mar 2025 21:38:28 +0000 Subject: [PATCH 023/120] Internal configure refactoring to support an ongoing conversion of ./autoconf/tea to autosetup. FossilOrigin-Name: e1d483e342670092c3579f2f0975e49a0c74516ae34103a63b4cde156bf5e92b --- {tool => autosetup}/find_tclconfig.tcl | 0 autosetup/proj.tcl | 62 +++++++++++++++++- autosetup/sqlite-config.tcl | 91 +++++++++++++++----------- manifest | 18 ++--- manifest.uuid | 2 +- 5 files changed, 123 insertions(+), 50 deletions(-) rename {tool => autosetup}/find_tclconfig.tcl (100%) diff --git a/tool/find_tclconfig.tcl b/autosetup/find_tclconfig.tcl similarity index 100% rename from tool/find_tclconfig.tcl rename to autosetup/find_tclconfig.tcl diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl index 3e703d007a..5ba71bd5cc 100644 --- a/autosetup/proj.tcl +++ b/autosetup/proj.tcl @@ -594,7 +594,7 @@ proc proj-file-content {args} { set trim 1 lassign $args - fname } - set fp [open $fname r] + set fp [open $fname rb] set rc [read $fp] close $fp if {$trim} { return [string trim $rc] } @@ -607,7 +607,7 @@ proc proj-file-content {args} { # Returns the contents of the given file as an array of lines, with # the EOL stripped from each input line. proc proj-file-content-list {fname} { - set fp [open $fname r] + set fp [open $fname rb] set rc {} while { [gets $fp line] >= 0 } { lappend rc $line @@ -616,6 +616,17 @@ proc proj-file-content-list {fname} { return $rc } +######################################################################## +# @proj-file-write fname content +# +# Works like autosetup's [writefile] but explicitly uses binary mode +# to avoid EOL translation on Windows. +proc proj-file-write {fname content} { + set f [open $fname wb] + puts -nonewline $f $content + close $f +} + ######################################################################## # @proj-check-compile-commands ?configFlag? # @@ -1377,3 +1388,50 @@ proc proj-current-proc-name {{lvl 0}} { #uplevel [expr {$lvl + 1}] {lindex [info level 0] 0} lindex [info level [expr {-$lvl - 1}]] 0 } + + +######################################################################## +# Converts parts of tclConfig.sh to autosetup [define]s. +# +# Expects to be passed the name of a value tclConfig.sh or an empty +# string. It converts certain parts of that file's contents to +# [define]s (see the code for the whole list). If $tclConfigSh is an +# empty string then it [define]s the various vars as empty strings. +proc proj-tclConfig-to-autosetup {tclConfigSh} { + set shBody {} + set tclVars { + TCL_INCLUDE_SPEC + TCL_LIB_SPEC + TCL_STUB_LIB_SPEC + TCL_EXEC_PREFIX + TCL_PREFIX + TCL_VERSION + } + lappend shBody "if test x = \"x${tclConfigSh}\"; then" + foreach v $tclVars { + lappend shBody "$v= ;" + } + lappend shBody "else . \"${tclConfigSh}\"; fi" + foreach v $tclVars { + lappend shBody "echo define $v {\$$v} ;" + } + lappend shBody "exit" + set shBody [join $shBody "\n"] + #puts "shBody=$shBody\n"; exit + if {0} { + # This doesn't work but would be preferable to using a temp file... + set fd [open "| sh" "rw"] + #puts "fd = $fd"; exit + puts $fd $shBody + flush $fd + set rd [read $fd] + close $fd + puts "rd=$rd"; exit 1 + eval $rd + } else { + set shName ".tclConfigSh.tcl" + proj-file-write $shName $shBody + eval [exec sh $shName $tclConfigSh] + file delete --force $shName + } +} diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl index d1347c0fda..53a21ded9a 100644 --- a/autosetup/sqlite-config.tcl +++ b/autosetup/sqlite-config.tcl @@ -64,7 +64,7 @@ array set sqliteConfig [subst [proj-strip-hash-comments { ######################################################################## # Processes all configure --flags for this build, run build-specific # config checks, then finalize the configure process. $buildMode must -# be either "canonical" or "autoconf", and others may be added in the +# be one of (canonical, autoconf), and others may be added in the # future. After bootstrapping, $configScript is eval'd in the caller's # scope, then post-configuration finalization is run. $configScript is # intended to hold configure code which is specific to the given @@ -83,7 +83,7 @@ array set sqliteConfig [subst [proj-strip-hash-comments { proc sqlite-configure {buildMode configScript} { proj-assert {$::sqliteConfig(build-mode) eq "unknown"} \ "sqlite-configure must not be called more than once" - set allBuildModes {canonical autoconf} + set allBuildModes {canonical autoconf tcl-extension} if {$buildMode ni $allBuildModes} { user-error "Invalid build mode: $buildMode. Expecting one of: $allBuildModes" } @@ -165,7 +165,7 @@ proc sqlite-configure {buildMode configScript} { # Options for how to build the library build-modes { - {*} { + {canonical autoconf} { shared=1 => {Disable build of shared library} static=1 => {Disable build of static library} } @@ -203,6 +203,13 @@ proc sqlite-configure {buildMode configScript} { # Options for TCL support tcl { {canonical} { + tcl=1 + => {Disable components which require TCL, including all tests. + This tree requires TCL for code generation but can use the in-tree + copy of autosetup/jimsh0.c for that. The SQLite TCL extension and the + test code require a canonical tclsh.} + } + {canonical tcl-extension} { with-tcl:DIR => {Directory containing tclConfig.sh or a directory one level up from that, from which we can derive a directory containing tclConfig.sh. @@ -213,17 +220,12 @@ proc sqlite-configure {buildMode configScript} { tclConfig.sh and (B) all TCL-based code generation. Warning: if its containing dir has multiple tclsh versions, it may select the wrong tclConfig.sh!} - tcl=1 - => {Disable components which require TCL, including all tests. - This tree requires TCL for code generation but can use the in-tree - copy of autosetup/jimsh0.c for that. The SQLite TCL extension and the - test code require a canonical tclsh.} } } # Options for line-editing modes for the CLI shell line-editing { - {*} { + {canonical autoconf} { readline=1 => {Disable readline support} # --with-readline-lib is a backwards-compatible alias for @@ -265,12 +267,12 @@ proc sqlite-configure {buildMode configScript} { # Options for exotic/alternative build modes alternative-builds { - {*} { + {canonical autoconf} { with-wasi-sdk:=/opt/wasi-sdk => {Top-most dir of the wasi-sdk for a WASI build} } - {canonical} { + {canonical} { with-emsdk:=auto => {Top-most dir of the Emscripten SDK installation. Needed only by ext/wasm. Default=EMSDK env var.} @@ -288,7 +290,7 @@ proc sqlite-configure {buildMode configScript} { static-shell=1 => {Link the sqlite3 shell app against the DLL instead of embedding sqlite3.c} } - {*} { + {canonical autoconf} { # A potential TODO without a current use case: #rpath=1 => {Disable use of the rpath linker flag} # soname: https://sqlite.org/src/forumpost/5a3b44f510df8ded @@ -458,17 +460,21 @@ proc sqlite-configure-finalize {} { sqlite-handle-load-extension sqlite-handle-math sqlite-handle-icu - sqlite-handle-line-editing - - proj-define-for-opt shared ENABLE_LIB_SHARED "Build shared library?" - if {![proj-define-for-opt static ENABLE_LIB_STATIC "Build static library?"]} { - # This notice really only applies to the canonical build... - proj-indented-notice { - NOTICE: static lib build may be implicitly re-activated by - other components, e.g. some test apps. + if {[proj-opt-exists readline]} { + sqlite-handle-line-editing + } + if {[proj-opt-exists shared]} { + proj-define-for-opt shared ENABLE_LIB_SHARED "Build shared library?" + } + if {[proj-opt-exists static]} { + if {![proj-define-for-opt static ENABLE_LIB_STATIC "Build static library?"]} { + # This notice really only applies to the canonical build... + proj-indented-notice { + NOTICE: static lib build may be implicitly re-activated by + other components, e.g. some test apps. + } } } - sqlite-handle-env-quirks sqlite-handle-common-feature-flags sqlite-finalize-feature-flags @@ -1225,9 +1231,10 @@ proc sqlite-check-line-editing {} { }; # sqlite-check-line-editing ######################################################################## -# Runs sqlite-check-line-editing and adds a message around it In the +# Runs sqlite-check-line-editing and adds a message around it. In the # canonical build this must not be called before -# sqlite-determine-codegen-tcl. +# sqlite-determine-codegen-tcl for reasons now lost to history (and +# might not still be applicable). proc sqlite-handle-line-editing {} { msg-result "Line-editing support for the sqlite3 shell: [sqlite-check-line-editing]" } @@ -1625,7 +1632,15 @@ proc sqlite-process-dot-in-files {} { # (e.g. [proj-check-rpath]) may do so before we "mangle" them here. proj-remap-autoconf-dir-vars - proj-make-from-dot-in -touch Makefile sqlite3.pc + set srcdir $::autosetup(srcdir)/ + foreach f {Makefile sqlite3.pc} { + if {[file exists $srcdir/$f.in]} { + # ^^^ we do this only so that this block can be made to work for + # multiple builds. e.g. the tea build (under construction) does + # not hae sqlite3.pc.in. + proj-make-from-dot-in -touch $f + } + } make-config-header sqlite_cfg.h \ -bare {SIZEOF_* HAVE_DECL_*} \ -none {HAVE_CFLAG_* LDFLAGS_* SH_* SQLITE_AUTORECONFIG @@ -1695,7 +1710,7 @@ proc sqlite-handle-wasi-sdk {} { threadsafe } { if {[proj-opt-exists $opt] && [opt-bool $opt]} { - # -^^^^ distinguish between canonical and autoconf builds + # -^^^^ not all builds define all of these flags msg-result " --disable-$opt" proj-opt-set $opt 0 } @@ -1772,12 +1787,10 @@ proc sqlite-check-tcl {} { define TCLLIBDIR "" ; # Installation dir for TCL extension lib define TCL_CONFIG_SH ""; # full path to tclConfig.sh - # Clear out all vars which would be set by tclConfigToAutoDef.sh, so + # Clear out all vars which would be set by tclConfigShToAutoDef.sh, so # that the late-config validation of @VARS@ works even if # --disable-tcl is used. - foreach k {TCL_INCLUDE_SPEC TCL_LIB_SPEC TCL_STUB_LIB_SPEC TCL_EXEC_PREFIX TCL_VERSION} { - define $k "" - } + proj-tclConfig-to-autosetup "" file delete -force ".tclenv.sh"; # ensure no stale state from previous configures. if {![opt-bool tcl]} { @@ -1804,7 +1817,7 @@ proc sqlite-check-tcl {} { if {"" eq $with_tclsh && "" eq $with_tcl} { # If neither --with-tclsh nor --with-tcl are provided, try to find # a workable tclsh. - set with_tclsh [proj-first-bin-of tclsh9.0 tclsh8.6 tclsh] + set with_tclsh [proj-first-bin-of tclsh9.1 tclsh9.0 tclsh8.6 tclsh] proc-debug "with_tclsh=${with_tclsh}" } @@ -1819,7 +1832,7 @@ proc sqlite-check-tcl {} { #msg-result "Using tclsh: $with_tclsh" } if {$doConfigLookup && - [catch {exec $with_tclsh $srcdir/tool/find_tclconfig.tcl} result] == 0} { + [catch {exec $with_tclsh $::autosetup(libdir)/find_tclconfig.tcl} result] == 0} { set with_tcl $result } if {"" ne $with_tcl && [file isdir $with_tcl]} { @@ -1830,7 +1843,7 @@ proc sqlite-check-tcl {} { } } set cfg "" - set tclSubdirs {tcl9.0 tcl8.6 lib} + set tclSubdirs {tcl9.1 tcl9.0 tcl8.6 lib} while {$use_tcl} { if {"" ne $with_tcl} { # Ensure that we can find tclConfig.sh under ${with_tcl}/... @@ -1876,9 +1889,7 @@ proc sqlite-check-tcl {} { # Export a subset of tclConfig.sh to the current TCL-space. If $cfg # is an empty string, this emits empty-string entries for the # various options we're interested in. - eval [exec sh "$srcdir/tool/tclConfigShToAutoDef.sh" "$cfg"] - # ---------^^ a Windows/msys workaround, without which it cannot - # exec a .sh file: https://sqlite.org/forum/forumpost/befb352a42a7cd6d + proj-tclConfig-to-autosetup $cfg if {"" eq $with_tclsh && $cfg ne ""} { # We have tclConfig.sh but no tclsh. Attempt to locate a tclsh @@ -2047,10 +2058,14 @@ proc sqlite-determine-codegen-tcl {} { }; # sqlite-determine-codegen-tcl ######################################################################## -# Runs sqlite-check-tcl and sqlite-determine-codegen-tcl. -proc sqlite-handle-tcl {} { +# Runs sqlite-check-tcl and, if $alsoCheckCodeGen is true, +# sqlite-determine-codegen-tcl (intended only for the canonical +# build). +proc sqlite-handle-tcl {{alsoCheckCodeGen 1}} { sqlite-check-tcl - msg-result "TCL for code generation: [sqlite-determine-codegen-tcl]" + if {$alsoCheckCodeGen} { + msg-result "TCL for code generation: [sqlite-determine-codegen-tcl]" + } } ######################################################################## diff --git a/manifest b/manifest index 088f57eec8..7a2d34a15e 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sthe\sgenerate_series()\senhancement\sfrom\scheck-in\s[d50b784807333c54]\nso\sthat\sit\sworks\seven\sif\sthe\snumber\sthat\s"value"\sis\sbeing\scompared\sagainst\nis\sa\snon-integer\sfloating\spoint\snumber.\s\sBug\sreported\sby\n[forum:/forumpost/0d5d63257e3ff4f6|forum\spost\s0d5d63257]. -D 2025-03-22T22:55:33.194 +C Internal\sconfigure\srefactoring\sto\ssupport\san\songoing\sconversion\sof\s./autoconf/tea\sto\sautosetup. +D 2025-03-23T21:38:28.791 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -47,10 +47,11 @@ F autosetup/cc-db.tcl 6e0ed90146197a5a05b245e649975c07c548e30926b218ca3e1d4dc034 F autosetup/cc-lib.tcl 493c5935b5dd3bf9bd4eca89b07c8b1b1a9356d61783035144e21795facf7360 F autosetup/cc-shared.tcl 4f024e94a47f427ba61de1739f6381ef0080210f9fae89112d5c1de1e5460d78 F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e45f +F autosetup/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1821baf61bc86a7e w tool/find_tclconfig.tcl F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba -F autosetup/proj.tcl 49faf960df88a374686234105def663dbfc297ab79c87686df0a0b973dd77018 -F autosetup/sqlite-config.tcl a2a786ccdccead789c8e4cc82408257bf7857dcbdf45accab4a1538d641d3070 +F autosetup/proj.tcl 18ab0775dab8864d9f38ad0becb5d2a13b0c3986ecf4f9661de490341085e7b9 +F autosetup/sqlite-config.tcl 45182c777228e92f66357b63b686a80fcedd114e77a86f562e6b27c981454e95 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x F contrib/sqlitecon.tcl eb4c6578e08dd353263958da0dc620f8400b869a50d06e271ab0be85a51a08d3 @@ -2135,7 +2136,6 @@ F tool/enlargedb.c 3e8b2612b985cfa7e3e8800031ee191b43ae80de96abb5abbd5eada62651e F tool/extract-sqlite3h.tcl 069ceab0cee26cba99952bfa08c0b23e35941c837acabe143f0c355d96c9e2eb x F tool/extract.c 054069d81b095fbdc189a6f5d4466e40380505e2 F tool/fast_vacuum.c c129ae2924a48310c7b766810391da9e8fda532b9f6bd3f9a9e3a799a1b42af9 -F tool/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1821baf61bc86a7e F tool/fragck.tcl 5265a95126abcf6ab357f7efa544787e5963f439 F tool/fuzzershell.c 41480c8a1e4749351f381431ecfdfceba645396c5d836f8d26b51a33c4a21b33 F tool/genfkey.README e550911fa984c8255ebed2ef97824125d83806eb5232582700de949edf836eb1 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P f3c0071284fbe1c0a8c3fe73792a79f9df6be983e5c9bd1a7e2fe71ba7b2d400 -R bb2b8fb97c5254c022b045f9e204d5a8 -U drh -Z 3b840e739e362fa32d6af0f736408d3e +P c113e31b818d16770bec1edc980f6833dfb27c4d74178e66a778fbb5671c3a13 +R 309a2c3afab1d662c70990a09672e776 +U stephan +Z fb7c999d8dfb13e08fe006e0a7885fc0 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index c29e8e308c..9a5c1cf815 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -c113e31b818d16770bec1edc980f6833dfb27c4d74178e66a778fbb5671c3a13 +e1d483e342670092c3579f2f0975e49a0c74516ae34103a63b4cde156bf5e92b From f58b2c46d002578a32bcf076bfe3099d0f318bf9 Mon Sep 17 00:00:00 2001 From: stephan Date: Sun, 23 Mar 2025 22:49:00 +0000 Subject: [PATCH 024/120] Remove tool/tclConfigShToAutoDef.sh, as that functionality was moved into autosetup/proj.tcl so that it can be reused in, e.g., autoconf/tea. FossilOrigin-Name: c9c5a15d4d8141aae68d6643869f74879ae053cb86538b805058099af2cec16b --- autosetup/proj.tcl | 2 +- autosetup/sqlite-config.tcl | 10 +++++----- manifest | 17 ++++++++--------- manifest.uuid | 2 +- tool/tclConfigShToAutoDef.sh | 29 ----------------------------- 5 files changed, 15 insertions(+), 45 deletions(-) delete mode 100755 tool/tclConfigShToAutoDef.sh diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl index 5ba71bd5cc..39756f5b17 100644 --- a/autosetup/proj.tcl +++ b/autosetup/proj.tcl @@ -1397,7 +1397,7 @@ proc proj-current-proc-name {{lvl 0}} { # string. It converts certain parts of that file's contents to # [define]s (see the code for the whole list). If $tclConfigSh is an # empty string then it [define]s the various vars as empty strings. -proc proj-tclConfig-to-autosetup {tclConfigSh} { +proc proj-tclConfig-sh-to-autosetup {tclConfigSh} { set shBody {} set tclVars { TCL_INCLUDE_SPEC diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl index 53a21ded9a..67895a2434 100644 --- a/autosetup/sqlite-config.tcl +++ b/autosetup/sqlite-config.tcl @@ -1787,10 +1787,10 @@ proc sqlite-check-tcl {} { define TCLLIBDIR "" ; # Installation dir for TCL extension lib define TCL_CONFIG_SH ""; # full path to tclConfig.sh - # Clear out all vars which would be set by tclConfigShToAutoDef.sh, so - # that the late-config validation of @VARS@ works even if - # --disable-tcl is used. - proj-tclConfig-to-autosetup "" + # Clear out all vars which would harvest from tclConfig.sh so that + # the late-config validation of @VARS@ works even if --disable-tcl + # is used. + proj-tclConfig-sh-to-autosetup "" file delete -force ".tclenv.sh"; # ensure no stale state from previous configures. if {![opt-bool tcl]} { @@ -1889,7 +1889,7 @@ proc sqlite-check-tcl {} { # Export a subset of tclConfig.sh to the current TCL-space. If $cfg # is an empty string, this emits empty-string entries for the # various options we're interested in. - proj-tclConfig-to-autosetup $cfg + proj-tclConfig-sh-to-autosetup $cfg if {"" eq $with_tclsh && $cfg ne ""} { # We have tclConfig.sh but no tclsh. Attempt to locate a tclsh diff --git a/manifest b/manifest index 7a2d34a15e..ec85a380b3 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Internal\sconfigure\srefactoring\sto\ssupport\san\songoing\sconversion\sof\s./autoconf/tea\sto\sautosetup. -D 2025-03-23T21:38:28.791 +C Remove\stool/tclConfigShToAutoDef.sh,\sas\sthat\sfunctionality\swas\smoved\sinto\sautosetup/proj.tcl\sso\sthat\sit\scan\sbe\sreused\sin,\se.g.,\sautoconf/tea. +D 2025-03-23T22:49:00.085 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -47,11 +47,11 @@ F autosetup/cc-db.tcl 6e0ed90146197a5a05b245e649975c07c548e30926b218ca3e1d4dc034 F autosetup/cc-lib.tcl 493c5935b5dd3bf9bd4eca89b07c8b1b1a9356d61783035144e21795facf7360 F autosetup/cc-shared.tcl 4f024e94a47f427ba61de1739f6381ef0080210f9fae89112d5c1de1e5460d78 F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e45f -F autosetup/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1821baf61bc86a7e w tool/find_tclconfig.tcl +F autosetup/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1821baf61bc86a7e F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba -F autosetup/proj.tcl 18ab0775dab8864d9f38ad0becb5d2a13b0c3986ecf4f9661de490341085e7b9 -F autosetup/sqlite-config.tcl 45182c777228e92f66357b63b686a80fcedd114e77a86f562e6b27c981454e95 +F autosetup/proj.tcl 3fb4df80f4e114a6a5ef2f66c79e9836f8af798be6e5112fa525dd499e297e76 +F autosetup/sqlite-config.tcl 85490e59fb374cf091765308eae96bb96cc85169af46d78e034f3766bdbd0523 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x F contrib/sqlitecon.tcl eb4c6578e08dd353263958da0dc620f8400b869a50d06e271ab0be85a51a08d3 @@ -2207,7 +2207,6 @@ F tool/stack_usage.tcl f8e71b92cdb099a147dad572375595eae55eca43 F tool/stripccomments.c 68d2aa8cb504439f541ce66b8f128067612bdd16f5fb7bfe540f3fcb67c9c197 F tool/symbols-mingw.sh 4dbcea7e74768305384c9fd2ed2b41bbf9f0414d F tool/symbols.sh 1612bd947750e21e7b47befad5f6b3825b06cce0705441f903bf35ced65ae9b9 -F tool/tclConfigShToAutoDef.sh 44ec55046d86a3febb2cb3e099399b41794e80e9cd138eee7b9b016f819e882b x F tool/tclConfigShToMake.sh 7c065d81c2d178e15e45a77372c6e5a38b5a1b08755301cd6f20a3a862db7312 x F tool/varint.c 5d94cb5003db9dbbcbcc5df08d66f16071aee003 F tool/vdbe-compress.tcl fa2f37ab39b2a0087fafb6a7f3ce19503e25e624ffa8ed9951717ab72920c088 @@ -2216,8 +2215,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P c113e31b818d16770bec1edc980f6833dfb27c4d74178e66a778fbb5671c3a13 -R 309a2c3afab1d662c70990a09672e776 +P e1d483e342670092c3579f2f0975e49a0c74516ae34103a63b4cde156bf5e92b +R cd4f41e401426ec770b3b52663dd55f7 U stephan -Z fb7c999d8dfb13e08fe006e0a7885fc0 +Z 2310dd6e43c6cf51b7512d8d58ddf2d8 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 9a5c1cf815..2391380602 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e1d483e342670092c3579f2f0975e49a0c74516ae34103a63b4cde156bf5e92b +c9c5a15d4d8141aae68d6643869f74879ae053cb86538b805058099af2cec16b diff --git a/tool/tclConfigShToAutoDef.sh b/tool/tclConfigShToAutoDef.sh deleted file mode 100755 index d12657063e..0000000000 --- a/tool/tclConfigShToAutoDef.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -# -# A level of indirection for use soley by the configure script -# (auto.def). -# -# Expects to be passed a full path to a tclConfig.sh. It sources it -# and emits TCL code which sets some vars which are exported by -# tclConfig.sh. -# -# This script expects that the caller has already validated that the -# file exists, is not a directory, and is readable. -# -# If passed no filename, or an empty one, then it emits config code -# suitable for the "config not found" case. -if test x = "x$1"; then - TCL_INCLUDE_SPEC= - TCL_LIB_SPEC= - TCL_STUB_LIB_SPEC= - TCL_EXEC_PREFIX= - TCL_VERSION= -else - . "$1" -fi - -echo "define TCL_INCLUDE_SPEC {$TCL_INCLUDE_SPEC} ;" -echo "define TCL_LIB_SPEC {$TCL_LIB_SPEC} ;" -echo "define TCL_STUB_LIB_SPEC {$TCL_STUB_LIB_SPEC} ;" -echo "define TCL_EXEC_PREFIX {$TCL_EXEC_PREFIX} ;" -echo "define TCL_VERSION {$TCL_VERSION} ;" From 49a015092e0cef820ec0d94d571726c8d939449d Mon Sep 17 00:00:00 2001 From: stephan Date: Sun, 23 Mar 2025 23:04:48 +0000 Subject: [PATCH 025/120] Correct a --force flag which should be -force in a TCL file delete call. Some TCL versions (like the one on my system) accepts either but others don't. Problem reported in [forum:c02224d862|forum post c02224d862]. FossilOrigin-Name: 172f4e4772d90f4737eddb43d97a566a6e3b92702c61e23391e43134737cc838 --- autosetup/proj.tcl | 2 +- manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl index 39756f5b17..ae61ee3a91 100644 --- a/autosetup/proj.tcl +++ b/autosetup/proj.tcl @@ -1432,6 +1432,6 @@ proc proj-tclConfig-sh-to-autosetup {tclConfigSh} { set shName ".tclConfigSh.tcl" proj-file-write $shName $shBody eval [exec sh $shName $tclConfigSh] - file delete --force $shName + file delete -force $shName } } diff --git a/manifest b/manifest index ec85a380b3..b8b552ba15 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Remove\stool/tclConfigShToAutoDef.sh,\sas\sthat\sfunctionality\swas\smoved\sinto\sautosetup/proj.tcl\sso\sthat\sit\scan\sbe\sreused\sin,\se.g.,\sautoconf/tea. -D 2025-03-23T22:49:00.085 +C Correct\sa\s--force\sflag\swhich\sshould\sbe\s-force\sin\sa\sTCL\sfile\sdelete\scall.\sSome\sTCL\sversions\s(like\sthe\sone\son\smy\ssystem)\saccepts\seither\sbut\sothers\sdon't.\sProblem\sreported\sin\s[forum:c02224d862|forum\spost\sc02224d862]. +D 2025-03-23T23:04:48.534 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -50,7 +50,7 @@ F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e F autosetup/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1821baf61bc86a7e F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba -F autosetup/proj.tcl 3fb4df80f4e114a6a5ef2f66c79e9836f8af798be6e5112fa525dd499e297e76 +F autosetup/proj.tcl 4706741184076b3056356324727b7691e3b6877c84224fa05bbf7d804e895e55 F autosetup/sqlite-config.tcl 85490e59fb374cf091765308eae96bb96cc85169af46d78e034f3766bdbd0523 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x @@ -2215,8 +2215,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P e1d483e342670092c3579f2f0975e49a0c74516ae34103a63b4cde156bf5e92b -R cd4f41e401426ec770b3b52663dd55f7 +P c9c5a15d4d8141aae68d6643869f74879ae053cb86538b805058099af2cec16b +R cede8298428fc3b5753dc7441a438a62 U stephan -Z 2310dd6e43c6cf51b7512d8d58ddf2d8 +Z aaca6f130a80cd53a17483fde3862546 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 2391380602..7821fd6fad 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -c9c5a15d4d8141aae68d6643869f74879ae053cb86538b805058099af2cec16b +172f4e4772d90f4737eddb43d97a566a6e3b92702c61e23391e43134737cc838 From 1b906dd920ba2fb12fe686782313fa1c40231c36 Mon Sep 17 00:00:00 2001 From: dan Date: Mon, 24 Mar 2025 11:13:18 +0000 Subject: [PATCH 026/120] Add test cases to session1.test. FossilOrigin-Name: dda9d7cf319e74de7703bda1eb77e3e7aa7459d6fa1508cc1d62cdfc7985c368 --- ext/session/session1.test | 68 +++++++++++++++++++++++++++++++++++++++ manifest | 14 ++++---- manifest.uuid | 2 +- 3 files changed, 76 insertions(+), 8 deletions(-) diff --git a/ext/session/session1.test b/ext/session/session1.test index 6da9051791..3262c9bc41 100644 --- a/ext/session/session1.test +++ b/ext/session/session1.test @@ -684,6 +684,74 @@ do_test $tn.14.4 { list [catch {sqlite3session_config invalid 123} msg] $msg } {1 SQLITE_MISUSE} +#------------------------------------------------------------------------- +reset_db + +do_execsql_test $tn.15.0 { + CREATE TABLE records( + idx INTEGER PRIMARY KEY AUTOINCREMENT, + tbl TEXT NOT NULL, + pk TEXT NOT NULL, + value TEXT, + UNIQUE(tbl, pk) + ); + + CREATE TABLE changes( + idx INTEGER PRIMARY KEY AUTOINCREMENT, + tbl TEXT NOT NULL, + pk TEXT NOT NULL, + op TEXT DEFAULT ('='), + path TEXT DEFAULT ('$'), + value TEXT, + UNIQUE(tbl, pk) + ); + + CREATE TRIGGER changes_after_insert + AFTER INSERT ON changes + FOR EACH ROW + BEGIN + INSERT INTO records(tbl, pk, value) + VALUES (NEW.tbl, NEW.pk, NEW.value) + ON CONFLICT(tbl, pk) DO UPDATE SET value = NEW.value; + END; + + CREATE VIEW data_view AS + SELECT *, '=' AS op, '$' AS path FROM records + WHERE tbl = 'data'; + + CREATE TRIGGER data_insert + INSTEAD OF INSERT ON data_view + BEGIN + INSERT INTO changes(tbl, pk, op, path, value) + VALUES (NEW.tbl, NEW.pk, NEW.op, NEW.path, NEW.value); + END; + + CREATE TRIGGER data_update + INSTEAD OF UPDATE ON data_view + BEGIN + INSERT INTO changes(tbl, pk, op, path, value) + VALUES (NEW.tbl, NEW.pk, NEW.op, NEW.path, NEW.value); + END; + + CREATE TRIGGER data_delete + INSTEAD OF DELETE ON data_view + BEGIN + INSERT INTO changes(tbl, pk, op, path, value) + VALUES (NEW.tbl, NEW.pk, NEW.op, NEW.path, NEW.value); + END; +} + +do_iterator_test $tn.15.1 * { + INSERT INTO data_view (tbl, pk, value) VALUES + ('data', '1', 'First'), + ('data', '2', 'Second'); +} { + {INSERT changes 1 X..... {} {i 1 t data t 1 n {} n {} t First}} + {INSERT changes 1 X..... {} {i 2 t data t 2 n {} n {} t Second}} + {INSERT records 1 X... {} {i 1 t data t 1 t First}} + {INSERT records 1 X... {} {i 2 t data t 2 t Second}} +} + }] } diff --git a/manifest b/manifest index b8b552ba15..14172eb3e7 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Correct\sa\s--force\sflag\swhich\sshould\sbe\s-force\sin\sa\sTCL\sfile\sdelete\scall.\sSome\sTCL\sversions\s(like\sthe\sone\son\smy\ssystem)\saccepts\seither\sbut\sothers\sdon't.\sProblem\sreported\sin\s[forum:c02224d862|forum\spost\sc02224d862]. -D 2025-03-23T23:04:48.534 +C Add\stest\scases\sto\ssession1.test. +D 2025-03-24T11:13:18.510 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -577,7 +577,7 @@ F ext/rtree/visual01.txt e9c2564083bcd30ec51b07f881bffbf0e12b50a3f6fced0c222c5c1 F ext/session/changeset.c 7a1e6a14c7e92d36ca177e92e88b5281acd709f3b726298dc34ec0fb58869cb5 F ext/session/changesetfuzz.c 227076ab0ae4447d742c01ee88a564da6478bbf26b65108bf8fac9cd8b0b24aa F ext/session/changesetfuzz1.test 15b629004e58d5ffcc852e6842a603775bb64b1ce51254831f3d12b113b616cd -F ext/session/session1.test cc7e58976c2cc6263fb7ef0c5125a98eafc2f213c75929f986768d2dbc224725 +F ext/session/session1.test a9cf4280a01ccee85c9be3d5b76047a05bea2dfbb2891e7775acbec227d9c823 F ext/session/session2.test ee83bb973b9ce17ccce4db931cdcdae65eb40bbb22089b2fe6aa4f6be3b9303f F ext/session/session3.test 2cc1629cfb880243aec1a7251145e07b78411d851b39b2aa1390704550db8e6a F ext/session/session4.test 823f6f018fcbb8dacf61e2960f8b3b848d492b094f8b495eae1d9407d9ab7219 @@ -2215,8 +2215,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P c9c5a15d4d8141aae68d6643869f74879ae053cb86538b805058099af2cec16b -R cede8298428fc3b5753dc7441a438a62 -U stephan -Z aaca6f130a80cd53a17483fde3862546 +P 172f4e4772d90f4737eddb43d97a566a6e3b92702c61e23391e43134737cc838 +R a200b3e63d995804ba9cb2f6183e529f +U dan +Z 9e23138503c61e5d6f72d80a5d70588a # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 7821fd6fad..b29703cd99 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -172f4e4772d90f4737eddb43d97a566a6e3b92702c61e23391e43134737cc838 +dda9d7cf319e74de7703bda1eb77e3e7aa7459d6fa1508cc1d62cdfc7985c368 From e6e453def6fc09432a734c82c96f185ed0924bae Mon Sep 17 00:00:00 2001 From: dan Date: Mon, 24 Mar 2025 19:58:13 +0000 Subject: [PATCH 027/120] Test that the sqlite3changeset_apply() function is properly appling indirect changes. FossilOrigin-Name: 1dadea3a79c3edd110b0b32b07287744300958fed31f2da11901a42b16f86669 --- ext/session/session1.test | 62 ++++++++++++++++++++++++++++++++++----- manifest | 12 ++++---- manifest.uuid | 2 +- 3 files changed, 62 insertions(+), 14 deletions(-) diff --git a/ext/session/session1.test b/ext/session/session1.test index 3262c9bc41..27ac0a194b 100644 --- a/ext/session/session1.test +++ b/ext/session/session1.test @@ -741,16 +741,64 @@ do_execsql_test $tn.15.0 { END; } -do_iterator_test $tn.15.1 * { +do_test $tn.15.1 { + set C [changeset_from_sql { INSERT INTO data_view (tbl, pk, value) VALUES ('data', '1', 'First'), ('data', '2', 'Second'); -} { - {INSERT changes 1 X..... {} {i 1 t data t 1 n {} n {} t First}} - {INSERT changes 1 X..... {} {i 2 t data t 2 n {} n {} t Second}} - {INSERT records 1 X... {} {i 1 t data t 1 t First}} - {INSERT records 1 X... {} {i 2 t data t 2 t Second}} -} + }] + changeset_to_list $C +} [list \ + {INSERT changes 1 X..... {} {i 1 t data t 1 n {} n {} t First}} \ + {INSERT changes 1 X..... {} {i 2 t data t 2 n {} n {} t Second}} \ + {INSERT records 1 X... {} {i 1 t data t 1 t First}} \ + {INSERT records 1 X... {} {i 2 t data t 2 t Second}} \ +] + +forcedelete test.db2 +sqlite3 db2 test.db2 + +do_test $tn.15.2 { + db2 eval { + CREATE TABLE records( + idx INTEGER PRIMARY KEY AUTOINCREMENT, + tbl TEXT NOT NULL, + pk TEXT NOT NULL, + value TEXT, + UNIQUE(tbl, pk) + ); + CREATE TABLE changes( + idx INTEGER PRIMARY KEY AUTOINCREMENT, + tbl TEXT NOT NULL, + pk TEXT NOT NULL, + op TEXT DEFAULT ('='), + path TEXT DEFAULT ('$'), + value TEXT, + UNIQUE(tbl, pk) + ); + + CREATE TRIGGER changes_after_insert + AFTER INSERT ON changes + FOR EACH ROW + BEGIN + INSERT INTO records(tbl, pk, value) + VALUES (NEW.tbl, NEW.pk, NEW.value) + ON CONFLICT(tbl, pk) DO UPDATE SET value = NEW.value; + END; + } + + sqlite3changeset_apply db2 $C "" + + db2 eval { + SELECT * FROM records; + } +} [list 1 data 1 First 2 data 2 Second] + +do_test $tn.15.3 { + db2 eval { + SELECT * FROM changes; + } +} {1 data 1 {} {} First 2 data 2 {} {} Second} }] } diff --git a/manifest b/manifest index 14172eb3e7..ccb8614c96 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\stest\scases\sto\ssession1.test. -D 2025-03-24T11:13:18.510 +C Test\sthat\sthe\ssqlite3changeset_apply()\sfunction\sis\sproperly\sappling\sindirect\schanges. +D 2025-03-24T19:58:13.162 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -577,7 +577,7 @@ F ext/rtree/visual01.txt e9c2564083bcd30ec51b07f881bffbf0e12b50a3f6fced0c222c5c1 F ext/session/changeset.c 7a1e6a14c7e92d36ca177e92e88b5281acd709f3b726298dc34ec0fb58869cb5 F ext/session/changesetfuzz.c 227076ab0ae4447d742c01ee88a564da6478bbf26b65108bf8fac9cd8b0b24aa F ext/session/changesetfuzz1.test 15b629004e58d5ffcc852e6842a603775bb64b1ce51254831f3d12b113b616cd -F ext/session/session1.test a9cf4280a01ccee85c9be3d5b76047a05bea2dfbb2891e7775acbec227d9c823 +F ext/session/session1.test 57cb77a816af7760bf4e321d315603ab517e46abd853e75620cfb07eb409c6f8 F ext/session/session2.test ee83bb973b9ce17ccce4db931cdcdae65eb40bbb22089b2fe6aa4f6be3b9303f F ext/session/session3.test 2cc1629cfb880243aec1a7251145e07b78411d851b39b2aa1390704550db8e6a F ext/session/session4.test 823f6f018fcbb8dacf61e2960f8b3b848d492b094f8b495eae1d9407d9ab7219 @@ -2215,8 +2215,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 172f4e4772d90f4737eddb43d97a566a6e3b92702c61e23391e43134737cc838 -R a200b3e63d995804ba9cb2f6183e529f +P dda9d7cf319e74de7703bda1eb77e3e7aa7459d6fa1508cc1d62cdfc7985c368 +R 59f8eb65053a8c37b81b1cc130461378 U dan -Z 9e23138503c61e5d6f72d80a5d70588a +Z 3ffcb094ab9fb9973d19c727d478cf37 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index b29703cd99..bebd8505b3 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -dda9d7cf319e74de7703bda1eb77e3e7aa7459d6fa1508cc1d62cdfc7985c368 +1dadea3a79c3edd110b0b32b07287744300958fed31f2da11901a42b16f86669 From b0c3118cad42832cf08b3b6fdc2f9b736d73d6ec Mon Sep 17 00:00:00 2001 From: drh <> Date: Mon, 24 Mar 2025 23:08:40 +0000 Subject: [PATCH 028/120] Clarify and reduce redundancy in an assert() in walChecksumBytes(). FossilOrigin-Name: 3c53abf5e6df446d569040042363265737aa10fc8aaa20b31c587100c557c5e7 --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/wal.c | 6 ++---- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/manifest b/manifest index ccb8614c96..dbe512c36e 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Test\sthat\sthe\ssqlite3changeset_apply()\sfunction\sis\sproperly\sappling\sindirect\schanges. -D 2025-03-24T19:58:13.162 +C Clarify\sand\sreduce\sredundancy\sin\san\sassert()\sin\swalChecksumBytes(). +D 2025-03-24T23:08:40.014 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -865,7 +865,7 @@ F src/vdbetrace.c fe0bc29ebd4e02c8bc5c1945f1d2e6be5927ec12c06d89b03ef2a4def34bf8 F src/vdbevtab.c fc46b9cbd759dc013f0b3724549cc0d71379183c667df3a5988f7e2f1bd485f3 F src/vtab.c 828221bdbeaaa6d62126ee6d07fd4ec0d09dcaea846f87ad01944d8b7e548859 F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9 -F src/wal.c 554a6b1afaaecb98cb47bb598bccf1374c9d3b624e5c4c3c4eb2ad364cc579f8 +F src/wal.c bcf40795a09b699ad7e42624dd6282b13335164fbabcd5a98a717758cebef451 F src/wal.h ba252daaa94f889f4b2c17c027e823d9be47ce39da1d3799886bbd51f0490452 F src/walker.c d5006d6b005e4ea7302ad390957a8d41ed83faa177e412f89bc5600a7462a014 F src/where.c e80177e452b4e436abc6ece0cb0249631000434f2a7425cc1df709015fce74ad @@ -2215,8 +2215,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P dda9d7cf319e74de7703bda1eb77e3e7aa7459d6fa1508cc1d62cdfc7985c368 -R 59f8eb65053a8c37b81b1cc130461378 -U dan -Z 3ffcb094ab9fb9973d19c727d478cf37 +P 1dadea3a79c3edd110b0b32b07287744300958fed31f2da11901a42b16f86669 +R c08c05d83169d801717107adbed59c20 +U drh +Z 6fb51dc820f4b9af99017fdaa2038941 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index bebd8505b3..36359607da 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -1dadea3a79c3edd110b0b32b07287744300958fed31f2da11901a42b16f86669 +3c53abf5e6df446d569040042363265737aa10fc8aaa20b31c587100c557c5e7 diff --git a/src/wal.c b/src/wal.c index 7f091a48cf..5fe2296d6c 100644 --- a/src/wal.c +++ b/src/wal.c @@ -871,10 +871,8 @@ static void walChecksumBytes( s1 = s2 = 0; } - assert( nByte>=8 ); - assert( (nByte&0x00000007)==0 ); - assert( nByte<=65536 ); - assert( nByte%4==0 ); + /* nByte is a multiple of 8 between 8 and 65536 */ + assert( nByte>=8 && (nByte&7)==0 && nByte<=65536 ); if( !nativeCksum ){ do { From 6de1c9d55985dc1540deb4ccd4aa8e3a94f129c1 Mon Sep 17 00:00:00 2001 From: stephan Date: Tue, 25 Mar 2025 01:32:16 +0000 Subject: [PATCH 029/120] Configure script internal cleanups. Factor out the superfluous proj-lshift_ and use lassign instead. Add -ro flag to proj-file-write. FossilOrigin-Name: 1f98fc07fdf06d699ffbf1521b0b5e937a582017e4325bd994b488e06becbecc --- autosetup/proj.tcl | 63 ++++++++++++++++++++++++---------------------- manifest | 14 +++++------ manifest.uuid | 2 +- 3 files changed, 41 insertions(+), 38 deletions(-) diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl index ae61ee3a91..fdd5d5e346 100644 --- a/autosetup/proj.tcl +++ b/autosetup/proj.tcl @@ -64,6 +64,7 @@ proc proj-warn {msg} { show-notices puts stderr "WARNING: $msg" } + ######################################################################## # @proj-error msg # @@ -111,6 +112,7 @@ proc proj-bold {str} { # @proj-indented-notice ?-error? ?-notice? msg # # Takes a multi-line message and emits it with consistent indentation. +# It does not perform any line-wrapping of its own. # # If the -notice flag it used then it emits using [user-notice], which # means its rendering will (A) go to stderr and (B) be delayed until @@ -162,26 +164,6 @@ proc proj-is-cross-compiling {} { return [expr {[get-define host] ne [get-define build]}] } -######################################################################## -# proj-lshift_ shifts $count elements from the list named $listVar -# and returns them as a new list. On empty input, returns "". -# -# Modified slightly from: https://wiki.tcl-lang.org/page/lshift -proc proj-lshift_ {listVar {count 1}} { - upvar 1 $listVar l - if {![info exists l]} { - # make the error message show the real variable name - error "can't read \"$listVar\": no such variable" - } - if {![llength $l]} { - # error Empty - return "" - } - set r [lrange $l 0 [incr count -1]] - set l [lreplace $l [set l 0] $count] - return $r -} - ######################################################################## # @proj-strip-hash-comments value # @@ -479,16 +461,16 @@ proc proj-opt-define-bool {args} { set invert 0 if {[lindex $args 0] eq "-v"} { set invert 1 - set args [lrange $args 1 end] + lassign $args - optName defName descr + } else { + lassign $args optName defName descr } - set optName [proj-lshift_ args] - set defName [proj-lshift_ args] - set descr [proj-lshift_ args] if {"" eq $descr} { set descr $defName } + puts "optName=$optName defName=$defName descr=$descr" set rc 0 - msg-checking "$descr ... " + msg-checking "[join $descr] ... " if {[proj-opt-truthy $optName]} { if {0 eq $invert} { set rc 1 @@ -617,14 +599,28 @@ proc proj-file-content-list {fname} { } ######################################################################## -# @proj-file-write fname content +# @proj-file-write ?-ro? fname content # # Works like autosetup's [writefile] but explicitly uses binary mode -# to avoid EOL translation on Windows. -proc proj-file-write {fname content} { +# to avoid EOL translation on Windows. If $fname already exists, it is +# overwritten, even if it's flagged as read-only. +proc proj-file-write {args} { + if {"-ro" eq [lindex $args 0]} { + lassign $args ro fname content + } else { + set ro "" + lassign $args fname content + } + file delete -force -- $fname; # in case it's read-only set f [open $fname wb] puts -nonewline $f $content close $f + if {"" ne $ro} { + catch { + exec chmod -w $fname + #file attributes -w $fname; #jimtcl has no 'attributes' + } + } } ######################################################################## @@ -693,12 +689,17 @@ proc proj-make-from-dot-in {args} { } foreach f $filename { set f [string trim $f] - catch { exec chmod u+w $f } + if {[file exists $f]} { + catch { exec chmod u+w $f } + } make-template $f.in $f if {$touch} { proj-touch $f } - catch { exec chmod -w $f } + catch { + exec chmod -w $f + #file attributes -w $f; #jimtcl has no 'attributes' + } } } @@ -1407,6 +1408,8 @@ proc proj-tclConfig-sh-to-autosetup {tclConfigSh} { TCL_PREFIX TCL_VERSION } + # Build a small shell script which proxies the $tclVars from + # $tclConfigSh into autosetup code... lappend shBody "if test x = \"x${tclConfigSh}\"; then" foreach v $tclVars { lappend shBody "$v= ;" diff --git a/manifest b/manifest index dbe512c36e..fd16d584a0 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Clarify\sand\sreduce\sredundancy\sin\san\sassert()\sin\swalChecksumBytes(). -D 2025-03-24T23:08:40.014 +C Configure\sscript\sinternal\scleanups.\sFactor\sout\sthe\ssuperfluous\sproj-lshift_\sand\suse\slassign\sinstead.\sAdd\s-ro\sflag\sto\sproj-file-write. +D 2025-03-25T01:32:16.183 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -50,7 +50,7 @@ F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e F autosetup/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1821baf61bc86a7e F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba -F autosetup/proj.tcl 4706741184076b3056356324727b7691e3b6877c84224fa05bbf7d804e895e55 +F autosetup/proj.tcl 8bf99398c20a440d197182f85aaa60a41f07248af779fea68c41df30e6da8546 F autosetup/sqlite-config.tcl 85490e59fb374cf091765308eae96bb96cc85169af46d78e034f3766bdbd0523 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x @@ -2215,8 +2215,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 1dadea3a79c3edd110b0b32b07287744300958fed31f2da11901a42b16f86669 -R c08c05d83169d801717107adbed59c20 -U drh -Z 6fb51dc820f4b9af99017fdaa2038941 +P 3c53abf5e6df446d569040042363265737aa10fc8aaa20b31c587100c557c5e7 +R 1bbb3c025ec1b46650981e453b29c862 +U stephan +Z c139b7624e642b2a32a6648b4ac4392b # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 36359607da..ce13eb13ea 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -3c53abf5e6df446d569040042363265737aa10fc8aaa20b31c587100c557c5e7 +1f98fc07fdf06d699ffbf1521b0b5e937a582017e4325bd994b488e06becbecc From 517a0e04d101782e184a4c05c997b2e9b2050141 Mon Sep 17 00:00:00 2001 From: drh <> Date: Wed, 26 Mar 2025 14:45:15 +0000 Subject: [PATCH 030/120] Attempt to reduce the amount of retry time when trying to open an inaccessible database file on Windows. See [forum:/forumpost/e7991420f54dca50|forum thread e7991420f5] FossilOrigin-Name: 986e45912cde7cb8e6db8ba7a9364aef7187a23032be64ef6cd573163f56676d --- manifest | 17 ++++++++++------- manifest.uuid | 2 +- src/os_win.c | 29 ++++++++++++++++++++++------- 3 files changed, 33 insertions(+), 15 deletions(-) diff --git a/manifest b/manifest index fd16d584a0..9b2706403e 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Configure\sscript\sinternal\scleanups.\sFactor\sout\sthe\ssuperfluous\sproj-lshift_\sand\suse\slassign\sinstead.\sAdd\s-ro\sflag\sto\sproj-file-write. -D 2025-03-25T01:32:16.183 +C Attempt\sto\sreduce\sthe\samount\sof\sretry\stime\swhen\strying\sto\sopen\nan\sinaccessible\sdatabase\sfile\son\sWindows.\s\sSee\n[forum:/forumpost/e7991420f54dca50|forum\sthread\se7991420f5] +D 2025-03-26T14:45:15.858 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -770,7 +770,7 @@ F src/os_common.h 6c0eb8dd40ef3e12fe585a13e709710267a258e2c8dd1c40b1948a1d14582e F src/os_kv.c 4d39e1f1c180b11162c6dc4aa8ad34053873a639bac6baae23272fc03349986a F src/os_setup.h 6011ad7af5db4e05155f385eb3a9b4470688de6f65d6166b8956e58a3d872107 F src/os_unix.c 410185df4900817c218c0efdb8064b3481af88cb3f7cea7392f820b6eebc7889 -F src/os_win.c ab9912a2c1cb39a6429b8de919a5b63ad1c7775e511d748391c57bf9ad03bd29 +F src/os_win.c 4101da78fb67baebff7fb4e763015b943aa3a1160d3a50e6b1932d77154d9fcb F src/os_win.h 7b073010f1451abe501be30d12f6bc599824944a F src/pager.c 9fbb541b46125dfa8914827575e6bb4d15048caa008073b1709112d495d7983b F src/pager.h 6137149346e6c8a3ddc1eeb40aee46381e9bc8b0fcc6dda8a1efde993c2275b8 @@ -2215,8 +2215,11 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 3c53abf5e6df446d569040042363265737aa10fc8aaa20b31c587100c557c5e7 -R 1bbb3c025ec1b46650981e453b29c862 -U stephan -Z c139b7624e642b2a32a6648b4ac4392b +P 1f98fc07fdf06d699ffbf1521b0b5e937a582017e4325bd994b488e06becbecc +R 6f6ce59b3ff23057e3579b9943d2a4aa +T *branch * winopen-retry +T *sym-winopen-retry * +T -sym-trunk * +U drh +Z ef0135aae199dad5cd806976ce43f48e # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index ce13eb13ea..382b9eb59e 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -1f98fc07fdf06d699ffbf1521b0b5e937a582017e4325bd994b488e06becbecc +986e45912cde7cb8e6db8ba7a9364aef7187a23032be64ef6cd573163f56676d diff --git a/src/os_win.c b/src/os_win.c index dab8af34c4..03bdc30d05 100644 --- a/src/os_win.c +++ b/src/os_win.c @@ -5279,6 +5279,12 @@ static int winAccess( int *pResOut /* OUT: Result */ ); +/* +** The Windows version of xAccess() accepts an extra bit in the flags +** parameter that prevents an anti-virus retry loop. +*/ +#define NORETRY 0x4000 + /* ** Open a file. */ @@ -5466,10 +5472,10 @@ static int winOpen( dwCreationDisposition, &extendedParameters); if( h!=INVALID_HANDLE_VALUE ) break; - if( isReadWrite ){ + if( isReadWrite && cnt==0 ){ int rc2, isRO = 0; sqlite3BeginBenignMalloc(); - rc2 = winAccess(pVfs, zUtf8Name, SQLITE_ACCESS_READ, &isRO); + rc2 = winAccess(pVfs, zUtf8Name, SQLITE_ACCESS_READ|NORETRY, &isRO); sqlite3EndBenignMalloc(); if( rc2==SQLITE_OK && isRO ) break; } @@ -5483,10 +5489,10 @@ static int winOpen( dwFlagsAndAttributes, NULL); if( h!=INVALID_HANDLE_VALUE ) break; - if( isReadWrite ){ + if( isReadWrite && cnt==0 ){ int rc2, isRO = 0; sqlite3BeginBenignMalloc(); - rc2 = winAccess(pVfs, zUtf8Name, SQLITE_ACCESS_READ, &isRO); + rc2 = winAccess(pVfs, zUtf8Name, SQLITE_ACCESS_READ|NORETRY, &isRO); sqlite3EndBenignMalloc(); if( rc2==SQLITE_OK && isRO ) break; } @@ -5503,10 +5509,10 @@ static int winOpen( dwFlagsAndAttributes, NULL); if( h!=INVALID_HANDLE_VALUE ) break; - if( isReadWrite ){ + if( isReadWrite && cnt==0 ){ int rc2, isRO = 0; sqlite3BeginBenignMalloc(); - rc2 = winAccess(pVfs, zUtf8Name, SQLITE_ACCESS_READ, &isRO); + rc2 = winAccess(pVfs, zUtf8Name, SQLITE_ACCESS_READ|NORETRY, &isRO); sqlite3EndBenignMalloc(); if( rc2==SQLITE_OK && isRO ) break; } @@ -5723,8 +5729,14 @@ static int winAccess( int rc = 0; DWORD lastErrno = 0; void *zConverted; + int noRetry = 0; /* Do not use winRetryIoerr() */ UNUSED_PARAMETER(pVfs); + if( (flags & NORETRY)!=0 ){ + noRetry = 1; + flags &= ~NORETRY; + } + SimulateIOError( return SQLITE_IOERR_ACCESS; ); OSTRACE(("ACCESS name=%s, flags=%x, pResOut=%p\n", zFilename, flags, pResOut)); @@ -5747,7 +5759,10 @@ static int winAccess( memset(&sAttrData, 0, sizeof(sAttrData)); while( !(rc = osGetFileAttributesExW((LPCWSTR)zConverted, GetFileExInfoStandard, - &sAttrData)) && winRetryIoerr(&cnt, &lastErrno) ){} + &sAttrData)) + && !noRetry + && winRetryIoerr(&cnt, &lastErrno) + ){ /* Loop until true */} if( rc ){ /* For an SQLITE_ACCESS_EXISTS query, treat a zero-length file ** as if it does not exist. From 4a6de7ff7cd1ab9e43dacd839659c203032ba887 Mon Sep 17 00:00:00 2001 From: drh <> Date: Wed, 26 Mar 2025 15:51:05 +0000 Subject: [PATCH 031/120] Further attempted improvements at fast-fail for an inaccessible database file. FossilOrigin-Name: cdeb21a312d4f1a9e3009a0baf0af33857c172f7bc22bca047dcd46a03e9c964 --- manifest | 15 ++++++--------- manifest.uuid | 2 +- src/os_win.c | 9 +++++---- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/manifest b/manifest index 9b2706403e..4a5ec55ac9 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Attempt\sto\sreduce\sthe\samount\sof\sretry\stime\swhen\strying\sto\sopen\nan\sinaccessible\sdatabase\sfile\son\sWindows.\s\sSee\n[forum:/forumpost/e7991420f54dca50|forum\sthread\se7991420f5] -D 2025-03-26T14:45:15.858 +C Further\sattempted\simprovements\sat\sfast-fail\sfor\san\sinaccessible\ndatabase\sfile. +D 2025-03-26T15:51:05.795 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -770,7 +770,7 @@ F src/os_common.h 6c0eb8dd40ef3e12fe585a13e709710267a258e2c8dd1c40b1948a1d14582e F src/os_kv.c 4d39e1f1c180b11162c6dc4aa8ad34053873a639bac6baae23272fc03349986a F src/os_setup.h 6011ad7af5db4e05155f385eb3a9b4470688de6f65d6166b8956e58a3d872107 F src/os_unix.c 410185df4900817c218c0efdb8064b3481af88cb3f7cea7392f820b6eebc7889 -F src/os_win.c 4101da78fb67baebff7fb4e763015b943aa3a1160d3a50e6b1932d77154d9fcb +F src/os_win.c de4315b809e8c8a8dd9556a14bf4dd74d090d7e3d92ab535ff6f200408c50c15 F src/os_win.h 7b073010f1451abe501be30d12f6bc599824944a F src/pager.c 9fbb541b46125dfa8914827575e6bb4d15048caa008073b1709112d495d7983b F src/pager.h 6137149346e6c8a3ddc1eeb40aee46381e9bc8b0fcc6dda8a1efde993c2275b8 @@ -2215,11 +2215,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 1f98fc07fdf06d699ffbf1521b0b5e937a582017e4325bd994b488e06becbecc -R 6f6ce59b3ff23057e3579b9943d2a4aa -T *branch * winopen-retry -T *sym-winopen-retry * -T -sym-trunk * +P 986e45912cde7cb8e6db8ba7a9364aef7187a23032be64ef6cd573163f56676d +R 71d9939e4210ac024e91383da51b8b95 U drh -Z ef0135aae199dad5cd806976ce43f48e +Z a58eb24c7298b49ea23e24e867766e9d # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 382b9eb59e..bc1f34c702 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -986e45912cde7cb8e6db8ba7a9364aef7187a23032be64ef6cd573163f56676d +cdeb21a312d4f1a9e3009a0baf0af33857c172f7bc22bca047dcd46a03e9c964 diff --git a/src/os_win.c b/src/os_win.c index 03bdc30d05..29680b6eb8 100644 --- a/src/os_win.c +++ b/src/os_win.c @@ -5309,6 +5309,7 @@ static int winOpen( void *zConverted; /* Filename in OS encoding */ const char *zUtf8Name = zName; /* Filename in UTF-8 encoding */ int cnt = 0; + int isRO = 0; /* file is known to be accessible readonly */ /* If argument zPath is a NULL pointer, this function is required to open ** a temporary file. Use this buffer to store the file name in. @@ -5473,7 +5474,7 @@ static int winOpen( &extendedParameters); if( h!=INVALID_HANDLE_VALUE ) break; if( isReadWrite && cnt==0 ){ - int rc2, isRO = 0; + int rc2; sqlite3BeginBenignMalloc(); rc2 = winAccess(pVfs, zUtf8Name, SQLITE_ACCESS_READ|NORETRY, &isRO); sqlite3EndBenignMalloc(); @@ -5490,7 +5491,7 @@ static int winOpen( NULL); if( h!=INVALID_HANDLE_VALUE ) break; if( isReadWrite && cnt==0 ){ - int rc2, isRO = 0; + int rc2; sqlite3BeginBenignMalloc(); rc2 = winAccess(pVfs, zUtf8Name, SQLITE_ACCESS_READ|NORETRY, &isRO); sqlite3EndBenignMalloc(); @@ -5510,7 +5511,7 @@ static int winOpen( NULL); if( h!=INVALID_HANDLE_VALUE ) break; if( isReadWrite && cnt==0 ){ - int rc2, isRO = 0; + int rc2; sqlite3BeginBenignMalloc(); rc2 = winAccess(pVfs, zUtf8Name, SQLITE_ACCESS_READ|NORETRY, &isRO); sqlite3EndBenignMalloc(); @@ -5527,7 +5528,7 @@ static int winOpen( if( h==INVALID_HANDLE_VALUE ){ sqlite3_free(zConverted); sqlite3_free(zTmpname); - if( isReadWrite && !isExclusive ){ + if( isReadWrite && isRO && !isExclusive ){ return winOpen(pVfs, zName, id, ((flags|SQLITE_OPEN_READONLY) & ~(SQLITE_OPEN_CREATE|SQLITE_OPEN_READWRITE)), From a6f6fa8675cd24dd784093979f12f10b8a155a2f Mon Sep 17 00:00:00 2001 From: drh <> Date: Wed, 26 Mar 2025 17:05:29 +0000 Subject: [PATCH 032/120] On winOpen(), redo the read-only test on every retry attempt. Just don't retry the winAccess() call. FossilOrigin-Name: ccdd67ad9a508530ccfcec582410768c24bca4eb8b05939577fb99a50dd44b15 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/os_win.c | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/manifest b/manifest index 4a5ec55ac9..e0f92d42b9 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Further\sattempted\simprovements\sat\sfast-fail\sfor\san\sinaccessible\ndatabase\sfile. -D 2025-03-26T15:51:05.795 +C On\swinOpen(),\sredo\sthe\sread-only\stest\son\severy\sretry\sattempt.\s\sJust\ndon't\sretry\sthe\swinAccess()\scall. +D 2025-03-26T17:05:29.844 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -770,7 +770,7 @@ F src/os_common.h 6c0eb8dd40ef3e12fe585a13e709710267a258e2c8dd1c40b1948a1d14582e F src/os_kv.c 4d39e1f1c180b11162c6dc4aa8ad34053873a639bac6baae23272fc03349986a F src/os_setup.h 6011ad7af5db4e05155f385eb3a9b4470688de6f65d6166b8956e58a3d872107 F src/os_unix.c 410185df4900817c218c0efdb8064b3481af88cb3f7cea7392f820b6eebc7889 -F src/os_win.c de4315b809e8c8a8dd9556a14bf4dd74d090d7e3d92ab535ff6f200408c50c15 +F src/os_win.c f4bc31a181306f61f0597c8445971081e1f1ee98a17f86587a92fe56be799294 F src/os_win.h 7b073010f1451abe501be30d12f6bc599824944a F src/pager.c 9fbb541b46125dfa8914827575e6bb4d15048caa008073b1709112d495d7983b F src/pager.h 6137149346e6c8a3ddc1eeb40aee46381e9bc8b0fcc6dda8a1efde993c2275b8 @@ -2215,8 +2215,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 986e45912cde7cb8e6db8ba7a9364aef7187a23032be64ef6cd573163f56676d -R 71d9939e4210ac024e91383da51b8b95 +P cdeb21a312d4f1a9e3009a0baf0af33857c172f7bc22bca047dcd46a03e9c964 +R 6c2ac8039a69021b5d572668708823ae U drh -Z a58eb24c7298b49ea23e24e867766e9d +Z de39fba1a9cbf7ece5997a062776733d # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index bc1f34c702..a75cf46195 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -cdeb21a312d4f1a9e3009a0baf0af33857c172f7bc22bca047dcd46a03e9c964 +ccdd67ad9a508530ccfcec582410768c24bca4eb8b05939577fb99a50dd44b15 diff --git a/src/os_win.c b/src/os_win.c index 29680b6eb8..a545d7310a 100644 --- a/src/os_win.c +++ b/src/os_win.c @@ -5473,7 +5473,7 @@ static int winOpen( dwCreationDisposition, &extendedParameters); if( h!=INVALID_HANDLE_VALUE ) break; - if( isReadWrite && cnt==0 ){ + if( isReadWrite ){ int rc2; sqlite3BeginBenignMalloc(); rc2 = winAccess(pVfs, zUtf8Name, SQLITE_ACCESS_READ|NORETRY, &isRO); @@ -5490,7 +5490,7 @@ static int winOpen( dwFlagsAndAttributes, NULL); if( h!=INVALID_HANDLE_VALUE ) break; - if( isReadWrite && cnt==0 ){ + if( isReadWrite ){ int rc2; sqlite3BeginBenignMalloc(); rc2 = winAccess(pVfs, zUtf8Name, SQLITE_ACCESS_READ|NORETRY, &isRO); @@ -5510,7 +5510,7 @@ static int winOpen( dwFlagsAndAttributes, NULL); if( h!=INVALID_HANDLE_VALUE ) break; - if( isReadWrite && cnt==0 ){ + if( isReadWrite ){ int rc2; sqlite3BeginBenignMalloc(); rc2 = winAccess(pVfs, zUtf8Name, SQLITE_ACCESS_READ|NORETRY, &isRO); From 7b3477c7764cb48cfc676454f9a35c377cb7c79f Mon Sep 17 00:00:00 2001 From: drh <> Date: Thu, 27 Mar 2025 10:59:18 +0000 Subject: [PATCH 033/120] Fix an off-by-one bug in the ".dbtotxt" command from the shell that results in incorrect output. FossilOrigin-Name: 2345094e879c5538bfea005785ce0848e6d565a49bcb48b323c258d00ccbe9b8 --- manifest | 13 ++++++------- manifest.uuid | 2 +- src/shell.c.in | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/manifest b/manifest index aa15323e07..410f3e5513 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Reduce\sthe\sdelay\scaused\sby\santi-virus\sretries\sin\sWindows\swhen\sattempting\sto\nopen\sa\sdatabase\sfile\swith\sinsufficient\spermission. -D 2025-03-26T22:23:22.787 +C Fix\san\soff-by-one\sbug\sin\sthe\s".dbtotxt"\scommand\sfrom\sthe\sshell\sthat\sresults\nin\sincorrect\soutput. +D 2025-03-27T10:59:18.433 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -785,7 +785,7 @@ F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c F src/resolve.c 20e1fbe8f840ffc0cd835e33f68a802a22e34faa918d7a269f3de242fda02f99 F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97 F src/select.c bfe14cdfceba54744b1c6c29099313f5173a0793dfaff0cd484774e9d05dbeab -F src/shell.c.in 9d1b46e09c1b933b0c7afaf4ae27030dc356ee19ae4f95ce8bf3647035b9635b +F src/shell.c.in 5acad3e594edad8de9f3e7f9a5ee8acfe934497ed642d29dc8fdd6665e25fdbf F src/sqlite.h.in fd70afd92948cf7cc93f687ac960bad1b0b6fbc436752419eff2fd65a1809380 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h 3f046c04ea3595d6bfda99b781926b17e672fd6d27da2ba6d8d8fc39981dcb54 @@ -2215,9 +2215,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 1f98fc07fdf06d699ffbf1521b0b5e937a582017e4325bd994b488e06becbecc ccdd67ad9a508530ccfcec582410768c24bca4eb8b05939577fb99a50dd44b15 -R 6c2ac8039a69021b5d572668708823ae -T +closed ccdd67ad9a508530ccfcec582410768c24bca4eb8b05939577fb99a50dd44b15 +P d25c8a6222d4e3f20c137b1490572ad491d9c404ff12947d5867c3e00fcb615c +R 7f1dc2197ed34b61300fd57f99c67793 U drh -Z 0d5fc73351502e2a61a26190ba1c4a5b +Z 6f6d82890663e463e31bf8fc619d730c # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 35e8e088e6..a4c3c5b00b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -d25c8a6222d4e3f20c137b1490572ad491d9c404ff12947d5867c3e00fcb615c +2345094e879c5538bfea005785ce0848e6d565a49bcb48b323c258d00ccbe9b8 diff --git a/src/shell.c.in b/src/shell.c.in index 8272956ebd..4efcfee953 100644 --- a/src/shell.c.in +++ b/src/shell.c.in @@ -6855,7 +6855,7 @@ static int shell_dbtotxt_command(ShellState *p, int nArg, char **azArg){ for(j=0; j<16 && aLine[j]==0; j++){} if( j==16 ) continue; if( !seenPageLabel ){ - sqlite3_fprintf(p->out, "| page %lld offset %lld\n", pgno, pgno*pgSz); + sqlite3_fprintf(p->out, "| page %lld offset %lld\n",pgno,(pgno-1)*pgSz); seenPageLabel = 1; } sqlite3_fprintf(p->out, "| %5d:", i); From 87b90921b6e0bd0c415bd6723a9d90b50bfd2747 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 27 Mar 2025 14:32:57 +0000 Subject: [PATCH 034/120] In Tcl, always use eq/ne for comparing strings, not ==/!= FossilOrigin-Name: f96a5346e3e890adfdc94a682688c2c15893e50fbaf2a26e5ef39cda8b331ee4 --- autosetup/proj.tcl | 2 +- ext/rbu/rbuvacuum2.test | 2 +- manifest | 82 ++++++++++++++++++++--------------------- manifest.uuid | 2 +- test/all.test | 2 +- test/analyzer1.test | 2 +- test/attach.test | 2 +- test/avtrans.test | 2 +- test/chunksize.test | 2 +- test/filectrl.test | 2 +- test/io.test | 2 +- test/ioerr.test | 4 +- test/journal1.test | 2 +- test/lock.test | 2 +- test/malloc.test | 2 +- test/misc7.test | 6 +-- test/nockpt.test | 2 +- test/pager1.test | 2 +- test/permutations.test | 2 +- test/pragma.test | 2 +- test/quota.test | 6 +-- test/readonly.test | 2 +- test/shared.test | 4 +- test/shared3.test | 2 +- test/shell3.test | 2 +- test/shell8.test | 2 +- test/symlink2.test | 2 +- test/uri.test | 4 +- test/vacuum-into.test | 4 +- test/vtabH.test | 4 +- test/walblock.test | 2 +- test/walcrash4.test | 2 +- test/walsetlk.test | 6 +-- test/win32heap.test | 2 +- test/writecrash.test | 2 +- test/zipfile.test | 8 ++-- tool/buildtclext.tcl | 4 +- tool/mksqlite3c.tcl | 2 +- 38 files changed, 93 insertions(+), 93 deletions(-) diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl index fdd5d5e346..e6dab7c670 100644 --- a/autosetup/proj.tcl +++ b/autosetup/proj.tcl @@ -757,7 +757,7 @@ proc proj-looks-like-windows {{key host}} { # These apply only to the local OS, not a cross-compilation target, # as the above check potentially can. if {$::autosetup(iswin)} { return 1 } - if {[find-an-executable cygpath] ne "" || $::tcl_platform(os)=="Windows NT"} { + if {[find-an-executable cygpath] ne "" || $::tcl_platform(os) eq "Windows NT"} { return 1 } } diff --git a/ext/rbu/rbuvacuum2.test b/ext/rbu/rbuvacuum2.test index 34ec26188a..e338fedda6 100644 --- a/ext/rbu/rbuvacuum2.test +++ b/ext/rbu/rbuvacuum2.test @@ -171,7 +171,7 @@ foreach {ttt state} { # * Set the state db permissions to the same as those on the db file. # db close -if {$::tcl_platform(platform)=="unix"} { +if {$::tcl_platform(platform) eq "unix"} { forcedelete test.db sqlite3 db test.db diff --git a/manifest b/manifest index 395837b4e9..d839c4bec1 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Merge\strunk.\sSome\sadditional\stest-fixes\sfor\sCygwin -D 2025-03-27T14:13:12.785 +C In\sTcl,\salways\suse\seq/ne\sfor\scomparing\sstrings,\snot\s==/!= +D 2025-03-27T14:32:57.504 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -51,7 +51,7 @@ F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e F autosetup/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1821baf61bc86a7e F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba -F autosetup/proj.tcl 8bf99398c20a440d197182f85aaa60a41f07248af779fea68c41df30e6da8546 +F autosetup/proj.tcl cac07d75249fa127500b8e96080dc807e9ae97fe98d29e84a17bc28f4628e93f F autosetup/sqlite-config.tcl 85490e59fb374cf091765308eae96bb96cc85169af46d78e034f3766bdbd0523 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x @@ -503,7 +503,7 @@ F ext/rbu/rbusave.test 588b618dad9d65c4b13d03a79931de82213503fedc26bdf5789c996ec F ext/rbu/rbusplit.test a6dedd23cf37bcf2e8646d9d7139846e96d60d92f9bc6d6ba6ca8c24c0bd1f72 F ext/rbu/rbutemplimit.test 4980df2d4b74f4dd982add8f78809106154ef5a3c4bdce747422ab0b0481e029 F ext/rbu/rbuvacuum.test 542561741ff2b262e3694bc6012b44694ee62c545845319a06f323783b15311e -F ext/rbu/rbuvacuum2.test ae097d04feb041446a74fac94b24bffeb3fdd60e32b848c5611e507ab702b81b +F ext/rbu/rbuvacuum2.test 1a9bd41f127be2826de2a65204df9118525a8af8d16e61e6bc63ba3ac0010a23 F ext/rbu/rbuvacuum3.test 3ce42695fdf21aaa3499e857d7d4253bc499ad759bcd6c9362042c13cd37d8de F ext/rbu/rbuvacuum4.test ffccd22f67e2d0b380d2889685742159dfe0d19a3880ca3d2d1d69eefaebb205 F ext/rbu/sqlite3rbu.c c208f72f20784bf2f39244b6cdf8019724a706e1246be289e7621c42aad54695 @@ -882,7 +882,7 @@ F test/aggfault.test 777f269d0da5b0c2524c7ff6d99ae9a93db4f1b1839a914dd2a12e3035c F test/aggnested.test 610b0ce2c3e8f3daee25f9752800ee8d785db10da4aa1fbeea0ea1aabaf1d704 F test/aggorderby.test cc3abf5de64d46ff66395ca8c2346b66c2576d5aedb7bffc5b0742508856e3bf F test/alias.test 4529fbc152f190268a15f9384a5651bbbabc9d87 -F test/all.test 2ecb8bbd52416642e41c9081182a8df05d42c75637afd4488aace78cc4b69e13 +F test/all.test cf929f721e20960ca9db89471fa44f9176322ba8f25e97193f91881c223643b3 F test/alter.test 3c00eff1e2036b9f93e9cd0f3d3e63750ac87ecb5bc71b9d7bd07cbf2ac4c494 F test/alter2.test 7e3d26ab409df52df887b366a63902c3429b935c41cb962fd58ffc25784f2f19 F test/alter3.test dcdd5f850f30656a45a0f05e41abfb52b74bbf6ccba165d0f7adf6b0116e4fd6 @@ -917,12 +917,12 @@ F test/analyzeD.test 485f621cfd2ef0a8f8ac79672586651bfa495bd899db50461bb4b558400 F test/analyzeE.test d2ec7921c162cdc33ac8e7eb01f9ebf78100610af7c94c8552bbf551de1fb397 F test/analyzeF.test 40b5cc3ad7b10e81020d7ca86f1417647ecfae7477cfd88acc5aa7ae1068f949 F test/analyzeG.test 623be33038c49648872746c8dd8b23b5792c08fef173c55e82f1b12fca259852 -F test/analyzer1.test 583c8cb9b22b036b4c3553fece5492b7ad2ccb0a38ddebf6bc90f701460ab28c +F test/analyzer1.test b6a624ec0af92eec209e1328465b66937c8fdf2fb442a3fa45321ddb3700f4aa F test/atof1.test bd21c4a0e718ab1470de07a2a79f2544d7903be34feebcc80de04beee4807b00 F test/atomic.test 065a453dde33c77ff586d91ccaa6ed419829d492dbb1a5694b8a09f3f9d7d061 F test/atomic2.test b6863b4aa552543874f80b42fb3063f1c8c2e3d8e56b6562f00a3cc347b5c1da F test/atrc.c c388fac43dbba05c804432a7135ae688b32e8f25818e9994ffba4b64cf60c27c -F test/attach.test 54f8e49e88d0de48f6428267a678465863d2b8f72320612f35bd5c02e240bc2f +F test/attach.test 12b2a9872c1ce20edf40289f00d82d13faae59ced522d98496ab06ad5c5e0a1c F test/attach2.test 6d1e3a457ce260d6fc8e5945c07fba6c76dc2aa90e1c701f067b50ee88f7315a F test/attach3.test c59d92791070c59272e00183b7353eeb94915976 F test/attach4.test 00e754484859998d124d144de6d114d920f2ed6ca2f961e6a7f4183c714f885e @@ -941,7 +941,7 @@ F test/autovacuum.test 00671369bbf96c6a49989a9425f5b78b94075d6a4b031e5e00000c2c3 F test/autovacuum2.test 76f7eb4fe6a6bf6d33a196a7141dba98886d2fb53a268d7feca285d5da4759d7 F test/autovacuum_ioerr2.test 8a367b224183ad801e0e24dcb7d1501f45f244b4 F test/avfs.test 76f59743dc1f5fa533840d1818b420fe1ee45e21c0fd6bbac7942ba677903128 -F test/avtrans.test b7dc25459ecbd86c6fa9c606ee3068f59d81e225118617dcf2bbb6ded2ade89e +F test/avtrans.test 7a6eae44763293024b137b53ff824d8500d754dbae060a8d940afbacfc1d4a15 F test/backcompat.test f2431465ed668f09fc3f6998e56e893a1506ccea6e8b6f409f085f759f431b48 F test/backup.test 3b08fd4af69f0fa786931103a31f4542b184aba16e239e5f22b18c3c2476697f F test/backup2.test b153553ee5667b0748b43346b0725fbf80ce1f5544613bf087d669778b60ec56 @@ -1007,7 +1007,7 @@ F test/changes.test 4377d202a487f66fc2822c1bf57c46798c8b2caf7446f4f701723b1dbb6b F test/changes2.test 07949edcc732af28cb54276bfb7d99723bccc1e905a423648bf57ac5cb0dc792 F test/check.test 56e4ed457e9f8683b9fc56f5b964f461f6e8a8dd5a13f3d495408215d66419ed F test/checkfault.test da6cb3d50247169efcb20bdf57863a3ccfa1d27d9e55cd324f0680096970f014 -F test/chunksize.test 427d87791743486cbf0c3b8c625002f3255cb3a89c6eba655a98923b1387b760 +F test/chunksize.test faea11c5d6df9d392252a8dd879e1b1d68c9d3e8b7909cbed8bcec3b60c706f1 F test/cksumvfs.test 6f05dc95847c06a3dc10eee6b5ab1351d78314a52d0db15717c9388f4cb96646 F test/close.test eccbad8ecd611d974cbf47278c3d4e5874faf02d811338d5d348af42d56d647c F test/closure01.test 9905883f1b171a4638f98fc764879f154e214a306d3d8daf412a15e7f3a9b1e0 @@ -1149,7 +1149,7 @@ F test/extension01.test 5de412c66276105901c370770175003381fdcb0c4da7054fa43cf4a3 F test/external_reader.test 6fdec43eeca23eb32faad1e95a4d1abc402bc8b3db70df12d6fc08a637f4a2b5 F test/extraquick.test cb254400bd42bfb777ff675356aabf3287978f79 F test/fallocate.test 37a62e396a68eeede8f8d2ecf23573a80faceb630788d314d0a073d862616717 -F test/filectrl.test 7e6788759997139632eb700765d5f73d53fc5ff5d9d778e773911750ab134321 +F test/filectrl.test 4b720117388cf6766d0b798e2dddd785953f8f371633b0c0084d2f34cf72336a F test/filefmt.test f393e80c4b8d493b7a7f8f3809a8425bbf4292af1f5140f01cb1427798a2bbd4 F test/filter1.test 590f8ba9a0cd0823b80d89ac75c5ce72276189cef9225d2436adaf1ee87f3727 F test/filter2.tcl 44e525497ce07382915f01bd29ffd0fa49dab3adb87253b5e5103ba8f93393e8 @@ -1353,8 +1353,8 @@ F test/interrupt.test ac1ef50ec9ab8e4f0e17c47629f82539d4b22558904e321ed5abea2e61 F test/interrupt2.test e4408ca770a6feafbadb0801e54a0dcd1a8d108d F test/intpkey.test aee694afed1a65c86c4e69ad030224b3fc268113d00685234d40079fca16bad3 F test/intreal.test 68829a8bb073ee1610ca3f8f9e0f99b0371fb36e0fa64862dd5ced4ef03c2343 -F test/io.test 998a37d03bb45477ad0d5ad1c118b2940c06fcc34ac54ccd2784efd1bd45a93e -F test/ioerr.test c94eef1cd8bfc36f9aa493e41e151e9160281ac8e2d960cc9dcdcc8e6aa99ab3 +F test/io.test d267fdc8915444a45e19841489033ebe70bb69f6db605b00df70be16b2a80f59 +F test/ioerr.test 78552a95d53b9674d85f63bdf3d76a8df70b4d5dba5a6a1b8a1d60f166cd2c6b F test/ioerr2.test 2593563599e2cc6b6b4fcf5878b177bdd5d8df26 F test/ioerr3.test d3cec5e1a11ad6d27527d0d38573fbff14c71bdd F test/ioerr4.test f130fe9e71008577b342b8874d52984bd04ede2c @@ -1377,7 +1377,7 @@ F test/joinD.test 2ce62e7353a0702ca5e70008faf319c1d4686aa19fba34275c6d1da0e960be F test/joinE.test d5d182f3812771e2c0d97c9dcf5dbe4c41c8e21c82560e59358731c4a3981d6b F test/joinF.test 53dd66158806823ea680dd7543b5406af151b5aafa5cd06a7f3231cd94938127 F test/joinH.test 55f69e64da74d4eca2235237f3acb657aef181e22e45daa228e35bba865e0255 -F test/journal1.test c7b768041b7f494471531e17abc2f4f5ebf9e5096984f43ed17c4eb80ba34497 +F test/journal1.test bc61a4228db11bffca118bd358ba4b868524bf080f3532749de6c539656e20fa F test/journal2.test 9dac6b4ba0ca79c3b21446bbae993a462c2397c4 F test/journal3.test e5aeff93a7776cf644dbc48dec277655cff80a1cd24689036abc87869b120ea6 F test/jrnlmode.test 9b5bc01dac22223cb60ec2d5f97acf568d73820794386de5634dcadbea9e1946 @@ -1414,7 +1414,7 @@ F test/literal2.tcl 1499037beaf661aeecdbe48801220a181d805372a64c6128d5f26bb6a4a8 F test/literal2.test b149e16b5fc9ee6249069a8858ed41052f222014fe0ba7ad43c2fb989c2dada2 F test/loadext.test 878db71cf74b48250dbe9033bbfe6088ff869db3353ffd4febc68c0cd459959e F test/loadext2.test 0408380b57adca04004247179837a18e866a74f7 -F test/lock.test 05f346b65040b9a27c032c984e1e509dfef1661135b4f26a3ab6d21358277803 +F test/lock.test 675b4367ec58b21009e46982d071c8259255e69072296b7756ea75fac5425d1a F test/lock2.test 5242d8ac4e2d59c403aebff606af449b455aceff F test/lock3.test f271375930711ae044080f4fe6d6eda930870d00 F test/lock4.test 27143363eda1622f03c133efc8db808fc331afd973486cb571ea71cd717d37b8 @@ -1425,7 +1425,7 @@ F test/lock_common.tcl f0a1f7b8f3fbb8629dc6231613a02841736f86ef72151429d5ffc12c7 F test/lookaside.test 5a828e7256f1ee4da8e1bdaa03373a3ccdb0f1ff98dfa82e9b76cb41a45b1083 F test/main.test e8752d76233b1c8906cd2c98ad920dba868bd63c87d51d8a2ea5e9cba55dd496 F test/make-where7.tcl 05c16b5d4f5d6512881dfec560cb793915932ef9 -F test/malloc.test 18dd1c4188c81ca79cf123527c71b19ee0c31feb9947fdffb0dc6ceb1436816a +F test/malloc.test f7781c8151179fe4b7f743044a737ac2dfd87bf9cc18dd01398caf28d34e09c5 F test/malloc3.test 6e88bae6312854a4adb4ecc2a6a5ea8c59b4db778b724ba718e1c43fc8c3c136 F test/malloc4.test 957337613002b7058a85116493a262f679f3a261 F test/malloc5.test 2e4ad7684a13389a44a840499cd47173a8d05f22f082d7d083eece433a7a64eb @@ -1470,7 +1470,7 @@ F test/misc3.test 651b88bca19b8ff6a7b6af73dae00c3fd5b3ea5bee0c0d1d91abd4c4b47487 F test/misc4.test 10cd6addb2fa9093df4751a1b92b50440175dd5468a6ec84d0386e78f087db0e F test/misc5.test 02fcaf4d42405be02ec975e946270a50b0282dac98c78303ade0d1392839d2b8 F test/misc6.test 953cc693924d88e6117aeba16f46f0bf5abede91 -F test/misc7.test d912f3d45c2989191b797504a220ca225d6be80b21acad22ba0d35f4a9ee4579 +F test/misc7.test d595599972ec0b436985f0f02f243b68500ffc977b9b3194ec66c0866cfddcab F test/misc8.test 08d2380bc435486b12161521f225043ac2be26f02471c2c1ea4cac0b1548edbd F test/misuse.test 46d42ffdf375833ea5828796e56f84660344f7548659b493059f152f00e66840 F test/mjournal.test 28a08d5cb5fb5b5702a46e19176e45e964e0800d1f894677169e79f34030e152 @@ -1488,7 +1488,7 @@ F test/multiplex4.test e8ae4c4bd70606a5727743241f13b5701990abe4 F test/mutex1.test 42cb5e244c3a77bb0ef2b967e06fa5e7ba7d32d90a9b20bed98f6f5ede185a25 F test/mutex2.test bfeaeac2e73095b2ac32285d2756e3a65e681660 F test/nan.test 73ea63ab43668313e2f8cc9ef9e9a966672c7934f3ce76926fbe991235d07d91 -F test/nockpt.test e0ef4af9b35892de80515c2e45a54eb3c83623721f8bbc797450041a3cd3405f +F test/nockpt.test 3db354270fc63b6871eebd40285d4c55324fb27be629c958adbff6d7fcaa8e14 F test/nolock.test f196cf8b8fbea4e2ca345140a2b3f3b0da45c76e F test/normalize.test f23b6c5926c59548635fcf39678ac613e726121e073dd902a3062fbb83903b72 F test/notify1.test 669b2b743618efdc18ca4b02f45423d5d2304abf @@ -1521,7 +1521,7 @@ F test/oserror.test ee3fad06ec8671c4d047c2c92a567fc2e0e8161caaec7edd6d48325c5ac9 F test/ossfuzz.c 9636dad2092a05a32110df0ca06713038dd0c43dd89a77dabe4b8b0d71096715 F test/ossshell.c f125c5bd16e537a2549aa579b328dd1c59905e7ab1338dfc210e755bb7b69f17 F test/ovfl.test 199c482696defceacee8c8e0e0ef36da62726b2f -F test/pager1.test 05531a43594663fd67de7048201dafc35164d93f209995ce4afffae05f30ef05 +F test/pager1.test b083c2d5d89df8e979658d9320bfc0b9d50b4ef8ae1d9e115a692ff0b9768393 F test/pager2.test c0ede15952b607f9a38f653acdfa73c19e657958e9104aab1a71950ea7b71831 F test/pager3.test 4e9a83d6ca0838d7c602c9eb93d1357562d9059c1e02ffb138a8271020838370 F test/pager4.test b995066c699472614eb5949db5a2e2c51fd463863518afe68675d7fac09216bd @@ -1535,9 +1535,9 @@ F test/pcache.test c8acbedd3b6fd0f9a7ca887a83b11d24a007972b F test/pcache2.test af7f3deb1a819f77a6d0d81534e97d1cf62cd442 F test/pendingrace.test e99efc5ab3584da3dfc8cd6a0ec4e5a42214820574f5ea24ee93f1d84655f463 F test/percentile.test 52ba89d6ee6b65f770972b67dace358bab7cdbd532803d3db157845268e789cd -F test/permutations.test 37650c5286f7d6f322af95cad876b69c6c2c79c28dc649f09de07d3312b1213c +F test/permutations.test 5260363b43b3fad4becb49b58d0b53e6024e1c18dc169b154d0b98db5630bbf2 F test/pg_common.tcl 3b27542224db1e713ae387459b5d117c836a5f6e328846922993b6d2b7640d9f -F test/pragma.test 11cb9310c42f921918f7f563e3c0b6e70f9f9c3a6a1cf12af8fccb6c574f3882 +F test/pragma.test 7d07b7bb76e273215d6a20c4f83c3062cc28976c737ccb70a686025801e86c8f F test/pragma2.test e5d5c176360c321344249354c0c16aec46214c9f F test/pragma3.test 92a46bbea12322dd94a404f49edcfbfc913a2c98115f0d030a7459bb4712ef31 F test/pragma4.test 396ef9bff1fb966d41721545ad4b12bfc26aae315f5fe51d9b917828d49e6f8e @@ -1554,14 +1554,14 @@ F test/queryonly.test 5f653159e0f552f0552d43259890c1089391dcca F test/quick.test 1681febc928d686362d50057c642f77a02c62e57 F test/quickcheck.test a4b7e878cd97e46108291c409b0bf8214f29e18fddd68a42bc5c1375ad1fb80a F test/quota-glob.test 32901e9eed6705d68ca3faee2a06b73b57cb3c26 -F test/quota.test bfb269ce81ea52f593f9648316cd5013d766dd2a +F test/quota.test 2747bfdf50d01155c06feb391286bb585f66977feaf5e26e5a37bc00ff7dee7c F test/quota2.test 7dc12e08b11cbc4c16c9ba2aa2e040ea8d8ab4b8 F test/quote.test 7b01b2a261bc26d9821aea9f4941ce1e08191d62fc55ba8862440fb3a59197a4 F test/randexpr1.tcl 40dec52119ed3a2b8b2a773bce24b63a3a746459 F test/randexpr1.test eda062a97e60f9c38ae8d806b03b0ddf23d796df F test/rbu.test 168573d353cd0fd10196b87b0caa322c144ef736 F test/rdonly.test 64e2696c322e3538df0b1ed624e21f9a23ed9ff8 -F test/readonly.test 69a7ccec846cad2e000b3539d56360d02f327061dc5e41f7f9a3e01f19719952 +F test/readonly.test 0d307c335b3421898cfe64a783a376138aa003849b6bff61ee2d21e805bc0051 F test/recover.test c76d05f33f0271fba0f0752170e03b0ab5952dc61dcea7ab3ba40df03c4c42de F test/regexp1.test 8f2a8bc1569666e29a4cee6c1a666cd224eb6d50e2470d1dc1df995170f3e0f1 F test/regexp2.test 55ed41da802b0e284ac7e2fe944be3948f93ff25abbca0361a609acfed1368b5 @@ -1630,9 +1630,9 @@ F test/selectH.test 0b54599f1917d99568c9b929df22ec6261ed7b6d2f02a46b5945ef81b787 F test/session.test 78fa2365e93d3663a6e933f86e7afc395adf18be F test/sessionfuzz-data1.db 1f8d5def831f19b1c74571037f0d53a588ea49a6c4ca2a028fc0c27ef896dbcb F test/sessionfuzz.c f693b8827034a3bed7616d89c65fb4fe8b7ff3c0f000c6ea6beda69b7f1aced3 -F test/shared.test c99510b83a6ad650d7335e4733568b9d7b4f5ee88f4f2167b6138950a795b537 +F test/shared.test 50bd8091735b272732125928c363476a17b5fb264835de7d19e90c72055c888b F test/shared2.test 03eb4a8d372e290107d34b6ce1809919a698e879 -F test/shared3.test f8cd07c1a2b7cdb315c01671a0b2f8e3830b11ef31da6baa9a9cd8da88965403 +F test/shared3.test cb92d083003ddf0f313166e494ec2fcafa55fdebf648628923ded3169dba8850 F test/shared4.test c75f476804e76e26bf6fa0e7b421fb0ca7d07558 F test/shared6.test 104e1e25b4c4f47aaccca7dba75b3d87bb505b46b009af03ae49bf55b7c4976c F test/shared7.test a81e99f83e6c51b02ac99c96fb3a2a7b5978c956 @@ -1644,12 +1644,12 @@ F test/shared_err.test 32634e404a3317eeb94abc7a099c556a346fdb8fb3858dbe222a4cbb8 F test/sharedlock.test 5ede3c37439067c43b0198f580fd374ebf15d304 F test/shell1.test a00910c3d811420c15c1411106871c65678516435e352cbb013a09839bf327c6 F test/shell2.test ac102ebc0a9ec166257600c4ee8bdefec242163afced295f10b004f4af3fc9dd -F test/shell3.test db1953a8e59d08e9240b7cc5948878e184f7eb2623591587f8fd1f1a5bd536d8 +F test/shell3.test 603b448e917537cf77be0f265c05c6f63bc677c63a533c8e96aae923b56f4a0e F test/shell4.test ad7eee983b5e7f1dd92d8c87bc0f39474086bc32c980c00f3934c54aabc636a2 F test/shell5.test d17e7927ab8b7f720efbdd9b5d05fceb6c3c56c25917901b315400214bf24ef4 F test/shell6.test e3b883b61d4916b6906678a35f9d19054861123ad91b856461e0a456273bdbb8 F test/shell7.test 43fd8e511c533bab5232e95c7b4be93b243451709e89582600d4b6e67693d5c3 -F test/shell8.test aea51ecbcd4494c746b096aeff51d841d04d5f0dc4b62eb42427f16109b87acd +F test/shell8.test 641cf21a99c59404c24e3062923734951c4099a6b6b6520de00cf7a1249ee871 F test/shell9.test 8742a5b390cdcef6369f5aa223e415aa4255a4129ef249b177887dc635a87209 F test/shellA.test 4ecff8b7b2c0122ba8174abfbcc4b0f59e44d80f2a911068f8cd4cfc6661032d F test/shmlock.test 9f1f729a7fe2c46c88b156af819ac9b72c0714ac6f7246638a73c5752b5fd13c @@ -1716,7 +1716,7 @@ F test/swarmvtab2.test c948cb2fdfc5b01d85e8f6d6504854202dc1a0782ab2a0ed61538f27c F test/swarmvtab3.test 41a3ab47cb7a834d4e5336425103b617410a67bb95d335ef536f887587ece073 F test/swarmvtabfault.test 8a67a9f27c61073a47990829e92bc0c64420a807cb642b15a25f6c788210ed95 F test/symlink.test 60e16915cd0ee068244563f354ae012149cf7541e922025e31ac613e3fa3e389 -F test/symlink2.test bf932ff7fe95c9dbb39d2a990df9098b0ea943233c97e40098e0a8d6b559a96f +F test/symlink2.test 3cf7f09dcf3cf74541f5fdb1ede3c731e4e35d2018d85efc61e32ac114435ce3 F test/sync.test a619e407ede58a7b6e3e44375328628559fc9695a9c24c47cb5690a866b0031b F test/sync2.test 06152269ed73128782c450c355988fe8dd794d305833af75e1a5e79edd4dae47 F test/syscall.test a067468b43b8cb2305e9f9fe414e5f40c875bb5d2cba5f00b8154396e95fcf37 @@ -1955,10 +1955,10 @@ F test/upsert3.test 88d7d590a1948a9cb6eac1b54b0642f67a9f35a1fc0f19b200e97d5d39e3 F test/upsert4.test 25d2a1da92f149331ae0c51ca6e3eee78189577585eab92de149900d62994fa5 F test/upsert5.test 9953b180d02d1369cdbb6c73c900834e5fef8cb78e98e07511c8762ec21cc176 F test/upsertfault.test f21ca47740841fdb4d61acfa7b17646d773e67724fe8c185b71c018db8a94b35 -F test/uri.test c1abaaaa28e9422d61e5f3f9cbc8ef993ec49fe802f581520731708561d49384 +F test/uri.test 1250724af9beeed2d6c3716f5b990c483200c54f408d3c0ec9543a3c7961f8fc F test/uri2.test 9d3ba7a53ee167572d53a298ee4a5d38ec4a8fb7 F test/utf16align.test 9fde0bb5d3a821594aa68c6829ab9c5453a084384137ebb9f6153e2d678039da -F test/vacuum-into.test 77845cee98770c416dae9b0da6bb3229753861f2da65c11b4f9715d081712d8a +F test/vacuum-into.test 5a489714feecfdabfc7b293be4111564a173dee92c0d6818dd0207f3ade65783 F test/vacuum.test ce91c39f7f91a4273bf620efad21086b5aa6ef1d F test/vacuum2.test 9fd45ce6ce29f5614c249e03938d3567c06a9e772d4f155949f8eafe2d8af520 F test/vacuum3.test d9d9a04ee58c485b94694fd4f68cffaba49c32234fdefe1ac1a622c5e17d4ce3 @@ -1990,7 +1990,7 @@ F test/vtabC.test 4528f459a13136f982e75614d120aef165f17292 F test/vtabD.test 05b3f1d77117271671089e48719524b676842e96 F test/vtabE.test 2a143fe75a11275781d1fd1988d86b66a3f69cb98f4add62e3da8fd0f637b45f F test/vtabF.test 1918844c7c902f6a16c8dacf1ec8f84886d6e78b -F test/vtabH.test 8e338acba32207085b6fe9cb2a58f7b408e74c8e1a2964cbdaca903ac82213cc +F test/vtabH.test a9417d92111629e2c33e0f3b06cc84bcd611753d0fc017b3ce6ae96572bc2f2f F test/vtabI.test 751b07636700dbdea328e4265b6077ccd6811a3f F test/vtabJ.test a6aef49d558af90fae10565b29501f82a95781cb4f797f2d13e2d19f9b6bc77b F test/vtabK.test 13293177528fada1235c0112db0d187d754af1355c5a39371abd365104e3afbf @@ -2014,12 +2014,12 @@ F test/wal9.test 378e76a9ad09cd9bee06c172ad3547b0129a6750 F test/wal_common.tcl 204d1721ac13c5e0c7fae6380315b5ab7f4e8423f580d826c5e9df1995cb018d F test/walbak.test 018d4e5a3d45c6298d11b99f09a8ef6876527946 F test/walbig.test f437473a16cfb314867c6b5d1dbcd519e73e3434 -F test/walblock.test be48f3a75eff0b4456209f26b3ce186c2015497d +F test/walblock.test 6bb472e82730e7e4e81395e907a01d8cfc2bd9e1f01f8a9184ca572e2955a4bf F test/walcksum.test ba02b4fe6d22cb42e57a323003cbae62f77a740983e1355b2b520e019ae261c7 F test/walcrash.test 21038858cc552077b0522f50b0fa87e38139306a F test/walcrash2.test a0edab4e5390f03b99a790de89aad15d6ec70b36 F test/walcrash3.test e426aa58122d20f2b9fbe9a507f9eb8cab85b8af -F test/walcrash4.test e7b6e7639a950a0cca8e210e248c8dad4d63bf20 +F test/walcrash4.test 93d8825e9d0b1b183e3a73ee67e5c8fc9d86cdaf1f3a03bcc960c3aeede28001 F test/walfault.test 09b8ad7e52d2f54bce50e31aa7ea51412bb9f70ac13c74e669ddcd8b48b0d98d F test/walfault2.test e039ac66c78d5561683cacde04097213cdad3b58e2b3f3fe1112862217bfd915 F test/walhook.test ed00a40ba7255da22d6b66433ab61fab16a63483 @@ -2033,7 +2033,7 @@ F test/walro.test 78a84bc0fdae1385c06b017215c426b6845734d6a5a3ac75c918dd9b801b1b F test/walro2.test 33955a6fd874dd9724005e17f77fef89d334b3171454a1256fe4941a96766cdc F test/walrofault.test c70cb6e308c443867701856cce92ad8288cd99488fa52afab77cca6cfd51af68 F test/walseh1.test bae700eb99519b6d5cd3f893c04759accc5a59c391d4189fe4dd6995a533442b -F test/walsetlk.test aaa418dc2c11002b3e270f8128235a3bbb846796907095a0a02bf0f0bbf8512e +F test/walsetlk.test 9079cd8ef82570b8cf0067f31e049a72bec353fb2d5f0cc88f1736dc42ba9704 F test/walsetlk2.test 9097083633cdf55bf1098b694fb8651d0356d38fef28b869481d18029d7ceaf4 F test/walsetlk3.test 1b82bd92dea7e58f498b4399b0b3d26773dd8ac5c74205ce4a23c207cb8e85fe F test/walshared.test 42e3808582504878af237ea02c42ca793e8a0efaa19df7df26ac573370dbc7a3 @@ -2069,7 +2069,7 @@ F test/wherelimit.test afb46397c6d7e964e6e294ba3569864a0c570fe3807afc634236c2b75 F test/wherelimit2.test b9e4bfe7b4d7c2f85f99cf2bd2c51369378d04b1f3d1b60557423752003bfd90 F test/wherelimit3.test 22d73e046870cf8bbe15573eda6b432b07ebe64a88711f9f849c6b3667c1fae6 F test/widetab1.test c296a98e123762de79917350e45fa33fdf88577a2571eb3a64c8bf7e44ef74d1 -F test/win32heap.test 10fd891266bd00af68671e702317726375e5407561d859be1aa04696f2aeee74 +F test/win32heap.test 1ec2ce646aee491ec23bfcdfd005b33c79f13bf91467966f374a76ffe7c7e85f F test/win32lock.test 4fc496691504d90621157aa43b1155a1461347261ad182c3e3d5923f4e0b879c F test/win32longpath.test df477a2891bd6a1a4e78e43290ea219a777da85eb2590092e36da65f2fb5f1cf F test/win32nolock.test 95854dc0206b8a95e4aee15a76acc082767b38f079b2e24676aed6cbb0f32798 @@ -2111,11 +2111,11 @@ F test/without_rowid5.test f14298eb5ac8013894b75141c3f4f5f325a6ad0eded55516eef72 F test/without_rowid6.test efbd7add62c59bf5ca97bf8da674e734e6a70ef979234e816166824b4d258f68 F test/without_rowid7.test d7c59a93d726b55812d620f8f284e01904a5b85f9ee9eea8f2f68571a5e8c40e F test/wordcount.c d721a4b6fae93e6e33449700bce1686bc23257c27425bc3ef1599dc912adec66 -F test/writecrash.test f1da7f7adfe8d7f09ea79b42e5ca6dcc41102f27f8e334ad71539501ddd910cc +F test/writecrash.test 13520af28f376bfc8c0bcd130efc1fff20bb165198e8b94cf153f1f754154bb9 F test/zeroblob.test 7b74cefc7b281dfa2b07cd237987fbe94b4a2037a7771e9e83f2d5f608b1d99e F test/zeroblobfault.test 861d8191a0d944dfebb3cb4d2c5b4e46a5a119eaec5a63dd996c2389f8063441 F test/zerodamage.test 9c41628db7e8d9e8a0181e59ea5f189df311a9f6ce99cc376dc461f66db6f8dc -F test/zipfile.test a36327c5697a03150a313ba06ab45842facef8b0c21be19d73a3a4fee58bc54c +F test/zipfile.test c8a7736312c8eb32ee2808121ca22d885a8724d8df4a23d312ddefddadc7f322 F test/zipfile2.test 6df5f5ef9d247756f7200066f43e7f3f52cffff47f0c02cbefe4ce9c3284cb10 F test/zipfilefault.test 44d4d7a7f7cca7521d569d7f71026b241d65a6b1757aa409c1a168827edbbc2c F tool/GetFile.cs 47852aa0d806fe47ed1ac5138bdce7f000fe87aaa7f28107d0cb1e26682aeb44 @@ -2123,7 +2123,7 @@ F tool/GetTclKit.bat d84033c6a93dfe735d247f48ba00292a1cc284dcf69963e5e672444e045 F tool/Replace.cs 02c67258801c2fb5f63231e0ac0f220b4b36ba91 F tool/build-all-msvc.bat 1960a7a3e5d8176c4329e31476f6e3dfa9543675355fa9020a569f4452628458 x F tool/build-shell.sh 369c4b171cc877ad974fef691e4da782b4c1e99fe8f4361316c735f64d49280f -F tool/buildtclext.tcl 11087f26ba6893b0dab4f1df2d5fa9a62ce60523d8955f83c3c5a06e0ef2e65e +F tool/buildtclext.tcl 85d1bcd5410d0a4c739e2d013106f03674d082cc4d573bcc57a68546b6db67cd F tool/cg_anno.tcl c1f875f5a4c9caca3d59937b16aff716f8b1883935f1b4c9ae23124705bc8099 x F tool/checkSpacing.c 810e51703529a204fc4e1eb060e9ab663e3c06d2 F tool/cktclsh.sh 6075eef9c6b9ba4b38fef2ca2a66d25f2311bd3c610498d18a9b01f861629cca @@ -2165,7 +2165,7 @@ F tool/mkshellc.tcl 9ce74de0fa904a2c56a96f8d8b5261246bacb0eaa8d7e184f9e18ff94145 F tool/mksourceid.c 36aa8020014aed0836fd13c51d6dc9219b0df1761d6b5f58ff5b616211b079b9 F tool/mkspeedsql.tcl a1a334d288f7adfe6e996f2e712becf076745c97 F tool/mksqlite3c-noext.tcl 351c55256213154cabb051a3c870ef9f4487de905015141ae50dc7578a901b84 -F tool/mksqlite3c.tcl ba13086555b3cb835eba5e47a9250300ab85304d23fd1081abd3f29d8ab71a2b +F tool/mksqlite3c.tcl f11b63445c4840509248bd4aa151a81aea25d5415fef71943c8d436eba4f3b3c F tool/mksqlite3h.tcl 989948c6a26e188e673d7c2f2f093ea3acd816ad6ac65bab596280075c8f3a45 F tool/mksqlite3internalh.tcl 46ef6ed6ccd3c36e23051109dd25085d8edef3887635cea25afa81c4adf4d4db F tool/mksrczip.tcl 81efd9974dbb36005383f2cd655520057a2ae5aa85ac2441a80c7c28f803ac52 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P a8328b921c5504eceacade417e16e713999eff63978caf3418fd79501590b1cb 2345094e879c5538bfea005785ce0848e6d565a49bcb48b323c258d00ccbe9b8 -R cbf5c3bd266729f6200f5b597285d129 +P b36adadfa202fb8951149561471c3e01085d31e1837c99806f308f234cd24a8e +R 87363f71f72b250581db8a9b120ecc74 U jan.nijtmans -Z 90750b6144fd74824d9a8b0a82132288 +Z 4377057af14450d647f3a3daa5be55b0 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index d150f0a17d..d61a4b759a 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -b36adadfa202fb8951149561471c3e01085d31e1837c99806f308f234cd24a8e +f96a5346e3e890adfdc94a682688c2c15893e50fbaf2a26e5ef39cda8b331ee4 diff --git a/test/all.test b/test/all.test index 46e8115fba..22d7b8daed 100644 --- a/test/all.test +++ b/test/all.test @@ -42,7 +42,7 @@ run_test_suite pcache100 run_test_suite prepare run_test_suite mmap -if {$::tcl_platform(platform)=="unix"} { +if {$::tcl_platform(platform) eq "unix"} { ifcapable !default_autovacuum { run_test_suite autovacuum_crash } diff --git a/test/analyzer1.test b/test/analyzer1.test index a9239d61e1..1f0b0f6376 100644 --- a/test/analyzer1.test +++ b/test/analyzer1.test @@ -19,7 +19,7 @@ ifcapable !vtab { return } -if {$tcl_platform(os)=="Windows NT"} { +if {$tcl_platform(platform) eq "windows"} { set PROG "sqlite3_analyzer.exe" } else { set PROG "./sqlite3_analyzer" diff --git a/test/attach.test b/test/attach.test index 557201d654..3445c43fa7 100644 --- a/test/attach.test +++ b/test/attach.test @@ -759,7 +759,7 @@ do_test attach-6.1 { ATTACH DATABASE 'no-such-file' AS nosuch; } } {0 {}} -if {$tcl_platform(platform)=="unix"} { +if {$tcl_platform(platform) eq "unix"} { do_test attach-6.2 { sqlite3 dbx cannot-read dbx eval {CREATE TABLE t1(a,b,c)} diff --git a/test/avtrans.test b/test/avtrans.test index 6fc4a3e393..b483c71a44 100644 --- a/test/avtrans.test +++ b/test/avtrans.test @@ -903,7 +903,7 @@ for {set i 2} {$i<=$limit} {incr i} { INSERT INTO t3 SELECT randstr(10,400) FROM t3 WHERE random()%10==0; } } {} - if {$tcl_platform(platform)=="unix"} { + if {$tcl_platform(platform) eq "unix"} { do_test avtrans-9.$i.4-$cnt { expr {$sqlite_sync_count>0} } 1 diff --git a/test/chunksize.test b/test/chunksize.test index 47d118d841..be3795fc5c 100644 --- a/test/chunksize.test +++ b/test/chunksize.test @@ -14,7 +14,7 @@ set testdir [file dirname $argv0] source $testdir/tester.tcl set testprefix chunksize -if {$::tcl_platform(platform)!="unix"} { +if {$::tcl_platform(platform) ne "unix"} { finish_test return } diff --git a/test/filectrl.test b/test/filectrl.test index fee29e0442..9b1a1c7589 100644 --- a/test/filectrl.test +++ b/test/filectrl.test @@ -47,7 +47,7 @@ db close forcedelete .test_control_lockproxy.db-conch test.proxy forcedelete test.db test2.db -if {$tcl_platform(platform)=="windows"} { +if {$tcl_platform(platform) eq "windows"} { do_test filectrl-2.1 { sqlite3 db test2.db set size [file size test2.db] diff --git a/test/io.test b/test/io.test index 0024fefd65..1dc84bdee0 100644 --- a/test/io.test +++ b/test/io.test @@ -465,7 +465,7 @@ do_test io-4.2.1 { execsql { INSERT INTO abc VALUES('c', 'd') } file exists test.db-journal } {1} -if {$::tcl_platform(platform)=="unix"} { +if {$::tcl_platform(platform) eq "unix"} { do_test io-4.2.2 { hexio_read test.db-journal 8 4 } {FFFFFFFF} diff --git a/test/ioerr.test b/test/ioerr.test index fb54d8b384..c76c9c1e6f 100644 --- a/test/ioerr.test +++ b/test/ioerr.test @@ -172,7 +172,7 @@ ifcapable crashtest&&attach { # These tests can't be run on windows because the windows version of # SQLite holds a mandatory exclusive lock on journal files it has open. # -if {$tcl_platform(platform)!="windows" && ![atomic_batch_write test.db]} { +if {$tcl_platform(platform) ne"windows" && ![atomic_batch_write test.db]} { do_ioerr_test ioerr-7 -tclprep { db close sqlite3 db2 test2.db @@ -211,7 +211,7 @@ do_ioerr_test ioerr-8 -ckrefcount true -tclprep { # For test coverage: Cause an IO error whilst reading the master-journal # name from a journal file. -if {$tcl_platform(platform)=="unix" && [atomic_batch_write test.db]==0} { +if {$tcl_platform(platform) eq "unix" && [atomic_batch_write test.db]==0} { do_ioerr_test ioerr-9 -ckrefcount true -tclprep { execsql { CREATE TABLE t1(a,b,c); diff --git a/test/journal1.test b/test/journal1.test index bcbafe30f6..56c862f055 100644 --- a/test/journal1.test +++ b/test/journal1.test @@ -25,7 +25,7 @@ source $testdir/tester.tcl # Or with atomic_batch_write systems, as journal files are # not created. # -if {$tcl_platform(platform)=="windows" +if {$tcl_platform(platform) eq "windows" || [atomic_batch_write test.db] } { finish_test diff --git a/test/lock.test b/test/lock.test index cacb6d3ff1..3f4631a623 100644 --- a/test/lock.test +++ b/test/lock.test @@ -145,7 +145,7 @@ do_test lock-1.21 { # connections, because UNIX supports reader/writer locks. Under windows, # this is not possible. # -if {$::tcl_platform(platform)=="unix"} { +if {$::tcl_platform(platform) eq "unix"} { do_test lock-1.22 { db eval {SELECT * FROM t1} qv { set r [catch {db2 eval {SELECT a FROM t1}} msg] diff --git a/test/malloc.test b/test/malloc.test index 5e82e8028b..e53bfcd192 100644 --- a/test/malloc.test +++ b/test/malloc.test @@ -329,7 +329,7 @@ ifcapable crashtest&&attach { } } -if {$tcl_platform(platform)!="windows" && [atomic_batch_write test.db]==0} { +if {$tcl_platform(platform) ne "windows" && [atomic_batch_write test.db]==0} { do_malloc_test 14 -tclprep { catch {db close} sqlite3 db2 test2.db diff --git a/test/misc7.test b/test/misc7.test index add9014b08..f4ef2d2103 100644 --- a/test/misc7.test +++ b/test/misc7.test @@ -100,7 +100,7 @@ proc do_fileopen_test {prefix sql} { execsql { CREATE TABLE abc(a PRIMARY KEY, b, c); } db close -if {$tcl_platform(platform)!="windows"} { +if {$tcl_platform(platform) ne "windows"} { do_fileopen_test misc7-6.1 { BEGIN; INSERT INTO abc VALUES(1, 2, 3); @@ -390,7 +390,7 @@ do_test misc7-16.X { # These tests do not work on windows due to restrictions in the # windows file system. # -if {$tcl_platform(platform)!="windows"} { +if {$tcl_platform(platform) ne "windows"} { # Some network filesystems (ex: AFP) do not support setting read-only # permissions. Only run these tests if full unix permission setting @@ -534,7 +534,7 @@ do_test misc7-22.4 { catch { db close } forcedelete test.db -if {$::tcl_platform(platform)=="unix" +if {$::tcl_platform(platform) eq "unix" && [atomic_batch_write test.db]==0 } { reset_db diff --git a/test/nockpt.test b/test/nockpt.test index 84b2953e67..f5d11732be 100644 --- a/test/nockpt.test +++ b/test/nockpt.test @@ -61,7 +61,7 @@ do_test 1.14 { sqlite3_db_config db NO_CKPT_ON_CLOSE 1 } {1} do_execsql_test 1.14 { PRAGMA main.journal_mode = delete } {delete} do_test 1.15 { file exists test.db-wal } {0} -if {$::tcl_platform(platform)!="windows"} { +if {$::tcl_platform(platform) ne "windows"} { #------------------------------------------------------------------------- # Test an unusual scenario: # diff --git a/test/pager1.test b/test/pager1.test index 91a32c2c64..9a39e6f374 100644 --- a/test/pager1.test +++ b/test/pager1.test @@ -567,7 +567,7 @@ foreach {tn1 tcl} { # make sure SQLite doesn't get confused by this. # set nPadding [expr 511 - $::mj_filename_length] - if {$tcl_platform(platform)=="windows"} { + if {$tcl_platform(platform) eq "windows"} { # TBD need to figure out how to do this correctly for Windows!!! set nPadding [expr 255 - $::mj_filename_length] } diff --git a/test/permutations.test b/test/permutations.test index 5bbef184c7..87a14ef661 100644 --- a/test/permutations.test +++ b/test/permutations.test @@ -104,7 +104,7 @@ foreach f [glob -nocomplain $testdir/../ext/session/*.test] { } unset f -if {$::tcl_platform(platform)!="unix"} { +if {$::tcl_platform(platform) ne "unix"} { set alltests [test_set $alltests -exclude crash.test crash2.test] } set alltests [test_set $alltests -exclude { diff --git a/test/pragma.test b/test/pragma.test index e823a67630..5249cc7c41 100644 --- a/test/pragma.test +++ b/test/pragma.test @@ -1823,7 +1823,7 @@ do_test pragma-19.5 { file tail [lindex [execsql {PRAGMA filename}] 0] } {test.db} -if {$tcl_platform(platform)=="windows"} { +if {$tcl_platform(platform) eq "windows"} { # Test data_store_directory pragma # db close diff --git a/test/quota.test b/test/quota.test index 5d0bda3ad3..f49600043e 100644 --- a/test/quota.test +++ b/test/quota.test @@ -216,7 +216,7 @@ do_test quota-3.2.9 { set ::quota [list] proc quota_callback {file limitvar size} { upvar $limitvar limit - if {$::tcl_platform(platform)=="windows"} { + if {$::tcl_platform(platform) eq "windows"} { set file [ lindex [string map {\\ \/} $file] 0 ] } lappend ::quota $file $size @@ -351,7 +351,7 @@ do_test quota-4.3.1 { } {} unset -nocomplain quotagroup -if {$tcl_platform(platform)=="windows"} { +if {$tcl_platform(platform) eq "windows"} { set quotagroup *\\quota-test-A?.db } else { set quotagroup */quota-test-A?.db @@ -402,7 +402,7 @@ do_test quota-4.4.7 { } [expr {[file size quota-test-A1.db]+[file size quota-test-A2.db]}] unset -nocomplain quotagroup -if {$tcl_platform(platform)=="windows"} { +if {$tcl_platform(platform) eq "windows"} { set quotagroup *\\quota-test-B* } else { set quotagroup */quota-test-B* diff --git a/test/readonly.test b/test/readonly.test index 303300e6f1..00392266eb 100644 --- a/test/readonly.test +++ b/test/readonly.test @@ -15,7 +15,7 @@ set testdir [file dirname $argv0] source $testdir/tester.tcl -if {$tcl_platform(platform)=="windows"} { +if {$tcl_platform(platform) eq "windows"} { finish_test return } diff --git a/test/shared.test b/test/shared.test index 146830e56a..42292ab40f 100644 --- a/test/shared.test +++ b/test/shared.test @@ -161,7 +161,7 @@ do_test shared-$av.1.8 { do_test shared-$av.2.1 { # Open connection db3 to the database. - if {$::tcl_platform(platform)=="unix"} { + if {$::tcl_platform(platform) eq "unix"} { sqlite3 db3 "file:test.db?cache=private" -uri 1 } else { sqlite3 db3 TEST.DB @@ -797,7 +797,7 @@ do_test shared-$av.10.2 { do_test shared-$av.10.3 { # An external connection should be able to read the database, but not # prepare a write operation. - if {$::tcl_platform(platform)=="unix"} { + if {$::tcl_platform(platform) eq "unix"} { sqlite3 db3 "file:test.db?cache=private" -uri 1 } else { sqlite3 db3 TEST.DB diff --git a/test/shared3.test b/test/shared3.test index e313069990..2e32398cac 100644 --- a/test/shared3.test +++ b/test/shared3.test @@ -70,7 +70,7 @@ do_test shared3-2.5 { # test case shared3-2.3 above). The goal of the following tests is to # ensure that the cache-size really is 10 pages. # -#if {$::tcl_platform(platform)=="unix"} { +#if {$::tcl_platform(platform) eq "unix"} { # set alternative_name ./test.db #} else { # set alternative_name TEST.DB diff --git a/test/shell3.test b/test/shell3.test index ef3ea784ff..6bb49f5c3d 100644 --- a/test/shell3.test +++ b/test/shell3.test @@ -36,7 +36,7 @@ sqlite3 db test.db # different. This causes problems for the tests below. To avoid # issues, these tests are disabled for windows. # -if {$::tcl_platform(platform)=="windows"} { +if {$::tcl_platform(platform) eq "windows"} { finish_test return } diff --git a/test/shell8.test b/test/shell8.test index ca37598e93..e555396365 100644 --- a/test/shell8.test +++ b/test/shell8.test @@ -55,7 +55,7 @@ proc dir_to_list {dirname {n -1}} { set res [list] foreach f [glob -nocomplain $dirname/*] { set mtime [file mtime $f] - if {$::tcl_platform(platform)!="windows"} { + if {$::tcl_platform(platform) ne "windows"} { set perm [file attributes $f -perm] } else { set perm 0 diff --git a/test/symlink2.test b/test/symlink2.test index 9a2237e4c0..7305f6dd38 100644 --- a/test/symlink2.test +++ b/test/symlink2.test @@ -17,7 +17,7 @@ source $testdir/tester.tcl set testprefix symlink2 # This only runs on Windows. -if {$::tcl_platform(platform)!="windows"} { +if {$::tcl_platform(platform) ne "windows"} { finish_test return } diff --git a/test/uri.test b/test/uri.test index 2b388c4007..74da225acc 100644 --- a/test/uri.test +++ b/test/uri.test @@ -59,7 +59,7 @@ foreach {tn uri file} { if {[string first %00 $uri]>=0} continue } - if {$tcl_platform(platform)=="windows"} { + if {$tcl_platform(platform) eq "windows"} { # # NOTE: Due to limits on legal characters for file names imposed by # Windows, we must skip the final two tests here (i.e. the @@ -306,7 +306,7 @@ foreach {tn uri res} { 6 "file://x/PWD/test.db" {invalid uri authority: x} } { - if {$tcl_platform(platform)=="windows"} { + if {$tcl_platform(platform) eq "windows"} { set uri [string map [list PWD [string range [get_pwd] 3 end]] $uri] } else { set uri [string map [list PWD [string range [get_pwd] 1 end]] $uri] diff --git a/test/vacuum-into.test b/test/vacuum-into.test index d559b7fb39..c041ebe7a7 100644 --- a/test/vacuum-into.test +++ b/test/vacuum-into.test @@ -111,7 +111,7 @@ do_catchsql_test vacuum-into-420 { # The ability to VACUUM INTO a read-only database db close -if {$tcl_platform(platform)=="windows"} { +if {$tcl_platform(platform) eq "windows"} { file attributes test.db -readonly 1 } else { file attributes test.db -permissions 292 ;# 292 == 0444 @@ -121,7 +121,7 @@ forcedelete test.db2 do_execsql_test vacuum-into-500 { VACUUM INTO 'test.db2'; } -if {$tcl_platform(platform)=="windows"} { +if {$tcl_platform(platform) eq "windows"} { file attributes test.db -readonly 0 } else { file attributes test.db -permissions 420 ;# 420 = 0644 diff --git a/test/vtabH.test b/test/vtabH.test index cf3dcafd9a..07704cefb1 100644 --- a/test/vtabH.test +++ b/test/vtabH.test @@ -124,13 +124,13 @@ foreach ::tclvar_set_omit {0 1} { #------------------------------------------------------------------------- # -if {$tcl_platform(platform)=="windows"} { +if {$tcl_platform(platform) eq "windows"} { set drive [string range [pwd] 0 1] set ::env(fstreeDrive) $drive } reset_db register_fs_module db -if {$tcl_platform(platform)!="windows" || \ +if {$tcl_platform(platform) ne "windows" || \ [regexp -nocase -- {^[A-Z]:} $drive]} { do_execsql_test 3.0 { SELECT name FROM fsdir WHERE dir = '.' AND name = 'test.db'; diff --git a/test/walblock.test b/test/walblock.test index 23167a8830..86a52b3f96 100644 --- a/test/walblock.test +++ b/test/walblock.test @@ -17,7 +17,7 @@ source $testdir/wal_common.tcl finish_test; return; # Feature currently not implemented. ifcapable !wal {finish_test ; return } -if {$::tcl_platform(platform)!="unix"} { finish_test ; return } +if {$::tcl_platform(platform) ne "unix"} { finish_test ; return } set testprefix walblock catch { db close } diff --git a/test/walcrash4.test b/test/walcrash4.test index 80839b39e5..43292def42 100644 --- a/test/walcrash4.test +++ b/test/walcrash4.test @@ -38,7 +38,7 @@ faultsim_save_and_close # The error message is different on unix and windows # -if {$::tcl_platform(platform)=="windows"} { +if {$::tcl_platform(platform) eq "windows"} { set msg "child killed: unknown signal" } else { set msg "child process exited abnormally" diff --git a/test/walsetlk.test b/test/walsetlk.test index b65eb9ab68..969bcaf465 100644 --- a/test/walsetlk.test +++ b/test/walsetlk.test @@ -204,10 +204,10 @@ do_multiclient_test tn { # set bSleep 1 if {$::sqlite_options(setlk_timeout)==1} { - if {$::tcl_platform(platform)=="windows"} { + if {$::tcl_platform(platform) eq "windows"} { set bSleep 0 } - if {$::tcl_platform(platform)=="unix"} { + if {$::tcl_platform(platform) eq "unix"} { set bSleep [expr $tn==2] } } @@ -252,7 +252,7 @@ do_test 3.1b { # Set bExpect to true if calls to xSleep() are expected. Such calls are # expected unless this is an SQLITE_ENABLE_SETLK_TIMEOUT=1 build. set bExpect 1 -if {$tcl_platform(platform)=="windows" && $::sqlite_options(setlk_timeout)==1} { +if {$tcl_platform(platform) eq "windows" && $::sqlite_options(setlk_timeout)==1} { set bExpect 0 } do_test 3.2 { diff --git a/test/win32heap.test b/test/win32heap.test index 82a3f6b663..b62126b772 100644 --- a/test/win32heap.test +++ b/test/win32heap.test @@ -12,7 +12,7 @@ # focus of this script is the Win32 heap implementation. # -if {$tcl_platform(platform)!="windows"} return +if {$tcl_platform(platform) ne "windows"} return set testdir [file dirname $argv0] source $testdir/tester.tcl diff --git a/test/writecrash.test b/test/writecrash.test index 01bc4dbb56..aca89aafb8 100644 --- a/test/writecrash.test +++ b/test/writecrash.test @@ -21,7 +21,7 @@ set testprefix writecrash do_not_use_codec -if {$tcl_platform(platform)=="windows"} { +if {$tcl_platform(platform) eq "windows"} { finish_test return } diff --git a/test/zipfile.test b/test/zipfile.test index 0f854a6768..016a20b424 100644 --- a/test/zipfile.test +++ b/test/zipfile.test @@ -45,7 +45,7 @@ if {[catch {exec unzip} msg]==0 && \ [regexp -line {^UnZip \d+\.\d+ .*? Info-ZIP\.} $msg]} { set ::UNZIP unzip proc fix_stat_mode {name mode} { - if {$::tcl_platform(platform)=="windows"} { + if {$::tcl_platform(platform) eq "windows"} { # # NOTE: Set or unset the write bits of the file permissions # based on the read-only attribute because the Win32 @@ -280,7 +280,7 @@ do_execsql_test 1.6.2 { i.txt 33188 4 zxcvb 0 } -if {$::tcl_platform(platform)=="unix"} { +if {$::tcl_platform(platform) eq "unix"} { set modes -rw-r--r-x set perms 33189 } else { @@ -407,7 +407,7 @@ if {[info exists ::UNZIP]} { do_test 2.5.1 { forcedelete dirname forcedelete dirname2 - if {$::tcl_platform(platform)=="unix"} { + if {$::tcl_platform(platform) eq "unix"} { set null /dev/null } else { set null NUL @@ -765,7 +765,7 @@ do_execsql_test 11.11 { } {b0suffix two b2suffix one} -if {$tcl_platform(platform)!="windows"} { +if {$tcl_platform(platform) ne "windows"} { do_test 12.0 { catch { file delete -force subdir } foreach {path sz} { diff --git a/tool/buildtclext.tcl b/tool/buildtclext.tcl index a3e8783cd8..8e5bef38ad 100644 --- a/tool/buildtclext.tcl +++ b/tool/buildtclext.tcl @@ -75,7 +75,7 @@ set fd [open $srcdir/VERSION] set VERSION [string trim [read $fd]] close $fd -if {$tcl_platform(platform)=="windows"} { +if {$tcl_platform(platform) eq "windows"} { # We are only able to install, uninstall, and list on Windows. # The build process is handled by the Makefile.msc, specifically # using "nmake /f Makefile.msc pkgIndex.tcl tclsqlite3.dll" @@ -154,7 +154,7 @@ if {$tcl_platform(platform)=="windows"} { if {[string length $OPTS]>1} { append LDFLAGS $OPTS } - if {$tcl_platform(os)=="Windows NT"} { + if {$tcl_platform(os) eq "Windows NT"} { set OUT cyg } else { set OUT lib diff --git a/tool/mksqlite3c.tcl b/tool/mksqlite3c.tcl index 1d0f892363..7b6f57e426 100644 --- a/tool/mksqlite3c.tcl +++ b/tool/mksqlite3c.tcl @@ -111,7 +111,7 @@ puts $out [subst \ ** separate file. This file contains only code for the core SQLite library. **}] set srcroot [file dirname [file dirname [info script]]] -if {$tcl_platform(platform)=="windows"} { +if {$tcl_platform(platform) eq "windows"} { set vsrcprog src-verify.exe } else { set vsrcprog ./src-verify From 1588d3de37aa5cbf172077780370d56fc3612a3d Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 27 Mar 2025 14:37:07 +0000 Subject: [PATCH 035/120] More ==/!= => eq/ne fixes FossilOrigin-Name: 2aa6c4fa6c9c47c7a8548ac3493bfb9ed4e4dec1b6dc4f3599a0373086b3e917 --- manifest | 18 +++++++++--------- manifest.uuid | 2 +- test/bc_common.tcl | 2 +- test/tester.tcl | 10 +++++----- test/testrunner.tcl | 8 ++++---- test/testrunner_data.tcl | 4 ++-- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/manifest b/manifest index d839c4bec1..dc72c3a63c 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C In\sTcl,\salways\suse\seq/ne\sfor\scomparing\sstrings,\snot\s==/!= -D 2025-03-27T14:32:57.504 +C More\s==/!=\s=>\seq/ne\sfixes +D 2025-03-27T14:37:07.271 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -952,7 +952,7 @@ F test/backup_malloc.test 0c9abdf74c51e7bedb66d504cd684f28d4bd4027 F test/badutf.test d5360fc31f643d37a973ab0d8b4fb85799c3169f F test/badutf2.test f310fd3b24a491b6b77bccdf14923b85d6ebcce751068c180d93a6b8ff854399 F test/basexx1.test d8a50f0744b93dca656625597bcd3499ff4b9a4ea2a82432b119b7d46e3e0c08 -F test/bc_common.tcl b5e42d80305be95697e6370e015af571e5333a1c +F test/bc_common.tcl c70b896d1d4ce72f769d2c7c1fc15b2cb07559eb2093f2736c8ca51664b29ff5 F test/bestindex1.test 856a453dff8c68b4568601eed5a8b5e20b4763af9229f3947c215729ed878db0 F test/bestindex2.test 394ff8fbf34703391247116d6a44e1c50ee7282236ee77909044573cefc37bc0 F test/bestindex3.test 34bea272b0e0f835651b16a3931dbe7ac927039be6b2e1cb617bbe1d584b492b @@ -1733,9 +1733,9 @@ F test/temptable.test d2c9b87a54147161bcd1822e30c1d1cd891e5b30 F test/temptable2.test 76821347810ecc88203e6ef0dd6897b6036ac788e9dd3e6b04fd4d1631311a16 F test/temptable3.test d11a0974e52b347e45ee54ef1923c91ed91e4637 F test/temptrigger.test 38f0ca479b1822d3117069e014daabcaacefffcc -F test/tester.tcl e7f0c903b2d9dcaa44e707db183d22a5fe17b3f9a3c05a5eed1f4cb5c8fe63bc -F test/testrunner.tcl 331e5babe5ffff8adb4be91439e698f12aed80d4b137d2f40346ac84e0b3c03f x -F test/testrunner_data.tcl 6d7e7824bb36278ea65c33f7da6dd3ca101fc7d6f7a765b807dce0aa68c52521 +F test/tester.tcl 463ae33b8bf75ac77451df19bd65e7c415c2e9891227c7c9e657d0a2d8e1074a +F test/testrunner.tcl 228732ca62ea60e97785e13528bd36627cf3c115d59364a5181ed7f85fd0031d x +F test/testrunner_data.tcl 07f2d36a6321bfd196975aca237db6bba1991032809264a1abeb62e697196d20 F test/thread001.test a0985c117eab62c0c65526e9fa5d1360dd1cac5b03bde223902763274ce21899 F test/thread002.test c24c83408e35ba5a952a3638b7ac03ccdf1ce4409289c54a050ac4c5f1de7502 F test/thread003.test ee4c9efc3b86a6a2767516a37bd64251272560a7 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P b36adadfa202fb8951149561471c3e01085d31e1837c99806f308f234cd24a8e -R 87363f71f72b250581db8a9b120ecc74 +P f96a5346e3e890adfdc94a682688c2c15893e50fbaf2a26e5ef39cda8b331ee4 +R 3a061abeb81e61c88ca5615acd1ca53a U jan.nijtmans -Z 4377057af14450d647f3a3daa5be55b0 +Z c5ae25499ec7925175f7ce3442c79e26 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index d61a4b759a..b6f6443527 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -f96a5346e3e890adfdc94a682688c2c15893e50fbaf2a26e5ef39cda8b331ee4 +2aa6c4fa6c9c47c7a8548ac3493bfb9ed4e4dec1b6dc4f3599a0373086b3e917 diff --git a/test/bc_common.tcl b/test/bc_common.tcl index c47f99681f..953ce62621 100644 --- a/test/bc_common.tcl +++ b/test/bc_common.tcl @@ -9,7 +9,7 @@ proc bc_find_binaries {zCaption} { set binaries [list] set self [info nameofexec] set pattern "$self?*" - if {$::tcl_platform(platform)=="windows"} { + if {$::tcl_platform(platform) eq "windows"} { set pattern [string map {\.exe {}} $pattern] } foreach file [glob -nocomplain $pattern] { diff --git a/test/tester.tcl b/test/tester.tcl index 444a9d8433..3fad396687 100644 --- a/test/tester.tcl +++ b/test/tester.tcl @@ -813,7 +813,7 @@ proc do_test {name cmd expected} { # on Windows because of issues with ANSI and UTF8 I/O on Win11. # proc do_test_with_ansi_output {name cmd expected} { - if {![info exists ::SLAVE] || $::tcl_platform(platform)!="windows"} { + if {![info exists ::SLAVE] || $::tcl_platform(platform) ne "windows"} { uplevel 1 [list do_test $name $cmd $expected] } } @@ -872,7 +872,7 @@ proc catchcmdex {db {cmd ""}} { proc filepath_normalize {p} { # test cases should be written to assume "unix"-like file paths - if {$::tcl_platform(platform)!="unix"} { + if {$::tcl_platform(platform) ne "unix"} { string map [list \\ / \{/ / .db\} .db] \ [regsub -nocase -all {[a-z]:[/\\]+} $p {/}] } { @@ -1832,7 +1832,7 @@ proc crashsql {args} { # error message. We map that to the expected message # so that we don't have to change all of the test # cases. - if {$::tcl_platform(platform)=="windows"} { + if {$::tcl_platform(platform) eq "windows"} { if {$msg=="child killed: unknown signal"} { set msg "child process exited abnormally" } @@ -1883,7 +1883,7 @@ proc crash_on_write {args} { # error message. We map that to the expected message # so that we don't have to change all of the test # cases. - if {$::tcl_platform(platform)=="windows"} { + if {$::tcl_platform(platform) eq "windows"} { if {$msg=="child killed: unknown signal"} { set msg "child process exited abnormally" } @@ -2532,7 +2532,7 @@ proc test_restore_config_pagecache {} { } proc test_binary_name {nm} { - if {$::tcl_platform(platform)=="windows"} { + if {$::tcl_platform(platform) eq "windows"} { set ret "$nm.exe" } else { set ret $nm diff --git a/test/testrunner.tcl b/test/testrunner.tcl index 2c7a9f891d..60c4627f92 100755 --- a/test/testrunner.tcl +++ b/test/testrunner.tcl @@ -38,7 +38,7 @@ proc find_interpreter {} { } if {$rc} { puts "Cannot find tcl package sqlite3: Trying to build it now..." - if {$::tcl_platform(platform)=="windows"} { + if {$::tcl_platform(platform) eq "windows"} { set bat [open make-tcl-extension.bat w] puts $bat "nmake /f Makefile.msc tclextension" close $bat @@ -170,7 +170,7 @@ proc guess_number_of_cores {} { if {[catch {number_of_cores} ret]} { set ret 4 - if {$::tcl_platform(platform)=="windows"} { + if {$::tcl_platform(platform) eq "windows"} { catch { set ret $::env(NUMBER_OF_PROCESSORS) } } else { if {$::tcl_platform(os)=="Darwin"} { @@ -817,7 +817,7 @@ for {set ii 0} {$ii < [llength $argv]} {incr ii} { } elseif {[string match "$a*" --stop-on-coredump]} { set TRG(stopOnCore) 1 } elseif {[string match "$a*" --status]} { - if {$tcl_platform(platform)=="windows"} { + if {$tcl_platform(platform) eq "windows"} { puts stdout \ "The --status option is not available on Windows. A suggested work-around" puts stdout \ @@ -1500,7 +1500,7 @@ proc progress_report {} { global TRG if {$TRG(fullstatus)} { - if {$::tcl_platform(platform)=="windows"} { + if {$::tcl_platform(platform) eq "windows"} { exec [info nameofexe] $::argv0 status --cls } else { show_status trdb 1 diff --git a/test/testrunner_data.tcl b/test/testrunner_data.tcl index 2597cbe478..ade126a64d 100644 --- a/test/testrunner_data.tcl +++ b/test/testrunner_data.tcl @@ -455,7 +455,7 @@ proc trd_fuzztest_data {} { set lFuzzDb [glob [file join $::testdir fuzzdata*.db]] set lSessionDb [glob [file join $::testdir sessionfuzz-data*.db]] - if {$::tcl_platform(platform)=="windows"} { + if {$::tcl_platform(platform) eq "windows"} { return [list fuzzcheck.exe $lFuzzDb] } @@ -527,7 +527,7 @@ proc make_script {cfg srcdir bMsvc} { set configOpts [list] ;# Extra args for [configure] # Define either SQLITE_OS_WIN or SQLITE_OS_UNIX, as appropriate. - if {$::tcl_platform(platform)=="windows"} { + if {$::tcl_platform(os) eq "Windows NT"} { lappend opts -DSQLITE_OS_WIN=1 } else { lappend opts -DSQLITE_OS_UNIX=1 From d07045119dc8853faf10bef1e87928b3041ae52c Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 27 Mar 2025 17:25:38 +0000 Subject: [PATCH 036/120] shell1.test: == => eq FossilOrigin-Name: 99fdd19193056259d84768f46519328c300976b102f1b1e0b815720df01b28d0 --- manifest | 12 ++++++------ manifest.uuid | 2 +- test/shell1.test | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/manifest b/manifest index dc72c3a63c..2b1b174705 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C More\s==/!=\s=>\seq/ne\sfixes -D 2025-03-27T14:37:07.271 +C shell1.test:\s==\s=>\seq +D 2025-03-27T17:25:38.922 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -1642,7 +1642,7 @@ F test/sharedA.test 64bdd21216dda2c6a3bd3475348ccdc108160f34682c97f2f51c19fc0e21 F test/sharedB.test 1a84863d7a2204e0d42f2e1606577c5e92e4473fa37ea0f5bdf829e4bf8ee707 F test/shared_err.test 32634e404a3317eeb94abc7a099c556a346fdb8fb3858dbe222a4cbb8926a939 F test/sharedlock.test 5ede3c37439067c43b0198f580fd374ebf15d304 -F test/shell1.test a00910c3d811420c15c1411106871c65678516435e352cbb013a09839bf327c6 +F test/shell1.test 1467ef88c498a1002b47028c304ad55511e5bdfed9db23d25628b2bd483e1026 F test/shell2.test ac102ebc0a9ec166257600c4ee8bdefec242163afced295f10b004f4af3fc9dd F test/shell3.test 603b448e917537cf77be0f265c05c6f63bc677c63a533c8e96aae923b56f4a0e F test/shell4.test ad7eee983b5e7f1dd92d8c87bc0f39474086bc32c980c00f3934c54aabc636a2 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P f96a5346e3e890adfdc94a682688c2c15893e50fbaf2a26e5ef39cda8b331ee4 -R 3a061abeb81e61c88ca5615acd1ca53a +P 2aa6c4fa6c9c47c7a8548ac3493bfb9ed4e4dec1b6dc4f3599a0373086b3e917 +R 781cb8e00ffc42775fc38e66407caae8 U jan.nijtmans -Z c5ae25499ec7925175f7ce3442c79e26 +Z 0fc36aed98c6f109c6b40b40ad0dda33 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index b6f6443527..86502d4768 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -2aa6c4fa6c9c47c7a8548ac3493bfb9ed4e4dec1b6dc4f3599a0373086b3e917 +99fdd19193056259d84768f46519328c300976b102f1b1e0b815720df01b28d0 diff --git a/test/shell1.test b/test/shell1.test index f89d34d536..0e674a8497 100644 --- a/test/shell1.test +++ b/test/shell1.test @@ -1064,20 +1064,20 @@ do_test shell1-5.0 { # return character (and on Windows, the end-of-file character) # cannot be used here. # - if {$i==0x0D || ($tcl_platform(platform)=="windows" && $i==0x1A)} { + if {$i==0x0D || ($tcl_platform(platform) eq "windows" && $i==0x1A)} { continue } # Tcl 8.7 maps 0x80 through 0x9f into valid UTF8. So skip those tests. if {$i>=0x80} { if {$i<=0x9F || $tcl_version>=9.0} continue - if {$tcl_platform(platform)=="windows"} continue + if {$tcl_platform(platform) eq "windows"} continue } - if {$i>=0xE0 && $tcl_platform(os)=="OpenBSD"} continue - if {$i>=0xE0 && $i<=0xEF && $tcl_platform(os)=="Linux"} continue + if {$i>=0xE0 && $tcl_platform(os) eq "OpenBSD"} continue + if {$i>=0xE0 && $i<=0xEF && $tcl_platform(os) eq "Linux"} continue set hex [format %02X $i] set char [subst \\x$hex]; set oldChar $char set escapes [list] - if {$tcl_platform(platform)=="windows"} { + if {$tcl_platform(platform) eq "windows"} { # # NOTE: On Windows, we need to escape all the whitespace characters, # the alarm (\a) character, and those with special meaning to From 1f3207a52abfd36650314e9d81dbcdb51b39a9f1 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 27 Mar 2025 17:30:49 +0000 Subject: [PATCH 037/120] Fix for forum-post [/forum/forumpost/b5fde3596c|b5fde3596c]. Also fix encoding issue for non-ASCII characters. Also includes a fix from Stephan Beal, about a missing include. FossilOrigin-Name: e60198001e12f85a5d6504ce72226dfceb8666fe5ec649237fa23ae20e8aa32d --- manifest | 17 ++++++++++------- manifest.uuid | 2 +- src/tclsqlite.c | 19 ++++++++++++------- 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/manifest b/manifest index 410f3e5513..2a6777c190 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\san\soff-by-one\sbug\sin\sthe\s".dbtotxt"\scommand\sfrom\sthe\sshell\sthat\sresults\nin\sincorrect\soutput. -D 2025-03-27T10:59:18.433 +C Fix\sfor\sforum-post\s[/forum/forumpost/b5fde3596c|b5fde3596c].\sAlso\sfix\sencoding\sissue\sfor\snon-ASCII\scharacters.\nAlso\sincludes\sa\sfix\sfrom\sStephan\sBeal,\sabout\sa\smissing\s\sinclude. +D 2025-03-27T17:30:49.432 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -793,7 +793,7 @@ F src/sqliteInt.h 96133c5b4371629b30644a88108a0ca99e6a95a55509cdfc8de9961fba4bbd F src/sqliteLimit.h 6d817c28a8f19af95e6f4921933b7fbbca48a962bce0eb0ec81e8bb3ef38e68b F src/status.c 0e72e4f6be6ccfde2488eb63210297e75f569f3ce9920f6c3d77590ec6ce5ffd F src/table.c 0f141b58a16de7e2fbe81c308379e7279f4c6b50eb08efeec5892794a0ba30d1 -F src/tclsqlite.c 254e69d6b4bc185ca2a3b186a92bda186aec9038063ebb9247b9b3181d4b4d4f +F src/tclsqlite.c 767a11d470b031e85f51b8924a0e8929b2362ff1975aee3474a10eba3c2e0d36 F src/tclsqlite.h 65e2c761446e1c9fa0342b7d2612a703483643c8b6a316d12a65b745a4727395 F src/test1.c ba7b93478a6a7a3f48ec5507f28bc662636ac5d9f9791700d3648a8e788f0bb2 F src/test2.c 7ebc518e6735939d8979273a6f7b1d9b5702babf059f6ad62499f7f60a9eb9a3 @@ -2215,8 +2215,11 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P d25c8a6222d4e3f20c137b1490572ad491d9c404ff12947d5867c3e00fcb615c -R 7f1dc2197ed34b61300fd57f99c67793 -U drh -Z 6f6d82890663e463e31bf8fc619d730c +P 2345094e879c5538bfea005785ce0848e6d565a49bcb48b323c258d00ccbe9b8 +R 4ff975de44798fc382336120e7cd3853 +T *branch * tclsqlite-db-copy-fix +T *sym-tclsqlite-db-copy-fix * +T -sym-trunk * +U jan.nijtmans +Z b45977ee1b24660b9e02a9cdf40f95f6 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index a4c3c5b00b..99163b718a 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -2345094e879c5538bfea005785ce0848e6d565a49bcb48b323c258d00ccbe9b8 +e60198001e12f85a5d6504ce72226dfceb8666fe5ec649237fa23ae20e8aa32d diff --git a/src/tclsqlite.c b/src/tclsqlite.c index c619ffca4b..7675a91254 100644 --- a/src/tclsqlite.c +++ b/src/tclsqlite.c @@ -76,7 +76,9 @@ # define SQLITE_PTRSIZE 8 # endif # endif /* SQLITE_PTRSIZE */ -# if defined(HAVE_STDINT_H) +# if defined(HAVE_STDINT_H) || (defined(__STDC_VERSION__) && \ + (__STDC_VERSION__ >= 199901L)) +# include typedef uintptr_t uptr; # elif SQLITE_PTRSIZE==4 typedef unsigned int uptr; @@ -2525,7 +2527,7 @@ static int SQLITE_TCLAPI DbObjCmd( Tcl_Channel in; /* The input file */ int lineno = 0; /* Line number of input file */ char zLineNum[80]; /* Line number print buffer */ - Tcl_DString str; + Tcl_Obj *str; Tcl_Obj *pResult; /* interp result */ const char *zSep; @@ -2609,19 +2611,22 @@ static int SQLITE_TCLAPI DbObjCmd( sqlite3_finalize(pStmt); return TCL_ERROR; } + Tcl_SetChannelOption(NULL, in, "-translation", "auto"); azCol = malloc( sizeof(azCol[0])*(nCol+1) ); if( azCol==0 ) { Tcl_AppendResult(interp, "Error: can't malloc()", (char*)0); Tcl_Close(interp, in); return TCL_ERROR; } - Tcl_DStringInit(&str); + str = Tcl_NewObj(); + Tcl_IncrRefCount(str); (void)sqlite3_exec(pDb->db, "BEGIN", 0, 0, 0); zCommit = "COMMIT"; - while( Tcl_Gets(in, &str)>=0 ) { + while( Tcl_GetsObj(in, str)>=0 ) { char *z; + Tcl_Size byteLen; lineno++; - zLine = Tcl_DStringValue(&str); + zLine = (char *)Tcl_GetByteArrayFromObj(str, &byteLen); azCol[0] = zLine; for(i=0, z=zLine; *z; z++){ if( *z==zSep[0] && strncmp(z, zSep, nSep)==0 ){ @@ -2659,14 +2664,14 @@ static int SQLITE_TCLAPI DbObjCmd( } sqlite3_step(pStmt); rc = sqlite3_reset(pStmt); - Tcl_DStringSetLength(&str, 0); + Tcl_SetObjLength(str, 0); if( rc!=SQLITE_OK ){ Tcl_AppendResult(interp,"Error: ", sqlite3_errmsg(pDb->db), (char*)0); zCommit = "ROLLBACK"; break; } } - Tcl_DStringFree(&str); + Tcl_DecrRefCount(str); free(azCol); Tcl_Close(interp, in); sqlite3_finalize(pStmt); From 460e4cb686941e0601204a0743f117c8d9c91496 Mon Sep 17 00:00:00 2001 From: drh <> Date: Thu, 27 Mar 2025 18:22:11 +0000 Subject: [PATCH 038/120] Rearrange #includes in FTS3 to avoid a harmless compiler warning. FossilOrigin-Name: c5206cee83a4f1e59bfceda35cdfa528f9b4611eaf306da863ae83e9f93cdeb7 --- ext/fts3/fts3.c | 6 ------ ext/fts3/fts3Int.h | 7 +++++++ manifest | 14 +++++++------- manifest.uuid | 2 +- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/ext/fts3/fts3.c b/ext/fts3/fts3.c index 3771aa8ba2..f178abafed 100644 --- a/ext/fts3/fts3.c +++ b/ext/fts3/fts3.c @@ -295,12 +295,6 @@ # define SQLITE_CORE 1 #endif -#include -#include -#include -#include -#include -#include #include "fts3.h" #ifndef SQLITE_CORE diff --git a/ext/fts3/fts3Int.h b/ext/fts3/fts3Int.h index a53ecdf17c..d438549de1 100644 --- a/ext/fts3/fts3Int.h +++ b/ext/fts3/fts3Int.h @@ -14,6 +14,13 @@ #ifndef _FTSINT_H #define _FTSINT_H +#include +#include +#include +#include +#include +#include + #if !defined(NDEBUG) && !defined(SQLITE_DEBUG) # define NDEBUG 1 #endif diff --git a/manifest b/manifest index 410f3e5513..b4ac8938d2 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\san\soff-by-one\sbug\sin\sthe\s".dbtotxt"\scommand\sfrom\sthe\sshell\sthat\sresults\nin\sincorrect\soutput. -D 2025-03-27T10:59:18.433 +C Rearrange\s#includes\sin\sFTS3\sto\savoid\sa\sharmless\scompiler\swarning. +D 2025-03-27T18:22:11.592 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -79,9 +79,9 @@ F ext/fts3/README.content b9078d0843a094d86af0d48dffbff13c906702b4c3558012e67b9c F ext/fts3/README.syntax b72477722e9b4fe43f8403227d790a1c94221bfad15c27863a4b36d1052e892b F ext/fts3/README.tokenizers b92bdeb8b46503f0dd301d364efc5ef59ef9fa8e2758b8e742f39fa93a2e422d F ext/fts3/README.txt 8c18f41574404623b76917b9da66fcb0ab38328d -F ext/fts3/fts3.c fd2a8642fa4701ef5dd6bce7947ecb3c7ae472e1d44022772454a8b74a13155d +F ext/fts3/fts3.c 4f02858ab845a97bedf06e6cc1fba49a81fe5e00a26df68d0ad0f00a5814fa70 F ext/fts3/fts3.h 3a10a0af180d502cecc50df77b1b22df142817fe -F ext/fts3/fts3Int.h ad51347fa5a5a49f6c3bd40a961eafd08f1e410f60b64dea06f115697a2ad9fe +F ext/fts3/fts3Int.h 53f00a0d037c81174af1089ad7776563dcbccb5ed4697405256d3d4260d9fccc F ext/fts3/fts3_aux.c 7eab82a9cf0830f6551ba3abfdbe73ed39e322a4d3940ee82fbf723674ecd9f3 F ext/fts3/fts3_expr.c 5c13796638d8192c388777166075cdc8bc4b6712024cd5b72c31acdbefce5984 F ext/fts3/fts3_hash.c d9dba473741445789330c7513d4f65737c92df23c3212784312931641814672a @@ -2215,8 +2215,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P d25c8a6222d4e3f20c137b1490572ad491d9c404ff12947d5867c3e00fcb615c -R 7f1dc2197ed34b61300fd57f99c67793 +P 2345094e879c5538bfea005785ce0848e6d565a49bcb48b323c258d00ccbe9b8 +R ccf07cdc083a3826c0a733863a0e36ee U drh -Z 6f6d82890663e463e31bf8fc619d730c +Z d89839ab3f248b73bf98271a00e9f15f # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index a4c3c5b00b..13c9ddf1b0 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -2345094e879c5538bfea005785ce0848e6d565a49bcb48b323c258d00ccbe9b8 +c5206cee83a4f1e59bfceda35cdfa528f9b4611eaf306da863ae83e9f93cdeb7 From 5ee946f90765f25737b0926ad9d24476c6f03273 Mon Sep 17 00:00:00 2001 From: stephan Date: Thu, 27 Mar 2025 18:42:51 +0000 Subject: [PATCH 039/120] Add an explicit db close to fix a file-is-opened failure in session1.test in cygwin. FossilOrigin-Name: c6e4e1cf2b70d2e603ea3faabd9cb5fbd9f5497672574283ace8c62984dfbb97 --- ext/session/session1.test | 2 +- manifest | 14 +++++++------- manifest.uuid | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) mode change 100644 => 100755 ext/session/session1.test diff --git a/ext/session/session1.test b/ext/session/session1.test old mode 100644 new mode 100755 index 27ac0a194b..b9e5ff8a20 --- a/ext/session/session1.test +++ b/ext/session/session1.test @@ -800,8 +800,8 @@ do_test $tn.15.3 { } } {1 data 1 {} {} First 2 data 2 {} {} Second} +db2 close }] } - finish_test diff --git a/manifest b/manifest index 2b1b174705..837497bcdf 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C shell1.test:\s==\s=>\seq -D 2025-03-27T17:25:38.922 +C Add\san\sexplicit\sdb\sclose\sto\sfix\sa\sfile-is-opened\sfailure\sin\ssession1.test\sin\scygwin. +D 2025-03-27T18:42:51.747 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -578,7 +578,7 @@ F ext/rtree/visual01.txt e9c2564083bcd30ec51b07f881bffbf0e12b50a3f6fced0c222c5c1 F ext/session/changeset.c 7a1e6a14c7e92d36ca177e92e88b5281acd709f3b726298dc34ec0fb58869cb5 F ext/session/changesetfuzz.c 227076ab0ae4447d742c01ee88a564da6478bbf26b65108bf8fac9cd8b0b24aa F ext/session/changesetfuzz1.test 15b629004e58d5ffcc852e6842a603775bb64b1ce51254831f3d12b113b616cd -F ext/session/session1.test 57cb77a816af7760bf4e321d315603ab517e46abd853e75620cfb07eb409c6f8 +F ext/session/session1.test 5d2502922d38a1579076863827342379a1609ca6bae78c40691a2be1ed1be2aa x F ext/session/session2.test ee83bb973b9ce17ccce4db931cdcdae65eb40bbb22089b2fe6aa4f6be3b9303f F ext/session/session3.test 2cc1629cfb880243aec1a7251145e07b78411d851b39b2aa1390704550db8e6a F ext/session/session4.test 823f6f018fcbb8dacf61e2960f8b3b848d492b094f8b495eae1d9407d9ab7219 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 2aa6c4fa6c9c47c7a8548ac3493bfb9ed4e4dec1b6dc4f3599a0373086b3e917 -R 781cb8e00ffc42775fc38e66407caae8 -U jan.nijtmans -Z 0fc36aed98c6f109c6b40b40ad0dda33 +P 99fdd19193056259d84768f46519328c300976b102f1b1e0b815720df01b28d0 +R 0e7cf04d0b98fc57a6a54399d55f0abd +U stephan +Z 8501b14f4f0f61714b2ced1b79f0fe62 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 86502d4768..44ff91e1ef 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -99fdd19193056259d84768f46519328c300976b102f1b1e0b815720df01b28d0 +c6e4e1cf2b70d2e603ea3faabd9cb5fbd9f5497672574283ace8c62984dfbb97 From 13a9fb0d212b1e9058a387934335f7bd8cb27c90 Mon Sep 17 00:00:00 2001 From: stephan Date: Fri, 28 Mar 2025 14:32:01 +0000 Subject: [PATCH 040/120] Configure/make doc tweaks. No functional changes. FossilOrigin-Name: dbcc03bd7a727f4643f18a814bb9fd9071c0355f98dd064286240f2af361ee7f --- autoconf/Makefile.in | 2 ++ autosetup/sqlite-config.tcl | 9 +++++---- main.mk | 4 +++- manifest | 18 +++++++++--------- manifest.uuid | 2 +- 5 files changed, 20 insertions(+), 15 deletions(-) diff --git a/autoconf/Makefile.in b/autoconf/Makefile.in index 009398617c..c4e91baa2d 100644 --- a/autoconf/Makefile.in +++ b/autoconf/Makefile.in @@ -193,6 +193,8 @@ install-dll-unix-generic: install-dll-out-implib install-dll-msys: install-dll-out-implib $(install-dir.bin) $(INSTALL) $(libsqlite3.DLL) "$(install-dir.bin)" # ----------------------------------------------^^^ yes, bin +# Each of {msys,mingw,cygwin} uses a different name for the DLL, but +# that is already accounted for via $(libsqlite3.DLL). install-dll-mingw: install-dll-msys install-dll-cygwin: install-dll-msys diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl index 67895a2434..ec08cc95c0 100644 --- a/autosetup/sqlite-config.tcl +++ b/autosetup/sqlite-config.tcl @@ -1468,14 +1468,15 @@ proc sqlite-handle-dll-basename {} { # [define]s LDFLAGS_OUT_IMPLIB to either an empty string or to a # -Wl,... flag for the platform-specific --out-implib flag, which is # used for building an "import library .dll.a" file on some platforms -# (e.g. msys2, mingw). Returns 1 if supported, else 0. +# (e.g. msys2, mingw). SQLITE_OUT_IMPLIB is defined to the name of the +# import lib or an empty string. Returns 1 if supported, else 0. # # The name of the import library is [define]d in SQLITE_OUT_IMPLIB. # # If the configure flag --out-implib is not used (or programmatically -# set) then this is a no-op (but see [sqlite-handle-env-quirks]). If -# that flag is used but the capability is not available, a fatal error -# is triggered. +# set) then this simply sets the above-listed defines to empty strings +# (but see [sqlite-handle-env-quirks]). If that flag is used but the +# capability is not available, a fatal error is triggered. # # This feature is specifically opt-in because it's supported on far # more platforms than actually need it and enabling it causes creation diff --git a/main.mk b/main.mk index bcdfbd8638..308a8c1079 100644 --- a/main.mk +++ b/main.mk @@ -1481,7 +1481,7 @@ all: so # The link named libsqlite3.so.0 is provided in an attempt to reduce # downstream disruption when performing upgrades from pre-3.48 to a # version 3.48 or higher. That name is considered a legacy remnant -# and will eventually be removed from this installation process. +# and may eventually be removed from this installation process. # # Historically libtool installed the library like so: # @@ -1542,6 +1542,8 @@ install-dll-unix-generic: install-dll-out-implib install-dll-msys: install-dll-out-implib $(install-dir.bin) $(INSTALL) $(libsqlite3.DLL) "$(install-dir.bin)" # ----------------------------------------------^^^ yes, bin +# Each of {msys,mingw,cygwin} uses a different name for the DLL, but +# that is already accounted for via $(libsqlite3.DLL). install-dll-mingw: install-dll-msys install-dll-cygwin: install-dll-msys diff --git a/manifest b/manifest index f1922909d9..60ff7cf960 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Merge\scygwin\sand\stclsqlite\sfixes\sinto\strunk. -D 2025-03-27T23:29:25.564 +C Configure/make\sdoc\stweaks.\sNo\sfunctional\schanges. +D 2025-03-28T14:32:01.403 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -17,7 +17,7 @@ F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2 F art/sqlite370.svg 40b7e2fe8aac3add5d56dd86ab8d427a4eca5bcb3fe4f8946cb3794e1821d531 F auto.def f769bf3111089ee9471a2a872c47651c4e29e81d104a52867ab544fde5ef6bad F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac -F autoconf/Makefile.in 1fe497c0df20102f7824ec8a3423cc13c26505655456ecd06a7a8ab02f606586 +F autoconf/Makefile.in 66d98d473556c4e2daf7252355f4b5db129091800027f280082804eb4c45784f F autoconf/Makefile.msc 5bc67d3912444c40c6f96d003e5c90663e51abb83d204a520110b1b2038dcd8b F autoconf/README.first f1d3876e9a7852c22f275a6f06814e64934cecbc0b5b9617d64849094c1fd136 F autoconf/README.txt 1a32296d8bbdd67110c79d224c92c05545a0b5bd0c272950025fe3c7c7b49580 @@ -52,7 +52,7 @@ F autosetup/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1 F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba F autosetup/proj.tcl cac07d75249fa127500b8e96080dc807e9ae97fe98d29e84a17bc28f4628e93f -F autosetup/sqlite-config.tcl 85490e59fb374cf091765308eae96bb96cc85169af46d78e034f3766bdbd0523 +F autosetup/sqlite-config.tcl 27f5baf08a8d7d968b55b613d87fdab7804fa2006b3e4fe7b2483793ee662e20 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x F contrib/sqlitecon.tcl eb4c6578e08dd353263958da0dc620f8400b869a50d06e271ab0be85a51a08d3 @@ -709,7 +709,7 @@ F ext/wasm/tests/opfs/sahpool/sahpool-pausing.js f264925cfc82155de38cecb3d204c36 F ext/wasm/tests/opfs/sahpool/sahpool-worker.js bd25a43fc2ab2d1bafd8f2854ad3943ef673f7c3be03e95ecf1612ff6e8e2a61 F ext/wasm/wasmfs.make 68999f5bd8c489239592d59a420f8c627c99169bbd6fa16a404751f757b9f702 F magic.txt 5ade0bc977aa135e79e3faaea894d5671b26107cc91e70783aa7dc83f22f3ba0 -F main.mk a8930b3338afa3065f89735c6e5f9a9d64d90bd3154fe4580696502a7c2a99ad +F main.mk d8badf4236a5f134304e02706a35cee155ad0fb11d850ae7c891146d9b48132f F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271 F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504 F mptest/crash01.test 61e61469e257df0850df4293d7d4d6c2af301421 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P c5206cee83a4f1e59bfceda35cdfa528f9b4611eaf306da863ae83e9f93cdeb7 c6e4e1cf2b70d2e603ea3faabd9cb5fbd9f5497672574283ace8c62984dfbb97 e60198001e12f85a5d6504ce72226dfceb8666fe5ec649237fa23ae20e8aa32d -R d6dc8c3c7bf9724429b6bef84640ccd0 -U drh -Z 9fba388b00eb19a7b9fc8b81e9cc02c7 +P 121f4d97f9a855131859d342bc2ade5f8c34ba7732029ae156d02cec7cb6dd85 +R 316f6c20de78edd89bb6149a00675932 +U stephan +Z 912d6d89057979bf1659ce4d8c2a2bd3 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 583806bacb..792af4ff5e 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -121f4d97f9a855131859d342bc2ade5f8c34ba7732029ae156d02cec7cb6dd85 +dbcc03bd7a727f4643f18a814bb9fd9071c0355f98dd064286240f2af361ee7f From cd1cbd641c1423d1cc19307d8ca5d2d62f22288f Mon Sep 17 00:00:00 2001 From: stephan Date: Fri, 28 Mar 2025 15:36:49 +0000 Subject: [PATCH 041/120] CLI shell: make (.output off) an alias for (.output /dev/null) or (.output nul), depending on the platform. Discussed in [forum:633979ce307f1cc6|forum post 633979ce307f1cc6]. FossilOrigin-Name: 0f11087b84753576425823e10a7eeff45af02f3c0135dee72dec5019c8127500 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/shell.c.in | 11 ++++++++++- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index 60ff7cf960..c21a71bcb8 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Configure/make\sdoc\stweaks.\sNo\sfunctional\schanges. -D 2025-03-28T14:32:01.403 +C CLI\sshell:\smake\s(.output\soff)\san\salias\sfor\s(.output\s/dev/null)\sor\s(.output\snul),\sdepending\son\sthe\splatform.\sDiscussed\sin\s[forum:633979ce307f1cc6|forum\spost\s633979ce307f1cc6]. +D 2025-03-28T15:36:49.069 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -786,7 +786,7 @@ F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c F src/resolve.c 20e1fbe8f840ffc0cd835e33f68a802a22e34faa918d7a269f3de242fda02f99 F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97 F src/select.c bfe14cdfceba54744b1c6c29099313f5173a0793dfaff0cd484774e9d05dbeab -F src/shell.c.in 5acad3e594edad8de9f3e7f9a5ee8acfe934497ed642d29dc8fdd6665e25fdbf +F src/shell.c.in 213e2fd53d845432e47c0810eafa8eb66dd5295ae27f0313779c73df32d62fee F src/sqlite.h.in fd70afd92948cf7cc93f687ac960bad1b0b6fbc436752419eff2fd65a1809380 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h 3f046c04ea3595d6bfda99b781926b17e672fd6d27da2ba6d8d8fc39981dcb54 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 121f4d97f9a855131859d342bc2ade5f8c34ba7732029ae156d02cec7cb6dd85 -R 316f6c20de78edd89bb6149a00675932 +P dbcc03bd7a727f4643f18a814bb9fd9071c0355f98dd064286240f2af361ee7f +R fd12f331319e6fbbfa3b284204829987 U stephan -Z 912d6d89057979bf1659ce4d8c2a2bd3 +Z 41a98a24cb0e972787f7e1497beff5d6 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 792af4ff5e..c83cc1ec78 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -dbcc03bd7a727f4643f18a814bb9fd9071c0355f98dd064286240f2af361ee7f +0f11087b84753576425823e10a7eeff45af02f3c0135dee72dec5019c8127500 diff --git a/src/shell.c.in b/src/shell.c.in index 4efcfee953..76874e7f72 100644 --- a/src/shell.c.in +++ b/src/shell.c.in @@ -5238,6 +5238,7 @@ static const char *(azHelp[]) = { #ifndef SQLITE_SHELL_FIDDLE ".output ?FILE? Send output to FILE or stdout if FILE is omitted", " If FILE begins with '|' then open it as a pipe.", + " If FILE is 'off' then output is disabled.", " Options:", " --bom Prefix output with a UTF8 byte-order mark", " -e Send output to the system text editor", @@ -10271,7 +10272,15 @@ static int do_meta_command(char *zLine, ShellState *p){ goto meta_command_exit; } }else if( zFile==0 && eMode==0 ){ - zFile = sqlite3_mprintf("%s", z); + if( cli_strcmp(z, "off")==0 ){ +#ifdef _WIN32 + zFile = sqlite3_mprintf("nul"); +#else + zFile = sqlite3_mprintf("/dev/null"); +#endif + }else{ + zFile = sqlite3_mprintf("%s", z); + } if( zFile && zFile[0]=='|' ){ while( i+1 Date: Fri, 28 Mar 2025 16:31:54 +0000 Subject: [PATCH 042/120] Correct two tests in shell1.test which were broken by the addition of new output in [0f11087b8475]. FossilOrigin-Name: 909dd0a02a967baef46c3efdca42a0ab4e15003e34ce7e9af82fce5f17213d7b --- manifest | 12 ++++++------ manifest.uuid | 2 +- test/shell1.test | 2 ++ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/manifest b/manifest index c21a71bcb8..0254997dac 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C CLI\sshell:\smake\s(.output\soff)\san\salias\sfor\s(.output\s/dev/null)\sor\s(.output\snul),\sdepending\son\sthe\splatform.\sDiscussed\sin\s[forum:633979ce307f1cc6|forum\spost\s633979ce307f1cc6]. -D 2025-03-28T15:36:49.069 +C Correct\stwo\stests\sin\sshell1.test\swhich\swere\sbroken\sby\sthe\saddition\sof\snew\soutput\sin\s[0f11087b8475]. +D 2025-03-28T16:31:54.289 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -1642,7 +1642,7 @@ F test/sharedA.test 64bdd21216dda2c6a3bd3475348ccdc108160f34682c97f2f51c19fc0e21 F test/sharedB.test 1a84863d7a2204e0d42f2e1606577c5e92e4473fa37ea0f5bdf829e4bf8ee707 F test/shared_err.test 32634e404a3317eeb94abc7a099c556a346fdb8fb3858dbe222a4cbb8926a939 F test/sharedlock.test 5ede3c37439067c43b0198f580fd374ebf15d304 -F test/shell1.test 1467ef88c498a1002b47028c304ad55511e5bdfed9db23d25628b2bd483e1026 +F test/shell1.test d41257103cf762e1d43f1d07286ac65ed32c5430a19851029bfe06671f5e19fe F test/shell2.test ac102ebc0a9ec166257600c4ee8bdefec242163afced295f10b004f4af3fc9dd F test/shell3.test 603b448e917537cf77be0f265c05c6f63bc677c63a533c8e96aae923b56f4a0e F test/shell4.test ad7eee983b5e7f1dd92d8c87bc0f39474086bc32c980c00f3934c54aabc636a2 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P dbcc03bd7a727f4643f18a814bb9fd9071c0355f98dd064286240f2af361ee7f -R fd12f331319e6fbbfa3b284204829987 +P 0f11087b84753576425823e10a7eeff45af02f3c0135dee72dec5019c8127500 +R 082a492a8f98df0cde4bf61b34507534 U stephan -Z 41a98a24cb0e972787f7e1497beff5d6 +Z ce71ee2295dd33b341b0035e7f01938b # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index c83cc1ec78..d654dc0d93 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -0f11087b84753576425823e10a7eeff45af02f3c0135dee72dec5019c8127500 +909dd0a02a967baef46c3efdca42a0ab4e15003e34ce7e9af82fce5f17213d7b diff --git a/test/shell1.test b/test/shell1.test index 0e674a8497..8cf11b2409 100644 --- a/test/shell1.test +++ b/test/shell1.test @@ -515,6 +515,7 @@ do_test shell1-3.15.3 { } {1 {ERROR: extra parameter: "BAD". Usage: .output ?FILE? Send output to FILE or stdout if FILE is omitted If FILE begins with '|' then open it as a pipe. + If FILE is 'off' then output is disabled. Options: --bom Prefix output with a UTF8 byte-order mark -e Send output to the system text editor @@ -533,6 +534,7 @@ do_test shell1-3.16.2 { } {1 {ERROR: extra parameter: "BAD". Usage: .output ?FILE? Send output to FILE or stdout if FILE is omitted If FILE begins with '|' then open it as a pipe. + If FILE is 'off' then output is disabled. Options: --bom Prefix output with a UTF8 byte-order mark -e Send output to the system text editor From 39d14d48563f974f9b061e1668db83169cfc51ac Mon Sep 17 00:00:00 2001 From: stephan Date: Sat, 29 Mar 2025 11:50:25 +0000 Subject: [PATCH 043/120] Minor shell-internal doc addition. No functional changes. FossilOrigin-Name: 01b99c8a2819469568f369479c097cc8e3ed1f2478958460755b283dc7d11706 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/shell.c.in | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/manifest b/manifest index 0254997dac..341e1a8a22 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Correct\stwo\stests\sin\sshell1.test\swhich\swere\sbroken\sby\sthe\saddition\sof\snew\soutput\sin\s[0f11087b8475]. -D 2025-03-28T16:31:54.289 +C Minor\sshell-internal\sdoc\saddition.\sNo\sfunctional\schanges. +D 2025-03-29T11:50:25.471 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -786,7 +786,7 @@ F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c F src/resolve.c 20e1fbe8f840ffc0cd835e33f68a802a22e34faa918d7a269f3de242fda02f99 F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97 F src/select.c bfe14cdfceba54744b1c6c29099313f5173a0793dfaff0cd484774e9d05dbeab -F src/shell.c.in 213e2fd53d845432e47c0810eafa8eb66dd5295ae27f0313779c73df32d62fee +F src/shell.c.in 1e8b9bf369e80cdf9b029142e773038bc12bd38aea1c56df4af6bf7b46cae955 F src/sqlite.h.in fd70afd92948cf7cc93f687ac960bad1b0b6fbc436752419eff2fd65a1809380 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h 3f046c04ea3595d6bfda99b781926b17e672fd6d27da2ba6d8d8fc39981dcb54 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 0f11087b84753576425823e10a7eeff45af02f3c0135dee72dec5019c8127500 -R 082a492a8f98df0cde4bf61b34507534 +P 909dd0a02a967baef46c3efdca42a0ab4e15003e34ce7e9af82fce5f17213d7b +R a860434daa4f1cff46b86cfaeeda49ba U stephan -Z ce71ee2295dd33b341b0035e7f01938b +Z e72984ff9206134a5850abf221ac3d72 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index d654dc0d93..40e650f5c1 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -909dd0a02a967baef46c3efdca42a0ab4e15003e34ce7e9af82fce5f17213d7b +01b99c8a2819469568f369479c097cc8e3ed1f2478958460755b283dc7d11706 diff --git a/src/shell.c.in b/src/shell.c.in index 76874e7f72..ca76e4a6e9 100644 --- a/src/shell.c.in +++ b/src/shell.c.in @@ -10234,9 +10234,9 @@ static int do_meta_command(char *zLine, ShellState *p){ ){ char *zFile = 0; int i; - int eMode = 0; - int bOnce = 0; /* 0: .output, 1: .once, 2: .excel/.www */ - int bPlain = 0; /* --plain option */ + int eMode = 0; /* 0: .outout/.once, 'x'=.excel, 'w'=.www */ + int bOnce = 0; /* 0: .output, 1: .once, 2: .excel/.www */ + int bPlain = 0; /* --plain option */ static const char *zBomUtf8 = "\357\273\277"; const char *zBom = 0; @@ -10265,7 +10265,7 @@ static int do_meta_command(char *zLine, ShellState *p){ }else if( c=='o' && cli_strcmp(z,"-w")==0 ){ eMode = 'w'; /* Web browser */ }else{ - sqlite3_fprintf(p->out, + sqlite3_fprintf(p->out, "ERROR: unknown option: \"%s\". Usage:\n", azArg[i]); showHelp(p->out, azArg[0]); rc = 1; From 084e61f5cb24600f61c820ef8d8946b573dbc56a Mon Sep 17 00:00:00 2001 From: drh <> Date: Mon, 31 Mar 2025 09:53:20 +0000 Subject: [PATCH 044/120] The --dev option on ./configure implies --debug and adds -DSQLITE_DEBUG. FossilOrigin-Name: 67dbd9ff0f1e69e429cf3afaf19b84e8e95fc75035ac90cd0ae78d0d002980f8 --- auto.def | 2 +- manifest | 14 +++++++------- manifest.uuid | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/auto.def b/auto.def index a1191cdd1e..cf21371e95 100644 --- a/auto.def +++ b/auto.def @@ -20,7 +20,7 @@ sqlite-configure canonical { proj-opt-set all 1 proj-opt-set debug 1 proj-opt-set amalgamation 0 - define CFLAGS [get-env CFLAGS {-O0 -g}] + define CFLAGS [get-env CFLAGS {-O0 -g -DSQLITE_DEBUG=1}] # -------------^^^^^^^ intentionally using [get-env] instead of # [proj-get-env] here because [sqlite-setup-default-cflags] uses # [proj-get-env] and we want this to supercede that. diff --git a/manifest b/manifest index 341e1a8a22..408b4d9b73 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Minor\sshell-internal\sdoc\saddition.\sNo\sfunctional\schanges. -D 2025-03-29T11:50:25.471 +C The\s--dev\soption\son\s./configure\simplies\s--debug\sand\sadds\s-DSQLITE_DEBUG. +D 2025-03-31T09:53:20.118 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -15,7 +15,7 @@ F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2 F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90 F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2 F art/sqlite370.svg 40b7e2fe8aac3add5d56dd86ab8d427a4eca5bcb3fe4f8946cb3794e1821d531 -F auto.def f769bf3111089ee9471a2a872c47651c4e29e81d104a52867ab544fde5ef6bad +F auto.def e8f8cb7396826bc5d89e6619a4fd6a39069786686d469f850c482d2eaa9339aa F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac F autoconf/Makefile.in 66d98d473556c4e2daf7252355f4b5db129091800027f280082804eb4c45784f F autoconf/Makefile.msc 5bc67d3912444c40c6f96d003e5c90663e51abb83d204a520110b1b2038dcd8b @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 909dd0a02a967baef46c3efdca42a0ab4e15003e34ce7e9af82fce5f17213d7b -R a860434daa4f1cff46b86cfaeeda49ba -U stephan -Z e72984ff9206134a5850abf221ac3d72 +P 01b99c8a2819469568f369479c097cc8e3ed1f2478958460755b283dc7d11706 +R 6c218aec154c4655107f21b73d8542a6 +U drh +Z 1589ccc4b4a2077318cb6f8bd24f96bb # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 40e650f5c1..909c8ad36d 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -01b99c8a2819469568f369479c097cc8e3ed1f2478958460755b283dc7d11706 +67dbd9ff0f1e69e429cf3afaf19b84e8e95fc75035ac90cd0ae78d0d002980f8 From 8620b42245fa1329f352bba6aa95bcf30c325a37 Mon Sep 17 00:00:00 2001 From: stephan Date: Mon, 31 Mar 2025 10:29:06 +0000 Subject: [PATCH 045/120] Correct the ordering of the configure script's handling of the --dev and --debug flags so that --dev's forcing of --debug get picked up early enough. FossilOrigin-Name: e48189ed33fa9d02b23c18255c7b4c6cab2a6d4b62f7c1edbb0a58ab329735fc --- auto.def | 3 ++- autoconf/auto.def | 1 + autosetup/sqlite-config.tcl | 1 - manifest | 18 +++++++++--------- manifest.uuid | 2 +- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/auto.def b/auto.def index cf21371e95..c224f6131a 100644 --- a/auto.def +++ b/auto.def @@ -20,12 +20,13 @@ sqlite-configure canonical { proj-opt-set all 1 proj-opt-set debug 1 proj-opt-set amalgamation 0 - define CFLAGS [get-env CFLAGS {-O0 -g -DSQLITE_DEBUG=1}] + define CFLAGS [get-env CFLAGS {-O0 -g}] # -------------^^^^^^^ intentionally using [get-env] instead of # [proj-get-env] here because [sqlite-setup-default-cflags] uses # [proj-get-env] and we want this to supercede that. sqlite-munge-cflags; # straighten out -DSQLITE_ENABLE/OMIT flags } + sqlite-handle-debug sqlite-check-common-bins ;# must come before [sqlite-handle-wasi-sdk] sqlite-handle-wasi-sdk ;# must run relatively early, as it changes the environment sqlite-check-common-system-deps diff --git a/autoconf/auto.def b/autoconf/auto.def index 85fa7d93ed..146ca00673 100644 --- a/autoconf/auto.def +++ b/autoconf/auto.def @@ -5,6 +5,7 @@ # "autoconf" bundle of the SQLite project. use sqlite-config sqlite-configure autoconf { + sqlite-handle-debug sqlite-check-common-bins ;# must come before [sqlite-handle-wasi-sdk] sqlite-handle-wasi-sdk ;# must run relatively early, as it changes the environment sqlite-check-common-system-deps diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl index ec08cc95c0..e6998a47e5 100644 --- a/autosetup/sqlite-config.tcl +++ b/autosetup/sqlite-config.tcl @@ -435,7 +435,6 @@ proc sqlite-configure-phase1 {buildMode} { define SQLITE_OS_WIN 0 } sqlite-setup-default-cflags - sqlite-handle-debug define HAVE_LFS 0 if {[opt-bool largefile]} { # diff --git a/manifest b/manifest index 408b4d9b73..d704f1c97a 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C The\s--dev\soption\son\s./configure\simplies\s--debug\sand\sadds\s-DSQLITE_DEBUG. -D 2025-03-31T09:53:20.118 +C Correct\sthe\sordering\sof\sthe\sconfigure\sscript's\shandling\sof\sthe\s--dev\sand\s--debug\sflags\sso\sthat\s--dev's\sforcing\sof\s--debug\sget\spicked\sup\searly\senough. +D 2025-03-31T10:29:06.584 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -15,13 +15,13 @@ F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2 F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90 F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2 F art/sqlite370.svg 40b7e2fe8aac3add5d56dd86ab8d427a4eca5bcb3fe4f8946cb3794e1821d531 -F auto.def e8f8cb7396826bc5d89e6619a4fd6a39069786686d469f850c482d2eaa9339aa +F auto.def 80e6d7f7172fcfc53c67e9304c80482637aee04d3370f172f82d1244ff1f19ef F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac F autoconf/Makefile.in 66d98d473556c4e2daf7252355f4b5db129091800027f280082804eb4c45784f F autoconf/Makefile.msc 5bc67d3912444c40c6f96d003e5c90663e51abb83d204a520110b1b2038dcd8b F autoconf/README.first f1d3876e9a7852c22f275a6f06814e64934cecbc0b5b9617d64849094c1fd136 F autoconf/README.txt 1a32296d8bbdd67110c79d224c92c05545a0b5bd0c272950025fe3c7c7b49580 -F autoconf/auto.def 4cb3c39042039bb852034dc1a9d42717d42eef759a687a664ad283db8e6b816e +F autoconf/auto.def b140692fe36c1661a6fe4185fe0076e8fa27a3cdc556b92f252f9ca68ce9d855 F autoconf/tea/Makefile.in ba0556fee8da09c066bad85a4457904e46ee2c2eabaa309c0e83a78f2f151a8e F autoconf/tea/README.txt 6c396709b45eb2b3be0ae6dc7e40a140d231962e3a2354da6c4dd48b1d9999bc F autoconf/tea/aclocal.m4 52c47aac44ce0ddb1f918b6993e8beb8eee88f43 @@ -52,7 +52,7 @@ F autosetup/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1 F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba F autosetup/proj.tcl cac07d75249fa127500b8e96080dc807e9ae97fe98d29e84a17bc28f4628e93f -F autosetup/sqlite-config.tcl 27f5baf08a8d7d968b55b613d87fdab7804fa2006b3e4fe7b2483793ee662e20 +F autosetup/sqlite-config.tcl b9ab4e0305833757cdc9ba8d366434f31e5ee46083230f5b3343ff09bc2ea0d7 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x F contrib/sqlitecon.tcl eb4c6578e08dd353263958da0dc620f8400b869a50d06e271ab0be85a51a08d3 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 01b99c8a2819469568f369479c097cc8e3ed1f2478958460755b283dc7d11706 -R 6c218aec154c4655107f21b73d8542a6 -U drh -Z 1589ccc4b4a2077318cb6f8bd24f96bb +P 67dbd9ff0f1e69e429cf3afaf19b84e8e95fc75035ac90cd0ae78d0d002980f8 +R 88171bb4b0f60222891519af72ef3acb +U stephan +Z 590d07e8541009009c9ac51eaddb4d9e # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 909c8ad36d..d93a2169a1 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -67dbd9ff0f1e69e429cf3afaf19b84e8e95fc75035ac90cd0ae78d0d002980f8 +e48189ed33fa9d02b23c18255c7b4c6cab2a6d4b62f7c1edbb0a58ab329735fc From 227df626e95e8e122bdd2c94fd099b05df32b0e8 Mon Sep 17 00:00:00 2001 From: stephan Date: Mon, 31 Mar 2025 10:54:09 +0000 Subject: [PATCH 046/120] Ensure that extension sources also inherit the debugging-related flags from --debug or --dev. FossilOrigin-Name: 3e96b772a46638bc25e036de053d620ded3350871ee10e06fd6fe51429934b0d --- Makefile.in | 9 ++++++--- main.mk | 9 +++++++-- manifest | 14 +++++++------- manifest.uuid | 2 +- 4 files changed, 21 insertions(+), 13 deletions(-) diff --git a/Makefile.in b/Makefile.in index 3bb66f13ff..5a215ec7b9 100644 --- a/Makefile.in +++ b/Makefile.in @@ -138,8 +138,6 @@ libsqlite3.DLL.install-rules = @SQLITE_DLL_INSTALL_RULES@ # -fsanitize flags for the fuzzcheck-asap app CFLAGS.fuzzcheck-asan.fsanitize = @CFLAGS_ASAN_FSANITIZE@ -T.cc.sqlite = $(T.cc) @TARGET_DEBUG@ - # # Define -D_HAVE_SQLITE_CONFIG_H so that the code knows it # can include the generated sqlite_cfg.h. @@ -147,7 +145,12 @@ T.cc.sqlite = $(T.cc) @TARGET_DEBUG@ # main.mk will fill out T.cc.sqlite with additional flags common to # all builds. # -T.cc.sqlite += -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite +T.cc.sqlite.extras = -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite + +# +# Intended to either be empty or be set to -g -DSQLITE_DEBUG=1. +# +T.cc.TARGET_DEBUG = @TARGET_DEBUG@ # # $(JIMSH) and $(CFLAGS.jimsh) are documented in main.mk. $(JIMSH) diff --git a/main.mk b/main.mk index 308a8c1079..518e065669 100644 --- a/main.mk +++ b/main.mk @@ -370,13 +370,18 @@ INSTALL.noexec = $(INSTALL) -m 0644 # T.compile = $(T.cc) $(T.compile.extras) +# +# Optionally set by the configure script to include -DSQLITE_DEBUG=1 +# +T.cc.TARGET_DEBUG ?= + # # $(T.cc.sqlite) is $(T.cc) plus any flags which are desired for the # library as a whole, but not necessarily needed for every binary. It # will normally get initially populated with flags by the # configure-generated makefile. # -T.cc.sqlite ?= $(T.cc) +T.cc.sqlite ?= $(T.cc) $(T.cc.sqlite.extras) $(T.cc.TARGET_DEBUG) # # $(CFLAGS.intree_includes) = -I... flags relevant specifically to @@ -392,7 +397,7 @@ T.cc.sqlite += $(CFLAGS.intree_includes) # # $(T.cc.extension) = compiler invocation for loadable extensions. # -T.cc.extension = $(T.compile) -I. -I$(TOP)/src -DSQLITE_CORE +T.cc.extension = $(T.compile) -I. -I$(TOP)/src $(T.cc.TARGET_DEBUG) -DSQLITE_CORE # # $(T.link) = compiler invocation for when the target will be an diff --git a/manifest b/manifest index d704f1c97a..c14ffe8446 100644 --- a/manifest +++ b/manifest @@ -1,10 +1,10 @@ -C Correct\sthe\sordering\sof\sthe\sconfigure\sscript's\shandling\sof\sthe\s--dev\sand\s--debug\sflags\sso\sthat\s--dev's\sforcing\sof\s--debug\sget\spicked\sup\searly\senough. -D 2025-03-31T10:29:06.584 +C Ensure\sthat\sextension\ssources\salso\sinherit\sthe\sdebugging-related\sflags\sfrom\s--debug\sor\s--dev. +D 2025-03-31T10:54:09.382 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d -F Makefile.in 86cc5297495fd5ce632cd7ec298c562900f874eef42c44d5890bd22397bb3820 +F Makefile.in 34794659ddf442225267c4c9b743b7817d2321be88d5eb44d87f35443dc284b6 F Makefile.linux-generic bd3e3cacd369821a6241d4ea1967395c962dfe3057e38cb0a435cee0e8b789d0 F Makefile.msc bb2cc6f75bbcb2d690fbdd1489914a2febd5e99bad9c77538cb3330d304694c6 F README.md a953c0cffd6e4f2501a306c00ee2b6e1e6630c25031e094629307fe99dd003d1 @@ -709,7 +709,7 @@ F ext/wasm/tests/opfs/sahpool/sahpool-pausing.js f264925cfc82155de38cecb3d204c36 F ext/wasm/tests/opfs/sahpool/sahpool-worker.js bd25a43fc2ab2d1bafd8f2854ad3943ef673f7c3be03e95ecf1612ff6e8e2a61 F ext/wasm/wasmfs.make 68999f5bd8c489239592d59a420f8c627c99169bbd6fa16a404751f757b9f702 F magic.txt 5ade0bc977aa135e79e3faaea894d5671b26107cc91e70783aa7dc83f22f3ba0 -F main.mk d8badf4236a5f134304e02706a35cee155ad0fb11d850ae7c891146d9b48132f +F main.mk c35bf589abc5baa7dc4bc44d7f666b82bbc6891fa67486c95d942af9343870b5 F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271 F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504 F mptest/crash01.test 61e61469e257df0850df4293d7d4d6c2af301421 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 67dbd9ff0f1e69e429cf3afaf19b84e8e95fc75035ac90cd0ae78d0d002980f8 -R 88171bb4b0f60222891519af72ef3acb +P e48189ed33fa9d02b23c18255c7b4c6cab2a6d4b62f7c1edbb0a58ab329735fc +R 900351079f392a3dac0ffc6765fe20f2 U stephan -Z 590d07e8541009009c9ac51eaddb4d9e +Z 4c01788cf2ee043c6a538c02c303b015 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index d93a2169a1..3e231d6518 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e48189ed33fa9d02b23c18255c7b4c6cab2a6d4b62f7c1edbb0a58ab329735fc +3e96b772a46638bc25e036de053d620ded3350871ee10e06fd6fe51429934b0d From 0a0367f38740284b7f423ddc98b66361f3ddccf4 Mon Sep 17 00:00:00 2001 From: stephan Date: Mon, 31 Mar 2025 13:08:29 +0000 Subject: [PATCH 047/120] Ensure that the compilation of extensions get the same CFLAGS as the core lib. Move the feature flags enabled by --dev out of TARGET_DEBUG and into OPT_FEATURE_FLAGS (for consistency). Rename the make-internal gcov-related flags to be more descriptive. At the end of the configure script, if SQLITE_DEBUG is active then emit a note reminding the builder that performance will suffer. FossilOrigin-Name: e64c6a3856b839e4e8c0a1cb1713b0d2f1d3cb9b915dd215b0d3cb229502d539 --- Makefile.in | 13 ++---------- auto.def | 2 +- autosetup/sqlite-config.tcl | 13 ++++++++---- main.mk | 42 +++++++++++++++++++++++++++---------- manifest | 18 ++++++++-------- manifest.uuid | 2 +- 6 files changed, 53 insertions(+), 37 deletions(-) diff --git a/Makefile.in b/Makefile.in index 5a215ec7b9..e5f0c527c4 100644 --- a/Makefile.in +++ b/Makefile.in @@ -138,15 +138,6 @@ libsqlite3.DLL.install-rules = @SQLITE_DLL_INSTALL_RULES@ # -fsanitize flags for the fuzzcheck-asap app CFLAGS.fuzzcheck-asan.fsanitize = @CFLAGS_ASAN_FSANITIZE@ -# -# Define -D_HAVE_SQLITE_CONFIG_H so that the code knows it -# can include the generated sqlite_cfg.h. -# -# main.mk will fill out T.cc.sqlite with additional flags common to -# all builds. -# -T.cc.sqlite.extras = -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite - # # Intended to either be empty or be set to -g -DSQLITE_DEBUG=1. # @@ -249,8 +240,8 @@ TSTRNNR_OPTS = @TSTRNNR_OPTS@ CFLAGS.gcov1 = -DSQLITE_COVERAGE_TEST=1 -fprofile-arcs -ftest-coverage LDFLAGS.gcov1 = -lgcov USE_GCOV = @USE_GCOV@ -T.compile.extras = $(CFLAGS.gcov$(USE_GCOV)) -T.link.extras = $(LDFLAGS.gcov$(USE_GCOV)) +T.compile.gcov = $(CFLAGS.gcov$(USE_GCOV)) +T.link.gcov = $(LDFLAGS.gcov$(USE_GCOV)) # # Vars with the AS_ prefix are specifically related to AutoSetup. diff --git a/auto.def b/auto.def index c224f6131a..6ff29ab51c 100644 --- a/auto.def +++ b/auto.def @@ -26,7 +26,7 @@ sqlite-configure canonical { # [proj-get-env] and we want this to supercede that. sqlite-munge-cflags; # straighten out -DSQLITE_ENABLE/OMIT flags } - sqlite-handle-debug + sqlite-handle-debug ;# must come after --dev flag check sqlite-check-common-bins ;# must come before [sqlite-handle-wasi-sdk] sqlite-handle-wasi-sdk ;# must run relatively early, as it changes the environment sqlite-check-common-system-deps diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl index e6998a47e5..eda9f2588e 100644 --- a/autosetup/sqlite-config.tcl +++ b/autosetup/sqlite-config.tcl @@ -525,7 +525,8 @@ define OPT_SHELL {} ; # Feature-related CFLAGS for the sqlite3 CLI app # Adds $args, if not empty, to OPT_FEATURE_FLAGS. If the first arg is # -shell then it strips that arg and passes the remaining args the # sqlite-add-shell-opt in addition to adding them to -# OPT_FEATURE_FLAGS. +# OPT_FEATURE_FLAGS. This is intended only for holding +# -DSQLITE_ENABLE/OMIT/... flags, but that is not enforced here. proc sqlite-add-feature-flag {args} { set shell "" if {"-shell" eq [lindex $args 0]} { @@ -771,6 +772,9 @@ proc sqlite-finalize-feature-flags {} { proj-assert {"canonical" eq $::sqliteConfig(build-mode)} msg-result "Appending source files to amalgamation: $extraSrc" } + if {[lsearch [get-define TARGET_DEBUG ""] -DSQLITE_DEBUG=1] > -1} { + msg-result "Note: this is a debug build, so performance will suffer." + } } ######################################################################## @@ -780,7 +784,8 @@ proc sqlite-finalize-feature-flags {} { proc sqlite-handle-debug {} { msg-checking "SQLITE_DEBUG build? " proj-if-opt-truthy debug { - define TARGET_DEBUG {-g -DSQLITE_DEBUG=1 -DSQLITE_ENABLE_SELECTTRACE -DSQLITE_ENABLE_WHERETRACE -O0 -Wall} + define TARGET_DEBUG {-g -DSQLITE_DEBUG=1 -O0 -Wall} + sqlite-add-feature-flag -DSQLITE_ENABLE_SELECTTRACE -DSQLITE_ENABLE_WHERETRACE proj-opt-set memsys5 msg-result yes } { @@ -1384,7 +1389,7 @@ proc sqlite-handle-load-extension {} { msg-result "Loadable extension support enabled." } else { msg-result "Disabling loadable extension support. Use --enable-load-extension to enable them." - sqlite-add-feature-flag {-DSQLITE_OMIT_LOAD_EXTENSION=1} + sqlite-add-feature-flag -DSQLITE_OMIT_LOAD_EXTENSION=1 } return $found } @@ -1398,7 +1403,7 @@ proc sqlite-handle-math {} { } define LDFLAGS_MATH [get-define lib_ceil] undefine lib_ceil - sqlite-add-feature-flag {-DSQLITE_ENABLE_MATH_FUNCTIONS} + sqlite-add-feature-flag -DSQLITE_ENABLE_MATH_FUNCTIONS msg-result "Enabling math SQL functions" } { define LDFLAGS_MATH "" diff --git a/main.mk b/main.mk index 518e065669..5efffe3d01 100644 --- a/main.mk +++ b/main.mk @@ -260,8 +260,9 @@ EXTRA_SRC ?= # # $(OPTS)=... is another way of influencing C compilation. It is # distinctly separate from $(OPTIONS) and $(OPT_FEATURE_FLAGS) but, -# like those, $(OPTS) applies to all invocations of $(T.cc). The -# configure process does not set either of $(OPTIONS) or $(OPTS). +# like those, $(OPTS) applies to all invocations of $(T.cc) (and some +# invocations of $(B.cc). The configure process does not set either of +# $(OPTIONS) or $(OPTS). # OPT_FEATURE_FLAGS ?= # @@ -364,24 +365,43 @@ INSTALL.noexec = $(INSTALL) -m 0644 # ^^^ do not use GNU-specific flags to $(INSTALL), e.g. --mode=... # -# $(T.compile) = generic target platform compiler invocation, -# differing only from $(T.cc) in that it appends $(T.compile.extras), -# which are primarily intended for use with gcov-related flags. +# T.compile.gcov = gcov-specific compilation flags for the target +# platform. # -T.compile = $(T.cc) $(T.compile.extras) +T.compile.gcov ?= +# +# T.link.gcov = gcov-specific link flags for the target platform. +# +T.link.gcov ?= + +# +# $(T.compile) = generic target platform compiler invocation, +# differing only from $(T.cc) in that it appends $(T.compile.gcov), +# which is intended for use with gcov-related flags. +# +T.compile = $(T.cc) $(T.compile.gcov) # # Optionally set by the configure script to include -DSQLITE_DEBUG=1 +# and other debug-related flags. # T.cc.TARGET_DEBUG ?= +# +# Extra CFLAGS for both the core sqlite3 components and extensions. +# +# Define -D_HAVE_SQLITE_CONFIG_H so that the code knows it +# can include the generated sqlite_cfg.h. +# +T.cc.sqlite.extras = -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite $(T.cc.TARGET_DEBUG) + # # $(T.cc.sqlite) is $(T.cc) plus any flags which are desired for the # library as a whole, but not necessarily needed for every binary. It # will normally get initially populated with flags by the # configure-generated makefile. # -T.cc.sqlite ?= $(T.cc) $(T.cc.sqlite.extras) $(T.cc.TARGET_DEBUG) +T.cc.sqlite ?= $(T.compile) $(T.cc.sqlite.extras) # # $(CFLAGS.intree_includes) = -I... flags relevant specifically to @@ -397,16 +417,16 @@ T.cc.sqlite += $(CFLAGS.intree_includes) # # $(T.cc.extension) = compiler invocation for loadable extensions. # -T.cc.extension = $(T.compile) -I. -I$(TOP)/src $(T.cc.TARGET_DEBUG) -DSQLITE_CORE +T.cc.extension = $(T.compile) -I. -I$(TOP)/src $(T.cc.sqlite.extras) -DSQLITE_CORE # # $(T.link) = compiler invocation for when the target will be an # executable. # -# $(T.link.extras) = optional config-specific flags for $(T.link), -# primarily intended for use with gcov-related flags. +# $(T.link.gcov) = optional config-specific flags for $(T.link), +# intended for use with gcov-related flags. # -T.link = $(T.cc.sqlite) $(T.link.extras) +T.link = $(T.cc.sqlite) $(T.link.gcov) # # $(T.link.shared) = $(T.link) invocation specifically for shared libraries # diff --git a/manifest b/manifest index c14ffe8446..2c21bcd589 100644 --- a/manifest +++ b/manifest @@ -1,10 +1,10 @@ -C Ensure\sthat\sextension\ssources\salso\sinherit\sthe\sdebugging-related\sflags\sfrom\s--debug\sor\s--dev. -D 2025-03-31T10:54:09.382 +C Ensure\sthat\sthe\scompilation\sof\sextensions\sget\sthe\ssame\sCFLAGS\sas\sthe\score\slib.\sMove\sthe\sfeature\sflags\senabled\sby\s--dev\sout\sof\sTARGET_DEBUG\sand\sinto\sOPT_FEATURE_FLAGS\s(for\sconsistency).\sRename\sthe\smake-internal\sgcov-related\sflags\sto\sbe\smore\sdescriptive.\sAt\sthe\send\sof\sthe\sconfigure\sscript,\sif\sSQLITE_DEBUG\sis\sactive\sthen\semit\sa\snote\sreminding\sthe\sbuilder\sthat\sperformance\swill\ssuffer. +D 2025-03-31T13:08:29.964 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d -F Makefile.in 34794659ddf442225267c4c9b743b7817d2321be88d5eb44d87f35443dc284b6 +F Makefile.in 24a030d8507a7e040907ea3eb7740bd583f89ef8019ef23826dfc1cf3d6f26f0 F Makefile.linux-generic bd3e3cacd369821a6241d4ea1967395c962dfe3057e38cb0a435cee0e8b789d0 F Makefile.msc bb2cc6f75bbcb2d690fbdd1489914a2febd5e99bad9c77538cb3330d304694c6 F README.md a953c0cffd6e4f2501a306c00ee2b6e1e6630c25031e094629307fe99dd003d1 @@ -15,7 +15,7 @@ F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2 F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90 F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2 F art/sqlite370.svg 40b7e2fe8aac3add5d56dd86ab8d427a4eca5bcb3fe4f8946cb3794e1821d531 -F auto.def 80e6d7f7172fcfc53c67e9304c80482637aee04d3370f172f82d1244ff1f19ef +F auto.def 3c423bc80e144784abeff067ade482fc4d64979bf2d3d673d974d952cf6c6260 F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac F autoconf/Makefile.in 66d98d473556c4e2daf7252355f4b5db129091800027f280082804eb4c45784f F autoconf/Makefile.msc 5bc67d3912444c40c6f96d003e5c90663e51abb83d204a520110b1b2038dcd8b @@ -52,7 +52,7 @@ F autosetup/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1 F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba F autosetup/proj.tcl cac07d75249fa127500b8e96080dc807e9ae97fe98d29e84a17bc28f4628e93f -F autosetup/sqlite-config.tcl b9ab4e0305833757cdc9ba8d366434f31e5ee46083230f5b3343ff09bc2ea0d7 +F autosetup/sqlite-config.tcl f4ee2028c603fdffb0dfec1a1ac16f5477c8047c728eac6357382f3767ec203b F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x F contrib/sqlitecon.tcl eb4c6578e08dd353263958da0dc620f8400b869a50d06e271ab0be85a51a08d3 @@ -709,7 +709,7 @@ F ext/wasm/tests/opfs/sahpool/sahpool-pausing.js f264925cfc82155de38cecb3d204c36 F ext/wasm/tests/opfs/sahpool/sahpool-worker.js bd25a43fc2ab2d1bafd8f2854ad3943ef673f7c3be03e95ecf1612ff6e8e2a61 F ext/wasm/wasmfs.make 68999f5bd8c489239592d59a420f8c627c99169bbd6fa16a404751f757b9f702 F magic.txt 5ade0bc977aa135e79e3faaea894d5671b26107cc91e70783aa7dc83f22f3ba0 -F main.mk c35bf589abc5baa7dc4bc44d7f666b82bbc6891fa67486c95d942af9343870b5 +F main.mk ed671b5709a4f3e4ed156c0d9e323206fec612d819995d1845e93594d4de7ea2 F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271 F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504 F mptest/crash01.test 61e61469e257df0850df4293d7d4d6c2af301421 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P e48189ed33fa9d02b23c18255c7b4c6cab2a6d4b62f7c1edbb0a58ab329735fc -R 900351079f392a3dac0ffc6765fe20f2 +P 3e96b772a46638bc25e036de053d620ded3350871ee10e06fd6fe51429934b0d +R 5a85f2774d52509b8f6ae6acd48a3210 U stephan -Z 4c01788cf2ee043c6a538c02c303b015 +Z 7e629c8c02794da90c85323f978e7eb9 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 3e231d6518..80bb6da65a 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -3e96b772a46638bc25e036de053d620ded3350871ee10e06fd6fe51429934b0d +e64c6a3856b839e4e8c0a1cb1713b0d2f1d3cb9b915dd215b0d3cb229502d539 From 4d9384cba35ce7971431da9b543e0f9d68975947 Mon Sep 17 00:00:00 2001 From: drh <> Date: Mon, 31 Mar 2025 23:18:06 +0000 Subject: [PATCH 048/120] Fix a harmless typo in a code comment. FossilOrigin-Name: dd251377bd1a8e95a4a0179c50595f290b08ea93659f4906f88f5a9dff534aa1 --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/json.c | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/manifest b/manifest index 2c21bcd589..07a7e24e4d 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Ensure\sthat\sthe\scompilation\sof\sextensions\sget\sthe\ssame\sCFLAGS\sas\sthe\score\slib.\sMove\sthe\sfeature\sflags\senabled\sby\s--dev\sout\sof\sTARGET_DEBUG\sand\sinto\sOPT_FEATURE_FLAGS\s(for\sconsistency).\sRename\sthe\smake-internal\sgcov-related\sflags\sto\sbe\smore\sdescriptive.\sAt\sthe\send\sof\sthe\sconfigure\sscript,\sif\sSQLITE_DEBUG\sis\sactive\sthen\semit\sa\snote\sreminding\sthe\sbuilder\sthat\sperformance\swill\ssuffer. -D 2025-03-31T13:08:29.964 +C Fix\sa\sharmless\stypo\sin\sa\scode\scomment. +D 2025-03-31T23:18:06.613 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -746,7 +746,7 @@ F src/hash.h 46b92795a95bfefb210f52f0c316e9d7cdbcdd7e7fcfb0d8be796d3a5767cddf F src/hwtime.h f9c2dfb84dce7acf95ce6d289e46f5f9d3d1afd328e53da8f8e9008e3b3caae6 F src/in-operator.md 10cd8f4bcd225a32518407c2fb2484089112fd71 F src/insert.c a5f0366266be993ebf533808f22cb7a788624805b55bc45424ceed3f48c54a16 -F src/json.c 81e2012796a0e139b18c50ee3444c8ef86a020ab360511882216f5b610657e0c +F src/json.c 3c3975ba06163fde503200cf2827b3d49c862b1285ebe1e7fd2057dfada48ef9 F src/legacy.c d7874bc885906868cd51e6c2156698f2754f02d9eee1bae2d687323c3ca8e5aa F src/loadext.c 7432c944ff197046d67a1207790a1b13eec4548c85a9457eb0896bb3641dfb36 F src/main.c 07f78d917ffcdf327982840cfd8e855fd000527a2ea5ace372ce4febcbd0bf97 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 3e96b772a46638bc25e036de053d620ded3350871ee10e06fd6fe51429934b0d -R 5a85f2774d52509b8f6ae6acd48a3210 -U stephan -Z 7e629c8c02794da90c85323f978e7eb9 +P e64c6a3856b839e4e8c0a1cb1713b0d2f1d3cb9b915dd215b0d3cb229502d539 +R d6afe3ea0b11e3d65d616d932eff7348 +U drh +Z e51963c174f092cb0aa94669a8f5d2cf # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 80bb6da65a..26647656ca 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e64c6a3856b839e4e8c0a1cb1713b0d2f1d3cb9b915dd215b0d3cb229502d539 +dd251377bd1a8e95a4a0179c50595f290b08ea93659f4906f88f5a9dff534aa1 diff --git a/src/json.c b/src/json.c index 5360831af0..2108c3bc0e 100644 --- a/src/json.c +++ b/src/json.c @@ -3295,7 +3295,7 @@ static char *jsonBadPathError( } /* argv[0] is a BLOB that seems likely to be a JSONB. Subsequent -** arguments come in parse where each pair contains a JSON path and +** arguments come in pairs where each pair contains a JSON path and ** content to insert or set at that patch. Do the updates ** and return the result. ** From 3a7042e0e2257e50e3003ebac097665c118549e6 Mon Sep 17 00:00:00 2001 From: drh <> Date: Tue, 1 Apr 2025 15:17:01 +0000 Subject: [PATCH 049/120] This is an experimental optimization that attempts to keep a JSONB value the same size (same number of bytes) after doing a replace of an elements with a slightly smaller element, by denormalizing the size field. This can perhaps avoid unnecessary page updates and memmove() operations when making small changes in the middle of a large JSONB value. FossilOrigin-Name: b5de9584b7f49586c5387d8a74af5e41dba50f1817a54257bf9da00deb695f72 --- manifest | 15 ++++---- manifest.uuid | 2 +- src/json.c | 95 +++++++++++++++++++++++++++++++++++++++++++++++---- 3 files changed, 99 insertions(+), 13 deletions(-) diff --git a/manifest b/manifest index 07a7e24e4d..be3b6eaf32 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\sharmless\stypo\sin\sa\scode\scomment. -D 2025-03-31T23:18:06.613 +C This\sis\san\sexperimental\soptimization\sthat\sattempts\sto\skeep\sa\sJSONB\svalue\nthe\ssame\ssize\s(same\snumber\sof\sbytes)\safter\sdoing\sa\sreplace\sof\san\selements\nwith\sa\sslightly\ssmaller\selement,\sby\sdenormalizing\sthe\ssize\sfield.\s\sThis\ncan\sperhaps\savoid\sunnecessary\spage\supdates\sand\smemmove()\soperations\swhen\nmaking\ssmall\schanges\sin\sthe\smiddle\sof\sa\slarge\sJSONB\svalue. +D 2025-04-01T15:17:01.606 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -746,7 +746,7 @@ F src/hash.h 46b92795a95bfefb210f52f0c316e9d7cdbcdd7e7fcfb0d8be796d3a5767cddf F src/hwtime.h f9c2dfb84dce7acf95ce6d289e46f5f9d3d1afd328e53da8f8e9008e3b3caae6 F src/in-operator.md 10cd8f4bcd225a32518407c2fb2484089112fd71 F src/insert.c a5f0366266be993ebf533808f22cb7a788624805b55bc45424ceed3f48c54a16 -F src/json.c 3c3975ba06163fde503200cf2827b3d49c862b1285ebe1e7fd2057dfada48ef9 +F src/json.c 1de02e754ea25c5c02ac1edd7b3b5fd20d0da55e74190d0942d779a2a00bf07a F src/legacy.c d7874bc885906868cd51e6c2156698f2754f02d9eee1bae2d687323c3ca8e5aa F src/loadext.c 7432c944ff197046d67a1207790a1b13eec4548c85a9457eb0896bb3641dfb36 F src/main.c 07f78d917ffcdf327982840cfd8e855fd000527a2ea5ace372ce4febcbd0bf97 @@ -2216,8 +2216,11 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P e64c6a3856b839e4e8c0a1cb1713b0d2f1d3cb9b915dd215b0d3cb229502d539 -R d6afe3ea0b11e3d65d616d932eff7348 +P dd251377bd1a8e95a4a0179c50595f290b08ea93659f4906f88f5a9dff534aa1 +R d43087fc8a1c599b5542c89f392aa309 +T *branch * json-opt +T *sym-json-opt * +T -sym-trunk * U drh -Z e51963c174f092cb0aa94669a8f5d2cf +Z 9a10eb32279f050fc9d357fd9e297aac # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 26647656ca..6c4fe5533f 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -dd251377bd1a8e95a4a0179c50595f290b08ea93659f4906f88f5a9dff534aa1 +b5de9584b7f49586c5387d8a74af5e41dba50f1817a54257bf9da00deb695f72 diff --git a/src/json.c b/src/json.c index 2108c3bc0e..18d8717789 100644 --- a/src/json.c +++ b/src/json.c @@ -23,8 +23,8 @@ ** Beginning with version 3.45.0 (circa 2024-01-01), these routines also ** accept BLOB values that have JSON encoded using a binary representation ** called "JSONB". The name JSONB comes from PostgreSQL, however the on-disk -** format SQLite JSONB is completely different and incompatible with -** PostgreSQL JSONB. +** format for SQLite-JSONB is completely different and incompatible with +** PostgreSQL-JSONB. ** ** Decoding and interpreting JSONB is still O(N) where N is the size of ** the input, the same as text JSON. However, the constant of proportionality @@ -81,7 +81,7 @@ ** ** The payload size need not be expressed in its minimal form. For example, ** if the payload size is 10, the size can be expressed in any of 5 different -** ways: (1) (X>>4)==10, (2) (X>>4)==12 following by on 0x0a byte, +** ways: (1) (X>>4)==10, (2) (X>>4)==12 following by one 0x0a byte, ** (3) (X>>4)==13 followed by 0x00 and 0x0a, (4) (X>>4)==14 followed by ** 0x00 0x00 0x00 0x0a, or (5) (X>>4)==15 followed by 7 bytes of 0x00 and ** a single byte of 0x0a. The shorter forms are preferred, of course, but @@ -91,7 +91,7 @@ ** the size when it becomes known, resulting in a non-minimal encoding. ** ** The value (X>>4)==15 is not actually used in the current implementation -** (as SQLite is currently unable handle BLOBs larger than about 2GB) +** (as SQLite is currently unable to handle BLOBs larger than about 2GB) ** but is included in the design to allow for future enhancements. ** ** The payload follows the header. NULL, TRUE, and FALSE have no payload and @@ -1165,7 +1165,7 @@ static SQLITE_NOINLINE void jsonBlobExpandAndAppendNode( } -/* Append an node type byte together with the payload size and +/* Append a node type byte together with the payload size and ** possibly also the payload. ** ** If aPayload is not NULL, then it is a pointer to the payload which @@ -2500,6 +2500,82 @@ static void jsonAfterEditSizeAdjust(JsonParse *pParse, u32 iRoot){ pParse->delta += jsonBlobChangePayloadSize(pParse, iRoot, sz); } +/* +** If the JSONB at aIns[0..nIns-1] can be expanded (by denormalizing the +** size field) by d bytes, then write the expansion into aOut[] and +** return true. In this way, an overwrite happens without changing the +** size of the JSONB, which reduces memcpy() operations and also make it +** faster and easier to update the B-Tree entry that contains the JSONB +** in the database. +** +** If the expansion of aIns[] by d bytes cannot be (easily) accomplished +** then return false. +** +** The d parameter is guaranteed to be between 1 and 8. +** +** This routine is an optimization. A correct answer is obtained if it +** always leaves the output unchanged and returns false. +*/ +static int jsonBlobOverwrite( + u8 *aOut, /* Overwrite here */ + const u8 *aIns, /* New content */ + u32 nIns, /* Bytes of new content */ + u32 d /* Need to expand new content by this much */ +){ + u32 szPayload; /* Bytes of payload */ + u32 i; /* New header size, after expansion & a loop counter */ + u8 szHdr; /* Size of header before expansion */ + + /* Lookup table for finding the upper 4 bits of the first byte of the + ** expanded aIns[], based on the size of the expanded aIns[] header: + ** + ** 2 3 4 5 6 7 8 9 */ + static const u8 aType[] = { 0xc0, 0xd0, 0, 0xe0, 0, 0, 0, 0xf0 }; + + if( (aIns[0]&0x0f)<=2 ) return ; /* Cannot enlarge NULL, true, false */ + switch( aIns[0]>>4 ){ + default: { /* aIns[] header size 1 */ + if( ((1<=2 && i<=9 && aType[i-2]!=0 ); + aOut[0] = (aIns[0] & 0x0f) | aType[i-2]; + memcpy(&aOut[i], &aIns[szHdr], nIns-szHdr); + szPayload = nIns - szHdr; + while( 1/*edit-by-break*/ ){ + i--; + aOut[i] = szPayload & 0xff; + if( i==1 ) break; + szPayload >>= 8; + } + assert( (szPayload>>8)==0 ); + return 1; +} + /* ** Modify the JSONB blob at pParse->aBlob by removing nDel bytes of ** content beginning at iDel, and replacing them with nIns bytes of @@ -2521,6 +2597,11 @@ static void jsonBlobEdit( u32 nIns /* Bytes of content to insert */ ){ i64 d = (i64)nIns - (i64)nDel; + if( d<0 && d>=(-8) && aIns!=0 + && jsonBlobOverwrite(&pParse->aBlob[iDel], aIns, nIns, (int)-d) + ){ + return; + } if( d!=0 ){ if( pParse->nBlob + d > pParse->nBlobAlloc ){ jsonBlobExpand(pParse, pParse->nBlob+d); @@ -2532,7 +2613,9 @@ static void jsonBlobEdit( pParse->nBlob += d; pParse->delta += d; } - if( nIns && aIns ) memcpy(&pParse->aBlob[iDel], aIns, nIns); + if( nIns && aIns ){ + memcpy(&pParse->aBlob[iDel], aIns, nIns); + } } /* From 76076d442ad2ca0378933de08ce4e5bb6a4da39c Mon Sep 17 00:00:00 2001 From: drh <> Date: Tue, 1 Apr 2025 16:26:51 +0000 Subject: [PATCH 050/120] Fix a typo accidently added to the prior check-in. FossilOrigin-Name: fb2f283038f9329b6f791d92d6f943269f24f1a0efd5859165b63f517ed52ddb --- manifest | 15 ++++++--------- manifest.uuid | 2 +- src/json.c | 2 +- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/manifest b/manifest index be3b6eaf32..56e3ebd677 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C This\sis\san\sexperimental\soptimization\sthat\sattempts\sto\skeep\sa\sJSONB\svalue\nthe\ssame\ssize\s(same\snumber\sof\sbytes)\safter\sdoing\sa\sreplace\sof\san\selements\nwith\sa\sslightly\ssmaller\selement,\sby\sdenormalizing\sthe\ssize\sfield.\s\sThis\ncan\sperhaps\savoid\sunnecessary\spage\supdates\sand\smemmove()\soperations\swhen\nmaking\ssmall\schanges\sin\sthe\smiddle\sof\sa\slarge\sJSONB\svalue. -D 2025-04-01T15:17:01.606 +C Fix\sa\stypo\saccidently\sadded\sto\sthe\sprior\scheck-in. +D 2025-04-01T16:26:51.792 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -746,7 +746,7 @@ F src/hash.h 46b92795a95bfefb210f52f0c316e9d7cdbcdd7e7fcfb0d8be796d3a5767cddf F src/hwtime.h f9c2dfb84dce7acf95ce6d289e46f5f9d3d1afd328e53da8f8e9008e3b3caae6 F src/in-operator.md 10cd8f4bcd225a32518407c2fb2484089112fd71 F src/insert.c a5f0366266be993ebf533808f22cb7a788624805b55bc45424ceed3f48c54a16 -F src/json.c 1de02e754ea25c5c02ac1edd7b3b5fd20d0da55e74190d0942d779a2a00bf07a +F src/json.c fbae43c3920110be8d5307003d37d2b85b9bfb6d6d70fcb56ab68204026141af F src/legacy.c d7874bc885906868cd51e6c2156698f2754f02d9eee1bae2d687323c3ca8e5aa F src/loadext.c 7432c944ff197046d67a1207790a1b13eec4548c85a9457eb0896bb3641dfb36 F src/main.c 07f78d917ffcdf327982840cfd8e855fd000527a2ea5ace372ce4febcbd0bf97 @@ -2216,11 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P dd251377bd1a8e95a4a0179c50595f290b08ea93659f4906f88f5a9dff534aa1 -R d43087fc8a1c599b5542c89f392aa309 -T *branch * json-opt -T *sym-json-opt * -T -sym-trunk * +P b5de9584b7f49586c5387d8a74af5e41dba50f1817a54257bf9da00deb695f72 +R f7b3decde4c91460fa618a18904e7ef3 U drh -Z 9a10eb32279f050fc9d357fd9e297aac +Z 4f8d1e55abbb72c60ce6fde5ac11a1ee # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 6c4fe5533f..a0a265e534 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -b5de9584b7f49586c5387d8a74af5e41dba50f1817a54257bf9da00deb695f72 +fb2f283038f9329b6f791d92d6f943269f24f1a0efd5859165b63f517ed52ddb diff --git a/src/json.c b/src/json.c index 18d8717789..0ab46c5ae1 100644 --- a/src/json.c +++ b/src/json.c @@ -2532,7 +2532,7 @@ static int jsonBlobOverwrite( ** 2 3 4 5 6 7 8 9 */ static const u8 aType[] = { 0xc0, 0xd0, 0, 0xe0, 0, 0, 0, 0xf0 }; - if( (aIns[0]&0x0f)<=2 ) return ; /* Cannot enlarge NULL, true, false */ + if( (aIns[0]&0x0f)<=2 ) return 0; /* Cannot enlarge NULL, true, false */ switch( aIns[0]>>4 ){ default: { /* aIns[] header size 1 */ if( ((1< Date: Wed, 2 Apr 2025 10:42:47 +0000 Subject: [PATCH 051/120] Increase the size of a variable in FTS3 to help static analyzers see that there are no integer overflow problems. FossilOrigin-Name: a921a4682fba23e1e223c2e3ecebd22ec59321552bcc563c29ce501bfe70fa4e --- ext/fts3/fts3_tokenize_vtab.c | 2 +- manifest | 13 ++++++------- manifest.uuid | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/ext/fts3/fts3_tokenize_vtab.c b/ext/fts3/fts3_tokenize_vtab.c index 7e8d09bd48..b9d83982c8 100644 --- a/ext/fts3/fts3_tokenize_vtab.c +++ b/ext/fts3/fts3_tokenize_vtab.c @@ -346,7 +346,7 @@ static int fts3tokFilterMethod( fts3tokResetCursor(pCsr); if( idxNum==1 ){ const char *zByte = (const char *)sqlite3_value_text(apVal[0]); - int nByte = sqlite3_value_bytes(apVal[0]); + sqlite3_int64 nByte = sqlite3_value_bytes(apVal[0]); pCsr->zInput = sqlite3_malloc64(nByte+1); if( pCsr->zInput==0 ){ rc = SQLITE_NOMEM; diff --git a/manifest b/manifest index 6ec1615a4f..d599774bb8 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C The\sjson-blob-overwrite\soptimization\sseeks\sto\sprevent\sunnecessary\sI/O\sand\ndata\smovement\swhen\smaking\ssmall\schanges\sto\sthe\smiddle\sof\sa\slarge\sJSONB. -D 2025-04-01T16:32:31.607 +C Increase\sthe\ssize\sof\sa\svariable\sin\sFTS3\sto\shelp\sstatic\sanalyzers\nsee\sthat\sthere\sare\sno\sinteger\soverflow\sproblems. +D 2025-04-02T10:42:47.550 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -92,7 +92,7 @@ F ext/fts3/fts3_porter.c 024417020c57dd1ab39816f5fe6cf45222a857b78a1f6412f040ada F ext/fts3/fts3_snippet.c 55506af9c656d06ad6acef0735b67749d199617421f2e66c5b7101745b9cf1ba F ext/fts3/fts3_term.c 6a96027ad364001432545fe43322b6af04ed28bb5619ec51af1f59d0710d6d69 F ext/fts3/fts3_test.c cc329471e573f95a6ea9fbca87e89dcfa1d355591c80172ffcd759ac521d25d8 -F ext/fts3/fts3_tokenize_vtab.c 7fd9ef364f257b97218b9c331f2378e307375c592f70fd541f714e747d944962 +F ext/fts3/fts3_tokenize_vtab.c 66eba6c2baa04b2b15e80d68341b8fd0b4d3831f6b2edb33916a2906ff2d4389 F ext/fts3/fts3_tokenizer.c defede96b5dd5d658edfae77355b9c31ea65236eedc7bbe1adbc50d645cca5bc F ext/fts3/fts3_tokenizer.h 64c6ef6c5272c51ebe60fc607a896e84288fcbc3 F ext/fts3/fts3_tokenizer1.c c1de4ae28356ad98ccb8b2e3388a7fdcce7607b5523738c9afb6275dab765154 @@ -2216,9 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P dd251377bd1a8e95a4a0179c50595f290b08ea93659f4906f88f5a9dff534aa1 fb2f283038f9329b6f791d92d6f943269f24f1a0efd5859165b63f517ed52ddb -R f7b3decde4c91460fa618a18904e7ef3 -T +closed fb2f283038f9329b6f791d92d6f943269f24f1a0efd5859165b63f517ed52ddb +P 4a3d7b04216fff605629902b7de08fd45eb0a89e7e1b0bb7c5ba82cddbc030cc +R 3da8f4fd9e376ed8f7a905947eb1a25a U drh -Z 8bd4152593c0644c055eb7eda7efc520 +Z 865f58a98b7544234ba9407faec2cac8 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 94d5e079cd..307b4142e6 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -4a3d7b04216fff605629902b7de08fd45eb0a89e7e1b0bb7c5ba82cddbc030cc +a921a4682fba23e1e223c2e3ecebd22ec59321552bcc563c29ce501bfe70fa4e From 34a55f872c62edad5beb63a6eb03c6cb702e204c Mon Sep 17 00:00:00 2001 From: stephan Date: Wed, 2 Apr 2025 11:21:09 +0000 Subject: [PATCH 052/120] Remove some stray debug output from proj.tcl. FossilOrigin-Name: 5fc7150a2045a19966570b86843f180c2f8ff1f4688616ac161f071de0e765ec --- autosetup/proj.tcl | 2 +- manifest | 14 +++++++------- manifest.uuid | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl index e6dab7c670..f6826b157b 100644 --- a/autosetup/proj.tcl +++ b/autosetup/proj.tcl @@ -468,7 +468,7 @@ proc proj-opt-define-bool {args} { if {"" eq $descr} { set descr $defName } - puts "optName=$optName defName=$defName descr=$descr" + #puts "optName=$optName defName=$defName descr=$descr" set rc 0 msg-checking "[join $descr] ... " if {[proj-opt-truthy $optName]} { diff --git a/manifest b/manifest index d599774bb8..b0a50634cb 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Increase\sthe\ssize\sof\sa\svariable\sin\sFTS3\sto\shelp\sstatic\sanalyzers\nsee\sthat\sthere\sare\sno\sinteger\soverflow\sproblems. -D 2025-04-02T10:42:47.550 +C Remove\ssome\sstray\sdebug\soutput\sfrom\sproj.tcl. +D 2025-04-02T11:21:09.553 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -51,7 +51,7 @@ F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e F autosetup/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1821baf61bc86a7e F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba -F autosetup/proj.tcl cac07d75249fa127500b8e96080dc807e9ae97fe98d29e84a17bc28f4628e93f +F autosetup/proj.tcl b3c30cd29f16fdf76196c11391038d7fee32e1cfac2a47546dc058df1c0e075a F autosetup/sqlite-config.tcl f4ee2028c603fdffb0dfec1a1ac16f5477c8047c728eac6357382f3767ec203b F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 4a3d7b04216fff605629902b7de08fd45eb0a89e7e1b0bb7c5ba82cddbc030cc -R 3da8f4fd9e376ed8f7a905947eb1a25a -U drh -Z 865f58a98b7544234ba9407faec2cac8 +P a921a4682fba23e1e223c2e3ecebd22ec59321552bcc563c29ce501bfe70fa4e +R b36db031e41751f08c8c9b8d5ee4364e +U stephan +Z fc1c082b6c56254c3011590d999618fc # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 307b4142e6..a6a9e37867 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a921a4682fba23e1e223c2e3ecebd22ec59321552bcc563c29ce501bfe70fa4e +5fc7150a2045a19966570b86843f180c2f8ff1f4688616ac161f071de0e765ec From 69da86bf9346287e20ea4aaf7e79a7fa8c9210e3 Mon Sep 17 00:00:00 2001 From: drh <> Date: Wed, 2 Apr 2025 12:41:16 +0000 Subject: [PATCH 053/120] Fix harmless compiler warnings in the memstat.c extension. No changes to the core. FossilOrigin-Name: 9e903953ba986df98435da40e94fdb645f6f72279552cba63ef50cec1fe3b486 --- ext/misc/memstat.c | 10 ++++++++-- manifest | 14 +++++++------- manifest.uuid | 2 +- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/ext/misc/memstat.c b/ext/misc/memstat.c index c56af9f297..8e69b46955 100644 --- a/ext/misc/memstat.c +++ b/ext/misc/memstat.c @@ -401,8 +401,14 @@ static sqlite3_module memstatModule = { #endif /* SQLITE_OMIT_VIRTUALTABLE */ -int sqlite3MemstatVtabInit(sqlite3 *db){ +int sqlite3MemstatVtabInit( + sqlite3 *db, + char **NotUsed1, + const sqlite3_api_routines *NotUsed2 +){ int rc = SQLITE_OK; + (void)NotUsed1; + (void)NotUsed2; #ifndef SQLITE_OMIT_VIRTUALTABLE rc = sqlite3_create_module(db, "sqlite_memstat", &memstatModule, 0); #endif @@ -421,7 +427,7 @@ int sqlite3_memstat_init( int rc = SQLITE_OK; SQLITE_EXTENSION_INIT2(pApi); #ifndef SQLITE_OMIT_VIRTUALTABLE - rc = sqlite3MemstatVtabInit(db); + rc = sqlite3MemstatVtabInit(db, 0, 0); #endif return rc; } diff --git a/manifest b/manifest index b0a50634cb..69ab864650 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Remove\ssome\sstray\sdebug\soutput\sfrom\sproj.tcl. -D 2025-04-02T11:21:09.553 +C Fix\sharmless\scompiler\swarnings\sin\sthe\smemstat.c\sextension.\s\sNo\schanges\sto\nthe\score. +D 2025-04-02T12:41:16.617 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -422,7 +422,7 @@ F ext/misc/fileio.c 07cf3109ec6452789e3a989a010234e2a17b599ce82ea29212c948572456 F ext/misc/fossildelta.c 8c026e086e406e2b69947f1856fa3b848fff5379962276430d10085b8756b05a F ext/misc/fuzzer.c 6b231352815304ba60d8e9ec2ee73d4918e74d9b76bda8940ba2b64e8777515e F ext/misc/ieee754.c c9dd9d77c8e8e18e0a5706f8ffcccf4ccb6562073709f7453d4d73f5122f4362 -F ext/misc/memstat.c 5b284b78be431c1f5fa154b18eade2407e42c65ed32ec9e9fbf195d114778d7d +F ext/misc/memstat.c 43705d795090efb78c85c736b89251e743c291e23daaa8382fe7a0df2c6a283d F ext/misc/memtrace.c 7c0d115d2ef716ad0ba632c91e05bd119cb16c1aedf3bec9f06196ead2d5537b F ext/misc/memvfs.c 7dffa8cc89c7f2d73da4bd4ccea1bcbd2bd283e3bb4cea398df7c372a197291b F ext/misc/mmapwarm.c a81af4aaec00f24f308e2f4c19bf1d88f3ac3ce848c36daa7a4cd38145c4080d @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P a921a4682fba23e1e223c2e3ecebd22ec59321552bcc563c29ce501bfe70fa4e -R b36db031e41751f08c8c9b8d5ee4364e -U stephan -Z fc1c082b6c56254c3011590d999618fc +P 5fc7150a2045a19966570b86843f180c2f8ff1f4688616ac161f071de0e765ec +R c2bd6f6427c0c22ec5c2f41063ac6b3e +U drh +Z 77b7875a2144a2fd9ebe6776079bddf4 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index a6a9e37867..ba905e74fe 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -5fc7150a2045a19966570b86843f180c2f8ff1f4688616ac161f071de0e765ec +9e903953ba986df98435da40e94fdb645f6f72279552cba63ef50cec1fe3b486 From 0993fc62f2f133e0bb72ac5562eb8b94c1016b1a Mon Sep 17 00:00:00 2001 From: stephan Date: Wed, 2 Apr 2025 23:34:35 +0000 Subject: [PATCH 054/120] Add experimental --static-tclsqlite3 configure flag to build tclsqlite3 statically, which only works if static libtcl/etc. are available. Currently intended for docker builds via Alpine Linux. FossilOrigin-Name: bef3c8b1b9fd188ee9f941f93bac4567795fea51cee0830abf1ebc1999e1604f --- Makefile.in | 1 + auto.def | 2 ++ autosetup/sqlite-config.tcl | 5 +++++ main.mk | 15 ++++++++++++--- manifest | 23 +++++++++++++---------- manifest.uuid | 2 +- 6 files changed, 34 insertions(+), 14 deletions(-) diff --git a/Makefile.in b/Makefile.in index e5f0c527c4..3a43cc50a4 100644 --- a/Makefile.in +++ b/Makefile.in @@ -259,6 +259,7 @@ USE_AMALGAMATION ?= @USE_AMALGAMATION@ LINK_TOOLS_DYNAMICALLY ?= @LINK_TOOLS_DYNAMICALLY@ AMALGAMATION_GEN_FLAGS ?= --linemacros=@AMALGAMATION_LINE_MACROS@ EXTRA_SRC ?= @AMALGAMATION_EXTRA_SRC@ +STATIC_TCLSQLITE3 = @STATIC_TCLSQLITE3@ # # CFLAGS for sqlite3$(T.exe) diff --git a/auto.def b/auto.def index 6ff29ab51c..df6f067bf0 100644 --- a/auto.def +++ b/auto.def @@ -46,6 +46,8 @@ sqlite-configure canonical { define LINK_TOOLS_DYNAMICALLY [proj-opt-was-provided dynlink-tools] + proj-define-for-opt static-tclsqlite3 STATIC_TCLSQLITE3 "Statically link tclsqlite3?" + if {[set fsan [join [opt-val asan-fsanitize] ","]] in {auto ""}} { set fsan address,bounds-strict } diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl index eda9f2588e..4677ac809c 100644 --- a/autosetup/sqlite-config.tcl +++ b/autosetup/sqlite-config.tcl @@ -221,6 +221,11 @@ proc sqlite-configure {buildMode configScript} { its containing dir has multiple tclsh versions, it may select the wrong tclConfig.sh!} } + {canonical} { + static-tclsqlite3=0 + => {Statically-link tclsqlite3. Will only work if static libtcl + is available (it usually isn't!).} + } } # Options for line-editing modes for the CLI shell diff --git a/main.mk b/main.mk index 5efffe3d01..0d779bcefe 100644 --- a/main.mk +++ b/main.mk @@ -1423,12 +1423,21 @@ tclsqlite-shell.o: $(T.tcl.env.sh) $(TOP)/src/tclsqlite.c $(DEPS_OBJ_COMMON) tclsqlite-stubs.o: $(T.tcl.env.sh) $(TOP)/src/tclsqlite.c $(DEPS_OBJ_COMMON) $(T.compile.tcl) -DUSE_TCL_STUBS=1 -o $@ -c $(TOP)/src/tclsqlite.c $$TCL_INCLUDE_SPEC -tclsqlite3$(T.exe): $(T.tcl.env.sh) tclsqlite-shell.o $(libsqlite3.DLL) +STATIC_TCLSQLITE3 ?= 0 +HAVE_TCL ?= 0 +# +# tclsqlite3.(deps|flags).N = N is $(STATIC_TCLSQLITE3) +# +tclsqlite3.deps.1 = sqlite3.o +tclsqlite3.deps.0 = $(libsqlite3.DLL) +tclsqlite3.flags.1 = -static sqlite3.o +tclsqlite3.flags.0 = $(libsqlite3.DLL) +tclsqlite3$(T.exe): $(T.tcl.env.sh) tclsqlite-shell.o $(tclsqlite3.deps.$(STATIC_TCLSQLITE3)) $(T.link.tcl) -o $@ tclsqlite-shell.o \ - $(libsqlite3.DLL) $$TCL_INCLUDE_SPEC $$TCL_LIB_SPEC \ + $(tclsqlite3.flags.$(STATIC_TCLSQLITE3)) $$TCL_INCLUDE_SPEC $$TCL_LIB_SPEC \ $(LDFLAGS.libsqlite3) tclsqlite3$(T.exe)-1: tclsqlite3$(T.exe) -tclsqlite3$(T.exe)-0 tclsqlite3$(T.exe)-: +tclsqlite3$(T.exe)-0: tcl: tclsqlite3$(T.exe)-$(HAVE_TCL) # Rules to build opcodes.c and opcodes.h diff --git a/manifest b/manifest index 69ab864650..13a4cd7060 100644 --- a/manifest +++ b/manifest @@ -1,10 +1,10 @@ -C Fix\sharmless\scompiler\swarnings\sin\sthe\smemstat.c\sextension.\s\sNo\schanges\sto\nthe\score. -D 2025-04-02T12:41:16.617 +C Add\sexperimental\s--static-tclsqlite3\sconfigure\sflag\sto\sbuild\stclsqlite3\sstatically,\swhich\sonly\sworks\sif\sstatic\slibtcl/etc.\sare\savailable.\sCurrently\sintended\sfor\sdocker\sbuilds\svia\sAlpine\sLinux. +D 2025-04-02T23:34:35.409 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d -F Makefile.in 24a030d8507a7e040907ea3eb7740bd583f89ef8019ef23826dfc1cf3d6f26f0 +F Makefile.in 57de35a9052fe38caa88ee8d81c884c37383160518daec42ffce12b44d848402 F Makefile.linux-generic bd3e3cacd369821a6241d4ea1967395c962dfe3057e38cb0a435cee0e8b789d0 F Makefile.msc bb2cc6f75bbcb2d690fbdd1489914a2febd5e99bad9c77538cb3330d304694c6 F README.md a953c0cffd6e4f2501a306c00ee2b6e1e6630c25031e094629307fe99dd003d1 @@ -15,7 +15,7 @@ F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2 F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90 F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2 F art/sqlite370.svg 40b7e2fe8aac3add5d56dd86ab8d427a4eca5bcb3fe4f8946cb3794e1821d531 -F auto.def 3c423bc80e144784abeff067ade482fc4d64979bf2d3d673d974d952cf6c6260 +F auto.def 05e0308a9c2adcd13059f5956f1568e7fa05dbc9cd5109436bfa19bd4dcfc020 F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac F autoconf/Makefile.in 66d98d473556c4e2daf7252355f4b5db129091800027f280082804eb4c45784f F autoconf/Makefile.msc 5bc67d3912444c40c6f96d003e5c90663e51abb83d204a520110b1b2038dcd8b @@ -52,7 +52,7 @@ F autosetup/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1 F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba F autosetup/proj.tcl b3c30cd29f16fdf76196c11391038d7fee32e1cfac2a47546dc058df1c0e075a -F autosetup/sqlite-config.tcl f4ee2028c603fdffb0dfec1a1ac16f5477c8047c728eac6357382f3767ec203b +F autosetup/sqlite-config.tcl 46399e59e18f82ce85bad2831f819c10a38be2c9475885ae3f3b93ac5df3ea26 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x F contrib/sqlitecon.tcl eb4c6578e08dd353263958da0dc620f8400b869a50d06e271ab0be85a51a08d3 @@ -709,7 +709,7 @@ F ext/wasm/tests/opfs/sahpool/sahpool-pausing.js f264925cfc82155de38cecb3d204c36 F ext/wasm/tests/opfs/sahpool/sahpool-worker.js bd25a43fc2ab2d1bafd8f2854ad3943ef673f7c3be03e95ecf1612ff6e8e2a61 F ext/wasm/wasmfs.make 68999f5bd8c489239592d59a420f8c627c99169bbd6fa16a404751f757b9f702 F magic.txt 5ade0bc977aa135e79e3faaea894d5671b26107cc91e70783aa7dc83f22f3ba0 -F main.mk ed671b5709a4f3e4ed156c0d9e323206fec612d819995d1845e93594d4de7ea2 +F main.mk c338276860ee7f27e306d7dc24aa56cc4154361bd45dd85a3fef2de11a69fb7f F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271 F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504 F mptest/crash01.test 61e61469e257df0850df4293d7d4d6c2af301421 @@ -2216,8 +2216,11 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 5fc7150a2045a19966570b86843f180c2f8ff1f4688616ac161f071de0e765ec -R c2bd6f6427c0c22ec5c2f41063ac6b3e -U drh -Z 77b7875a2144a2fd9ebe6776079bddf4 +P 9e903953ba986df98435da40e94fdb645f6f72279552cba63ef50cec1fe3b486 +R a777dc5b9028c3898bbf56fa6ac897b3 +T *branch * static-tclsqlite3 +T *sym-static-tclsqlite3 * +T -sym-trunk * Cancelled\sby\sbranch. +U stephan +Z 186e6c7bc392b710af1231a4c5518892 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index ba905e74fe..c99cae97f1 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -9e903953ba986df98435da40e94fdb645f6f72279552cba63ef50cec1fe3b486 +bef3c8b1b9fd188ee9f941f93bac4567795fea51cee0830abf1ebc1999e1604f From 20f534708abc8618f71a13974583606688f4a27d Mon Sep 17 00:00:00 2001 From: stephan Date: Thu, 3 Apr 2025 00:40:33 +0000 Subject: [PATCH 055/120] Minor cleanups to the --static-tclsqlite3 support. FossilOrigin-Name: 06f1143870280d335daf4e7027fe8771e34415aa1234fe72c0c450c347b8146c --- autosetup/sqlite-config.tcl | 5 +++-- main.mk | 13 ++++++++++--- manifest | 17 +++++++---------- manifest.uuid | 2 +- 4 files changed, 21 insertions(+), 16 deletions(-) diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl index 4677ac809c..0dd8ed8cfc 100644 --- a/autosetup/sqlite-config.tcl +++ b/autosetup/sqlite-config.tcl @@ -223,8 +223,9 @@ proc sqlite-configure {buildMode configScript} { } {canonical} { static-tclsqlite3=0 - => {Statically-link tclsqlite3. Will only work if static libtcl - is available (it usually isn't!).} + => {Statically-link tclsqlite3. This only works if TCL support is + enabled and the libs tclsqlite3 needs are all available in + static form.} } } diff --git a/main.mk b/main.mk index 0d779bcefe..447bf3c5bc 100644 --- a/main.mk +++ b/main.mk @@ -88,6 +88,10 @@ T.exe ?= $(B.exe) T.dll ?= $(B.dll) T.lib ?= $(B.lib) # +# HAVE_TCL = 1 to enable full tcl support, else 0. +# +HAVE_TCL ?= 0 +# # $(TCLSH_CMD) = # # The canonical tclsh. @@ -1423,15 +1427,18 @@ tclsqlite-shell.o: $(T.tcl.env.sh) $(TOP)/src/tclsqlite.c $(DEPS_OBJ_COMMON) tclsqlite-stubs.o: $(T.tcl.env.sh) $(TOP)/src/tclsqlite.c $(DEPS_OBJ_COMMON) $(T.compile.tcl) -DUSE_TCL_STUBS=1 -o $@ -c $(TOP)/src/tclsqlite.c $$TCL_INCLUDE_SPEC +# +# STATIC_TCLSQLITE3 = 1 to statically link tclsqlite3, else +# 0. Requires static versions of all requisite libraries. +# STATIC_TCLSQLITE3 ?= 0 -HAVE_TCL ?= 0 # # tclsqlite3.(deps|flags).N = N is $(STATIC_TCLSQLITE3) # tclsqlite3.deps.1 = sqlite3.o +tclsqlite3.flags.1 = -static $(tclsqlite3.deps.1) tclsqlite3.deps.0 = $(libsqlite3.DLL) -tclsqlite3.flags.1 = -static sqlite3.o -tclsqlite3.flags.0 = $(libsqlite3.DLL) +tclsqlite3.flags.0 = $(tclsqlite3.deps.0) tclsqlite3$(T.exe): $(T.tcl.env.sh) tclsqlite-shell.o $(tclsqlite3.deps.$(STATIC_TCLSQLITE3)) $(T.link.tcl) -o $@ tclsqlite-shell.o \ $(tclsqlite3.flags.$(STATIC_TCLSQLITE3)) $$TCL_INCLUDE_SPEC $$TCL_LIB_SPEC \ diff --git a/manifest b/manifest index 13a4cd7060..acbf6a4148 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sexperimental\s--static-tclsqlite3\sconfigure\sflag\sto\sbuild\stclsqlite3\sstatically,\swhich\sonly\sworks\sif\sstatic\slibtcl/etc.\sare\savailable.\sCurrently\sintended\sfor\sdocker\sbuilds\svia\sAlpine\sLinux. -D 2025-04-02T23:34:35.409 +C Minor\scleanups\sto\sthe\s--static-tclsqlite3\ssupport. +D 2025-04-03T00:40:33.238 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -52,7 +52,7 @@ F autosetup/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1 F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba F autosetup/proj.tcl b3c30cd29f16fdf76196c11391038d7fee32e1cfac2a47546dc058df1c0e075a -F autosetup/sqlite-config.tcl 46399e59e18f82ce85bad2831f819c10a38be2c9475885ae3f3b93ac5df3ea26 +F autosetup/sqlite-config.tcl 4c4390106694baf62b2c12b2a0b655ab49265337652656314975f40e62a68915 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x F contrib/sqlitecon.tcl eb4c6578e08dd353263958da0dc620f8400b869a50d06e271ab0be85a51a08d3 @@ -709,7 +709,7 @@ F ext/wasm/tests/opfs/sahpool/sahpool-pausing.js f264925cfc82155de38cecb3d204c36 F ext/wasm/tests/opfs/sahpool/sahpool-worker.js bd25a43fc2ab2d1bafd8f2854ad3943ef673f7c3be03e95ecf1612ff6e8e2a61 F ext/wasm/wasmfs.make 68999f5bd8c489239592d59a420f8c627c99169bbd6fa16a404751f757b9f702 F magic.txt 5ade0bc977aa135e79e3faaea894d5671b26107cc91e70783aa7dc83f22f3ba0 -F main.mk c338276860ee7f27e306d7dc24aa56cc4154361bd45dd85a3fef2de11a69fb7f +F main.mk 3dc309319ff957f7bd951e66565ebdaaf6973e3f88b6aab374c6eba1aa09427f F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271 F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504 F mptest/crash01.test 61e61469e257df0850df4293d7d4d6c2af301421 @@ -2216,11 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 9e903953ba986df98435da40e94fdb645f6f72279552cba63ef50cec1fe3b486 -R a777dc5b9028c3898bbf56fa6ac897b3 -T *branch * static-tclsqlite3 -T *sym-static-tclsqlite3 * -T -sym-trunk * Cancelled\sby\sbranch. +P bef3c8b1b9fd188ee9f941f93bac4567795fea51cee0830abf1ebc1999e1604f +R b89fa674042cd72e93e0365523635b36 U stephan -Z 186e6c7bc392b710af1231a4c5518892 +Z 3891ff9be6404b7947c486f6c2af06f6 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index c99cae97f1..7cd39caa0f 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -bef3c8b1b9fd188ee9f941f93bac4567795fea51cee0830abf1ebc1999e1604f +06f1143870280d335daf4e7027fe8771e34415aa1234fe72c0c450c347b8146c From 2a5694910ab9f4f7be34decd340156ad336cab4e Mon Sep 17 00:00:00 2001 From: stephan Date: Thu, 3 Apr 2025 13:24:38 +0000 Subject: [PATCH 056/120] Add the --static-cli-shell configure flag to the canonical build, which works like --static-tclsqlite3 but applies to the CLI shell (statically linking it, which only works if all requisite libs are available in static form). It is not called --static-shell because that flag has a completely different legacy meaning in the autoconf build and this flight might eventually be added to that build, so would collide there. FossilOrigin-Name: fd2c1638ecc38617f5de0380ad23f233d1159be0712ae2ca4cae5c99e841f1b1 --- Makefile.in | 1 + auto.def | 9 +++++++-- autosetup/sqlite-config.tcl | 19 ++++++++++++++++++- main.mk | 15 ++++++++++++++- manifest | 19 +++++++++---------- manifest.uuid | 2 +- 6 files changed, 50 insertions(+), 15 deletions(-) diff --git a/Makefile.in b/Makefile.in index 3a43cc50a4..9f33492b2d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -260,6 +260,7 @@ LINK_TOOLS_DYNAMICALLY ?= @LINK_TOOLS_DYNAMICALLY@ AMALGAMATION_GEN_FLAGS ?= --linemacros=@AMALGAMATION_LINE_MACROS@ EXTRA_SRC ?= @AMALGAMATION_EXTRA_SRC@ STATIC_TCLSQLITE3 = @STATIC_TCLSQLITE3@ +STATIC_CLI_SHELL = @STATIC_CLI_SHELL@ # # CFLAGS for sqlite3$(T.exe) diff --git a/auto.def b/auto.def index df6f067bf0..8281888cc7 100644 --- a/auto.def +++ b/auto.def @@ -46,8 +46,6 @@ sqlite-configure canonical { define LINK_TOOLS_DYNAMICALLY [proj-opt-was-provided dynlink-tools] - proj-define-for-opt static-tclsqlite3 STATIC_TCLSQLITE3 "Statically link tclsqlite3?" - if {[set fsan [join [opt-val asan-fsanitize] ","]] in {auto ""}} { set fsan address,bounds-strict } @@ -56,4 +54,11 @@ sqlite-configure canonical { sqlite-handle-tcl sqlite-handle-emsdk + proj-if-opt-truthy static-shells { + proj-opt-set static-tclsqlite3 1 + proj-opt-set static-cli-shell 1 + } + proj-define-for-opt static-tclsqlite3 STATIC_TCLSQLITE3 "Statically link tclsqlite3?" + proj-define-for-opt static-cli-shell STATIC_CLI_SHELL "Statically link CLI shell?" + } diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl index 23c7d6fcfd..4d144e5626 100644 --- a/autosetup/sqlite-config.tcl +++ b/autosetup/sqlite-config.tcl @@ -224,7 +224,7 @@ proc sqlite-configure {buildMode configScript} { {canonical} { static-tclsqlite3=0 => {Statically-link tclsqlite3. This only works if TCL support is - enabled and the libs tclsqlite3 needs are all available in + enabled and all requisite libraries are available in static form. Note that glibc is unable to fully statically link certain libraries required by tclsqlite3, so this won't work on most Linux environments.} @@ -281,6 +281,21 @@ proc sqlite-configure {buildMode configScript} { } {canonical} { + # Note that --static-cli-shell has a completely different + # meaning from --static-shell in the autoconf build! + # --[disable-]static-shell is a legacy flag which we can't + # remove without breaking downstream builds. We _could_ + # recycle the name --static-shell here, as this flag is + # (currently) independent of the one in the autoconf build, + # but that would likely lead to confusion. + static-cli-shell=0 + => {Statically-link the sqlite3 CLI shell. + This only works if the requisite libraries are all available in + static form.} + + static-shells=0 + => {Shorthand for --static-cli-shell --static-tclsqlite3} + with-emsdk:=auto => {Top-most dir of the Emscripten SDK installation. Needed only by ext/wasm. Default=EMSDK env var.} @@ -295,6 +310,8 @@ proc sqlite-configure {buildMode configScript} { packaging { {autoconf} { # --disable-static-shell: https://sqlite.org/forum/forumpost/cc219ee704 + # Note that this has a different meaning from --static-cli-shell in the + # canonical build! static-shell=1 => {Link the sqlite3 shell app against the DLL instead of embedding sqlite3.c} } diff --git a/main.mk b/main.mk index 26314b3db8..47c61653ed 100644 --- a/main.mk +++ b/main.mk @@ -1431,7 +1431,7 @@ tclsqlite-stubs.o: $(T.tcl.env.sh) $(TOP)/src/tclsqlite.c $(DEPS_OBJ_COMMON) # STATIC_TCLSQLITE3 = 1 to statically link tclsqlite3, else # 0. Requires static versions of all requisite libraries. Primarily # intended for use with static-friendly environments like Alpine -# Linux. +# Linux. It won't work on glibc-based systems. # STATIC_TCLSQLITE3 ?= 0 # @@ -2104,6 +2104,18 @@ threadtest5: sqlite3.c $(TOP)/test/threadtest5.c $(T.link) $(TOP)/test/threadtest5.c sqlite3.c -o $@ $(LDFLAGS.libsqlite3) xbin: threadtest5 +# +# STATIC_CLI_SHELL = 1 to statically link sqlite3$(T.exe), else +# 0. Requires static versions of all requisite libraries. Primarily +# intended for use with static-friendly environments like Alpine +# Linux. +# +STATIC_CLI_SHELL ?= 0 +# +# sqlite3shell.flags.N = N is $(STATIC_CLI_SHELL) +# +sqlite3shell.flags.1 = -static +sqlite3shell.flags.0 = # # When building sqlite3$(T.exe) we specifically embed a copy of # sqlite3.c, and not link to libsqlite3.so or libsqlite3.a, because @@ -2116,6 +2128,7 @@ xbin: threadtest5 sqlite3$(T.exe): shell.c sqlite3.c $(T.link) -o $@ \ shell.c sqlite3.c \ + $(sqlite3shell.flags.$(STATIC_CLI_SHELL)) \ $(CFLAGS.readline) $(SHELL_OPT) $(CFLAGS.icu) \ $(LDFLAGS.libsqlite3) $(LDFLAGS.readline) # diff --git a/manifest b/manifest index feea4bbd4d..c58b0309c5 100644 --- a/manifest +++ b/manifest @@ -1,10 +1,10 @@ -C Add\sthe\s--static-tclsqlite3\sconfigure\sflag\s(canonical\sbuild\sonly)\sto\sbuild\stclsqlite3\sas\sa\sstatic\sbinary.\sThis\swill\sonly\swork\son\ssystems\swhich\shave\sstatic\sversions\sof\sall\srequisite\slibraries. -D 2025-04-03T00:46:34.141 +C Add\sthe\s--static-cli-shell\sconfigure\sflag\sto\sthe\scanonical\sbuild,\swhich\sworks\slike\s--static-tclsqlite3\sbut\sapplies\sto\sthe\sCLI\sshell\s(statically\slinking\sit,\swhich\sonly\sworks\sif\sall\srequisite\slibs\sare\savailable\sin\sstatic\sform).\sIt\sis\snot\scalled\s--static-shell\sbecause\sthat\sflag\shas\sa\scompletely\sdifferent\slegacy\smeaning\sin\sthe\sautoconf\sbuild\sand\sthis\sflight\smight\seventually\sbe\sadded\sto\sthat\sbuild,\sso\swould\scollide\sthere. +D 2025-04-03T13:24:38.684 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d -F Makefile.in 57de35a9052fe38caa88ee8d81c884c37383160518daec42ffce12b44d848402 +F Makefile.in 6fabbdf631cae9fb53a9926130da019f8e3b8838fcc561a4a37e7f4ba5b14812 F Makefile.linux-generic bd3e3cacd369821a6241d4ea1967395c962dfe3057e38cb0a435cee0e8b789d0 F Makefile.msc bb2cc6f75bbcb2d690fbdd1489914a2febd5e99bad9c77538cb3330d304694c6 F README.md a953c0cffd6e4f2501a306c00ee2b6e1e6630c25031e094629307fe99dd003d1 @@ -15,7 +15,7 @@ F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2 F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90 F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2 F art/sqlite370.svg 40b7e2fe8aac3add5d56dd86ab8d427a4eca5bcb3fe4f8946cb3794e1821d531 -F auto.def 05e0308a9c2adcd13059f5956f1568e7fa05dbc9cd5109436bfa19bd4dcfc020 +F auto.def 30d67e36e62a5db6a4faa0594d81386046a988ad2c20c76d8c9fa426b4106911 F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac F autoconf/Makefile.in 66d98d473556c4e2daf7252355f4b5db129091800027f280082804eb4c45784f F autoconf/Makefile.msc 5bc67d3912444c40c6f96d003e5c90663e51abb83d204a520110b1b2038dcd8b @@ -52,7 +52,7 @@ F autosetup/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1 F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba F autosetup/proj.tcl b3c30cd29f16fdf76196c11391038d7fee32e1cfac2a47546dc058df1c0e075a -F autosetup/sqlite-config.tcl 286524d08fa4f4d1d024a8398559499bc83516480c50259d07e51444b6d2f5c7 +F autosetup/sqlite-config.tcl e098453e03d13bd1cff3c7f48db98c74f4ff0ab3c1ce6a5e40871a1e74315249 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x F contrib/sqlitecon.tcl eb4c6578e08dd353263958da0dc620f8400b869a50d06e271ab0be85a51a08d3 @@ -709,7 +709,7 @@ F ext/wasm/tests/opfs/sahpool/sahpool-pausing.js f264925cfc82155de38cecb3d204c36 F ext/wasm/tests/opfs/sahpool/sahpool-worker.js bd25a43fc2ab2d1bafd8f2854ad3943ef673f7c3be03e95ecf1612ff6e8e2a61 F ext/wasm/wasmfs.make 68999f5bd8c489239592d59a420f8c627c99169bbd6fa16a404751f757b9f702 F magic.txt 5ade0bc977aa135e79e3faaea894d5671b26107cc91e70783aa7dc83f22f3ba0 -F main.mk 13da3ab171667064178b4a364100d03cdb34ff3048e3705df61a96088f1127a5 +F main.mk 6a5fb65a70b6de957ab21e3cbfc0c1c9483fa3360201d85eecb082345f6412eb F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271 F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504 F mptest/crash01.test 61e61469e257df0850df4293d7d4d6c2af301421 @@ -2216,9 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 9e903953ba986df98435da40e94fdb645f6f72279552cba63ef50cec1fe3b486 06f1143870280d335daf4e7027fe8771e34415aa1234fe72c0c450c347b8146c -R f0791f372d19a167ec2ab11f3ba8dad4 -T +closed 06f1143870280d335daf4e7027fe8771e34415aa1234fe72c0c450c347b8146c +P 61836324369e3213841295911aed4f8439a4b2b0f24820c2cf45bb68a0e2cd04 +R 8cb72016593f661ec1b70664fca522d9 U stephan -Z 7aefb2f5ec601c89d2a0e909a620b105 +Z 1ce8105ce198761cc8609ef51909976a # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 4d06d0051a..13897d9287 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -61836324369e3213841295911aed4f8439a4b2b0f24820c2cf45bb68a0e2cd04 +fd2c1638ecc38617f5de0380ad23f233d1159be0712ae2ca4cae5c99e841f1b1 From 99ef94e3ac4b46034dc526ca43a333b55fc5e7b6 Mon Sep 17 00:00:00 2001 From: stephan Date: Fri, 4 Apr 2025 02:40:08 +0000 Subject: [PATCH 057/120] On HaikuOS, if --prefix is not explicitly provided then default it to /boot/home/config/non-packaged, based on an off-list discussion with HaikuOS user BrickViking. FossilOrigin-Name: c4a558291175378f76d126b12417c6c1d8e6060c0ec1267a97d3cd11b4804439 --- autosetup/proj.tcl | 29 +++++++++++++++++++++++++++++ autosetup/sqlite-config.tcl | 1 + manifest | 14 +++++++------- manifest.uuid | 2 +- 4 files changed, 38 insertions(+), 8 deletions(-) diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl index f6826b157b..434e493b9a 100644 --- a/autosetup/proj.tcl +++ b/autosetup/proj.tcl @@ -1438,3 +1438,32 @@ proc proj-tclConfig-sh-to-autosetup {tclConfigSh} { file delete -force $shName } } + +######################################################################## +# @proj-tweak-default-env-dirs +# +# This function is not useful before [use system] is called to set up +# --prefix and friends. +# +# For certain target environments, if --prefix is _not_ passed in by +# the user, set the prefix to an environment-specific default. May +# emit output. For such environments its does [define prefix ...] and +# [proj-opt-set prefix ...], but it does not process vars derived from +# the prefix, e.g. exec-prefix. To do so it is generally necessary, +# late in the config process (immediately before ".in" files are +# filtered) to also call proj-remap-autoconf-dir-vars. +# +# Returns 1 if it modifies the environment, else 0. +proc proj-tweak-default-env-dirs {} { + switch -glob -- [get-define host] { + *-haiku { + set hpre /boot/home/config/non-packaged + if {![proj-opt-was-provided prefix]} { + proj-opt-set prefix $hpre + define prefix $hpre + return 1 + } + } + } + return 0 +} diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl index 4d144e5626..7ab6d69f6d 100644 --- a/autosetup/sqlite-config.tcl +++ b/autosetup/sqlite-config.tcl @@ -24,6 +24,7 @@ if {"--help" ni $::argv} { } use system ; # Will output "Host System" and "Build System" lines if {"--help" ni $::argv} { + proj-tweak-default-env-dirs msg-result "Source dir = $::autosetup(srcdir)" msg-result "Build dir = $::autosetup(builddir)" use cc cc-db cc-shared cc-lib pkg-config diff --git a/manifest b/manifest index c58b0309c5..8e546995e3 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sthe\s--static-cli-shell\sconfigure\sflag\sto\sthe\scanonical\sbuild,\swhich\sworks\slike\s--static-tclsqlite3\sbut\sapplies\sto\sthe\sCLI\sshell\s(statically\slinking\sit,\swhich\sonly\sworks\sif\sall\srequisite\slibs\sare\savailable\sin\sstatic\sform).\sIt\sis\snot\scalled\s--static-shell\sbecause\sthat\sflag\shas\sa\scompletely\sdifferent\slegacy\smeaning\sin\sthe\sautoconf\sbuild\sand\sthis\sflight\smight\seventually\sbe\sadded\sto\sthat\sbuild,\sso\swould\scollide\sthere. -D 2025-04-03T13:24:38.684 +C On\sHaikuOS,\sif\s--prefix\sis\snot\sexplicitly\sprovided\sthen\sdefault\sit\sto\s/boot/home/config/non-packaged,\sbased\son\san\soff-list\sdiscussion\swith\sHaikuOS\suser\sBrickViking. +D 2025-04-04T02:40:08.657 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -51,8 +51,8 @@ F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e F autosetup/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1821baf61bc86a7e F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba -F autosetup/proj.tcl b3c30cd29f16fdf76196c11391038d7fee32e1cfac2a47546dc058df1c0e075a -F autosetup/sqlite-config.tcl e098453e03d13bd1cff3c7f48db98c74f4ff0ab3c1ce6a5e40871a1e74315249 +F autosetup/proj.tcl 54edc60bf8f608b515a7109cd05c673ddc21dffc2c763b4dd871ac2072485dd2 +F autosetup/sqlite-config.tcl 8da064ba9edf03df18014e7e3242e2bbcb3db374866ad26e2acd08a4c53751bb F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x F contrib/sqlitecon.tcl eb4c6578e08dd353263958da0dc620f8400b869a50d06e271ab0be85a51a08d3 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 61836324369e3213841295911aed4f8439a4b2b0f24820c2cf45bb68a0e2cd04 -R 8cb72016593f661ec1b70664fca522d9 +P fd2c1638ecc38617f5de0380ad23f233d1159be0712ae2ca4cae5c99e841f1b1 +R 75944a4ecd66309972a2e0bcf3170747 U stephan -Z 1ce8105ce198761cc8609ef51909976a +Z 2b58a487000aab207aec456d9e913727 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 13897d9287..ff448994e4 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -fd2c1638ecc38617f5de0380ad23f233d1159be0712ae2ca4cae5c99e841f1b1 +c4a558291175378f76d126b12417c6c1d8e6060c0ec1267a97d3cd11b4804439 From 16aa90bba4981bd1bb945f9e9c8b88f2be695394 Mon Sep 17 00:00:00 2001 From: stephan Date: Fri, 4 Apr 2025 03:16:47 +0000 Subject: [PATCH 058/120] Make the --static-cli-shell flag available in the autoconf build mode. FossilOrigin-Name: b78a474ecba6cae4f0e867a515c214fbfe229808145df1870315328d4e13d462 --- autoconf/Makefile.in | 13 +++++++++++++ autoconf/auto.def | 4 ++++ autosetup/sqlite-config.tcl | 9 ++++----- main.mk | 8 ++++---- manifest | 18 +++++++++--------- manifest.uuid | 2 +- 6 files changed, 35 insertions(+), 19 deletions(-) diff --git a/autoconf/Makefile.in b/autoconf/Makefile.in index c4e91baa2d..923075c8ec 100644 --- a/autoconf/Makefile.in +++ b/autoconf/Makefile.in @@ -229,9 +229,22 @@ sqlite3-shell-link-flags.1 = $(TOP)/sqlite3.c $(LDFLAGS.libsqlite3) sqlite3-shell-link-flags.0 = -L. -lsqlite3 $(LDFLAGS.zlib) sqlite3-shell-deps.1 = $(TOP)/sqlite3.c sqlite3-shell-deps.0 = $(libsqlite3.DLL) +# +# STATIC_CLI_SHELL = 1 to statically link sqlite3$(T.exe), else +# 0. Requires static versions of all requisite libraries. Primarily +# intended for use with static-friendly environments like Alpine +# Linux. +# +STATIC_CLI_SHELL = @STATIC_CLI_SHELL@ +# +# sqlite3-shell-static.flags.N = N is $(STATIC_CLI_SHELL) +# +sqlite3-shell-static.flags.1 = -static +sqlite3-shell-static.flags.0 = sqlite3$(T.exe): $(TOP)/shell.c $(sqlite3-shell-deps.$(ENABLE_STATIC_SHELL)) $(CC) -o $@ \ $(TOP)/shell.c $(sqlite3-shell-link-flags.$(ENABLE_STATIC_SHELL)) \ + $(sqlite3-shell-static.flags.$(STATIC_CLI_SHELL)) \ -I. $(OPT_FEATURE_FLAGS) $(SHELL_OPT) \ $(CFLAGS) $(CFLAGS.readline) $(CFLAGS.icu) \ $(LDFLAGS) $(LDFLAGS.readline) diff --git a/autoconf/auto.def b/autoconf/auto.def index 146ca00673..c61d81e506 100644 --- a/autoconf/auto.def +++ b/autoconf/auto.def @@ -11,6 +11,10 @@ sqlite-configure autoconf { sqlite-check-common-system-deps proj-define-for-opt static-shell ENABLE_STATIC_SHELL \ "Link library statically into the CLI shell?" + proj-define-for-opt static-cli-shell STATIC_CLI_SHELL "Statically link CLI shell?" + if {![opt-bool static-shell] && [opt-bool static-cli-shell]} { + proj-fatal "--disable-static-shell and --static-cli-shell are mutualy exclusive" + } if {![opt-bool shared] && ![opt-bool static-shell]} { proj-opt-set shared 1 proj-indented-notice { diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl index 7ab6d69f6d..036352a62c 100644 --- a/autosetup/sqlite-config.tcl +++ b/autosetup/sqlite-config.tcl @@ -281,19 +281,18 @@ proc sqlite-configure {buildMode configScript} { => {Top-most dir of the wasi-sdk for a WASI build} } - {canonical} { + {*} { # Note that --static-cli-shell has a completely different # meaning from --static-shell in the autoconf build! # --[disable-]static-shell is a legacy flag which we can't - # remove without breaking downstream builds. We _could_ - # recycle the name --static-shell here, as this flag is - # (currently) independent of the one in the autoconf build, - # but that would likely lead to confusion. + # remove without breaking downstream builds. static-cli-shell=0 => {Statically-link the sqlite3 CLI shell. This only works if the requisite libraries are all available in static form.} + } + {canonical} { static-shells=0 => {Shorthand for --static-cli-shell --static-tclsqlite3} diff --git a/main.mk b/main.mk index 47c61653ed..a79afe029a 100644 --- a/main.mk +++ b/main.mk @@ -2112,10 +2112,10 @@ xbin: threadtest5 # STATIC_CLI_SHELL ?= 0 # -# sqlite3shell.flags.N = N is $(STATIC_CLI_SHELL) +# sqlite3-shell-static.flags.N = N is $(STATIC_CLI_SHELL) # -sqlite3shell.flags.1 = -static -sqlite3shell.flags.0 = +sqlite3-shell-static.flags.1 = -static +sqlite3-shell-static.flags.0 = # # When building sqlite3$(T.exe) we specifically embed a copy of # sqlite3.c, and not link to libsqlite3.so or libsqlite3.a, because @@ -2128,7 +2128,7 @@ sqlite3shell.flags.0 = sqlite3$(T.exe): shell.c sqlite3.c $(T.link) -o $@ \ shell.c sqlite3.c \ - $(sqlite3shell.flags.$(STATIC_CLI_SHELL)) \ + $(sqlite3-shell-static.flags.$(STATIC_CLI_SHELL)) \ $(CFLAGS.readline) $(SHELL_OPT) $(CFLAGS.icu) \ $(LDFLAGS.libsqlite3) $(LDFLAGS.readline) # diff --git a/manifest b/manifest index 8e546995e3..f95a25cf24 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C On\sHaikuOS,\sif\s--prefix\sis\snot\sexplicitly\sprovided\sthen\sdefault\sit\sto\s/boot/home/config/non-packaged,\sbased\son\san\soff-list\sdiscussion\swith\sHaikuOS\suser\sBrickViking. -D 2025-04-04T02:40:08.657 +C Make\sthe\s--static-cli-shell\sflag\savailable\sin\sthe\sautoconf\sbuild\smode. +D 2025-04-04T03:16:47.799 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -17,11 +17,11 @@ F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2 F art/sqlite370.svg 40b7e2fe8aac3add5d56dd86ab8d427a4eca5bcb3fe4f8946cb3794e1821d531 F auto.def 30d67e36e62a5db6a4faa0594d81386046a988ad2c20c76d8c9fa426b4106911 F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac -F autoconf/Makefile.in 66d98d473556c4e2daf7252355f4b5db129091800027f280082804eb4c45784f +F autoconf/Makefile.in 10e274d965584af947be20213e0052112ee8dec928134d20e256f5fc4c51b758 F autoconf/Makefile.msc 5bc67d3912444c40c6f96d003e5c90663e51abb83d204a520110b1b2038dcd8b F autoconf/README.first f1d3876e9a7852c22f275a6f06814e64934cecbc0b5b9617d64849094c1fd136 F autoconf/README.txt 1a32296d8bbdd67110c79d224c92c05545a0b5bd0c272950025fe3c7c7b49580 -F autoconf/auto.def b140692fe36c1661a6fe4185fe0076e8fa27a3cdc556b92f252f9ca68ce9d855 +F autoconf/auto.def 3d994f3a9cc9b712dbce92a5708570ddcf3b988141b6eb738f2ed16127a9f0ac F autoconf/tea/Makefile.in ba0556fee8da09c066bad85a4457904e46ee2c2eabaa309c0e83a78f2f151a8e F autoconf/tea/README.txt 6c396709b45eb2b3be0ae6dc7e40a140d231962e3a2354da6c4dd48b1d9999bc F autoconf/tea/aclocal.m4 52c47aac44ce0ddb1f918b6993e8beb8eee88f43 @@ -52,7 +52,7 @@ F autosetup/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1 F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba F autosetup/proj.tcl 54edc60bf8f608b515a7109cd05c673ddc21dffc2c763b4dd871ac2072485dd2 -F autosetup/sqlite-config.tcl 8da064ba9edf03df18014e7e3242e2bbcb3db374866ad26e2acd08a4c53751bb +F autosetup/sqlite-config.tcl c197e3275b1723e7a2c1cc9c9f8aeca67b7159617924e1db78ba02901c6a69c3 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x F contrib/sqlitecon.tcl eb4c6578e08dd353263958da0dc620f8400b869a50d06e271ab0be85a51a08d3 @@ -709,7 +709,7 @@ F ext/wasm/tests/opfs/sahpool/sahpool-pausing.js f264925cfc82155de38cecb3d204c36 F ext/wasm/tests/opfs/sahpool/sahpool-worker.js bd25a43fc2ab2d1bafd8f2854ad3943ef673f7c3be03e95ecf1612ff6e8e2a61 F ext/wasm/wasmfs.make 68999f5bd8c489239592d59a420f8c627c99169bbd6fa16a404751f757b9f702 F magic.txt 5ade0bc977aa135e79e3faaea894d5671b26107cc91e70783aa7dc83f22f3ba0 -F main.mk 6a5fb65a70b6de957ab21e3cbfc0c1c9483fa3360201d85eecb082345f6412eb +F main.mk 9692d882ecb43332b62295b3d0aa5ba356d4c2ad387d322b85e5bc98800e9285 F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271 F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504 F mptest/crash01.test 61e61469e257df0850df4293d7d4d6c2af301421 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P fd2c1638ecc38617f5de0380ad23f233d1159be0712ae2ca4cae5c99e841f1b1 -R 75944a4ecd66309972a2e0bcf3170747 +P c4a558291175378f76d126b12417c6c1d8e6060c0ec1267a97d3cd11b4804439 +R 323df9d0766ff525fd5427ef9afc611e U stephan -Z 2b58a487000aab207aec456d9e913727 +Z 4eda3565de01e245dc2fae5ec79e9846 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index ff448994e4..5a118c861d 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -c4a558291175378f76d126b12417c6c1d8e6060c0ec1267a97d3cd11b4804439 +b78a474ecba6cae4f0e867a515c214fbfe229808145df1870315328d4e13d462 From 29b496a2d5c1f2ded7e1087f39bd6c1d642bda4c Mon Sep 17 00:00:00 2001 From: stephan Date: Fri, 4 Apr 2025 03:26:20 +0000 Subject: [PATCH 059/120] Minor configure script internal doc edits. No functional changes. FossilOrigin-Name: 357563bc7c01a744d4038ed3ccc475260b819e98cf90a4270764f79c73d2497e --- autosetup/proj.tcl | 12 ++++++------ manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl index 434e493b9a..b759f9bff6 100644 --- a/autosetup/proj.tcl +++ b/autosetup/proj.tcl @@ -1446,12 +1446,12 @@ proc proj-tclConfig-sh-to-autosetup {tclConfigSh} { # --prefix and friends. # # For certain target environments, if --prefix is _not_ passed in by -# the user, set the prefix to an environment-specific default. May -# emit output. For such environments its does [define prefix ...] and -# [proj-opt-set prefix ...], but it does not process vars derived from -# the prefix, e.g. exec-prefix. To do so it is generally necessary, -# late in the config process (immediately before ".in" files are -# filtered) to also call proj-remap-autoconf-dir-vars. +# the user, set the prefix to an environment-specific default. For +# such environments its does [define prefix ...] and [proj-opt-set +# prefix ...], but it does not process vars derived from the prefix, +# e.g. exec-prefix. To do so it is generally necessary to also call +# proj-remap-autoconf-dir-vars late in the config process (immediately +# before ".in" files are filtered). # # Returns 1 if it modifies the environment, else 0. proc proj-tweak-default-env-dirs {} { diff --git a/manifest b/manifest index f95a25cf24..34318f8d3a 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Make\sthe\s--static-cli-shell\sflag\savailable\sin\sthe\sautoconf\sbuild\smode. -D 2025-04-04T03:16:47.799 +C Minor\sconfigure\sscript\sinternal\sdoc\sedits.\sNo\sfunctional\schanges. +D 2025-04-04T03:26:20.472 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -51,7 +51,7 @@ F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e F autosetup/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1821baf61bc86a7e F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba -F autosetup/proj.tcl 54edc60bf8f608b515a7109cd05c673ddc21dffc2c763b4dd871ac2072485dd2 +F autosetup/proj.tcl dfead6099674665c1b59f54e740b47bc6d00dded5e58460528140725fefcb4bf F autosetup/sqlite-config.tcl c197e3275b1723e7a2c1cc9c9f8aeca67b7159617924e1db78ba02901c6a69c3 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P c4a558291175378f76d126b12417c6c1d8e6060c0ec1267a97d3cd11b4804439 -R 323df9d0766ff525fd5427ef9afc611e +P b78a474ecba6cae4f0e867a515c214fbfe229808145df1870315328d4e13d462 +R 9aa2d52ba180605dad925fa228fdde81 U stephan -Z 4eda3565de01e245dc2fae5ec79e9846 +Z 2db58c825c2b8a1bbf25d32c18ff3da7 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 5a118c861d..27edce24a0 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -b78a474ecba6cae4f0e867a515c214fbfe229808145df1870315328d4e13d462 +357563bc7c01a744d4038ed3ccc475260b819e98cf90a4270764f79c73d2497e From 283d0ee4c6942e63b0a287f9faeb795ecbaff9c1 Mon Sep 17 00:00:00 2001 From: stephan Date: Fri, 4 Apr 2025 13:08:43 +0000 Subject: [PATCH 060/120] Minor configure-internal cleanups to support the autosetup port of the TEA build. FossilOrigin-Name: 244c2b75c10c68bc0499d60b707a925836a4b9d490813785587522109fc11fe2 --- auto.def | 2 +- autosetup/proj.tcl | 3 ++- autosetup/sqlite-config.tcl | 9 ++++----- manifest | 16 ++++++++-------- manifest.uuid | 2 +- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/auto.def b/auto.def index 8281888cc7..43c597551b 100644 --- a/auto.def +++ b/auto.def @@ -61,4 +61,4 @@ sqlite-configure canonical { proj-define-for-opt static-tclsqlite3 STATIC_TCLSQLITE3 "Statically link tclsqlite3?" proj-define-for-opt static-cli-shell STATIC_CLI_SHELL "Statically link CLI shell?" -} +}; # sqlite-configure diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl index b759f9bff6..b8b9d3dcb7 100644 --- a/autosetup/proj.tcl +++ b/autosetup/proj.tcl @@ -1443,7 +1443,8 @@ proc proj-tclConfig-sh-to-autosetup {tclConfigSh} { # @proj-tweak-default-env-dirs # # This function is not useful before [use system] is called to set up -# --prefix and friends. +# --prefix and friends. It should be called as soon after [use system] +# as feasible. # # For certain target environments, if --prefix is _not_ passed in by # the user, set the prefix to an environment-specific default. For diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl index 036352a62c..3b07621bac 100644 --- a/autosetup/sqlite-config.tcl +++ b/autosetup/sqlite-config.tcl @@ -2088,12 +2088,11 @@ proc sqlite-determine-codegen-tcl {} { }; # sqlite-determine-codegen-tcl ######################################################################## -# Runs sqlite-check-tcl and, if $alsoCheckCodeGen is true, -# sqlite-determine-codegen-tcl (intended only for the canonical -# build). -proc sqlite-handle-tcl {{alsoCheckCodeGen 1}} { +# Runs sqlite-check-tcl and, if this is the canonical build, +# sqlite-determine-codegen-tcl. +proc sqlite-handle-tcl {} { sqlite-check-tcl - if {$alsoCheckCodeGen} { + if {"canonical" eq $::sqliteConfig(build-mode)} { msg-result "TCL for code generation: [sqlite-determine-codegen-tcl]" } } diff --git a/manifest b/manifest index 34318f8d3a..bcf2bc662d 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Minor\sconfigure\sscript\sinternal\sdoc\sedits.\sNo\sfunctional\schanges. -D 2025-04-04T03:26:20.472 +C Minor\sconfigure-internal\scleanups\sto\ssupport\sthe\sautosetup\sport\sof\sthe\sTEA\sbuild. +D 2025-04-04T13:08:43.411 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -15,7 +15,7 @@ F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2 F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90 F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2 F art/sqlite370.svg 40b7e2fe8aac3add5d56dd86ab8d427a4eca5bcb3fe4f8946cb3794e1821d531 -F auto.def 30d67e36e62a5db6a4faa0594d81386046a988ad2c20c76d8c9fa426b4106911 +F auto.def 82c32443a91c1062f7a48beec37dbb2d8d03447b1286bce8df5ebb6d8d353f8a F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac F autoconf/Makefile.in 10e274d965584af947be20213e0052112ee8dec928134d20e256f5fc4c51b758 F autoconf/Makefile.msc 5bc67d3912444c40c6f96d003e5c90663e51abb83d204a520110b1b2038dcd8b @@ -51,8 +51,8 @@ F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e F autosetup/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1821baf61bc86a7e F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba -F autosetup/proj.tcl dfead6099674665c1b59f54e740b47bc6d00dded5e58460528140725fefcb4bf -F autosetup/sqlite-config.tcl c197e3275b1723e7a2c1cc9c9f8aeca67b7159617924e1db78ba02901c6a69c3 +F autosetup/proj.tcl 89b1822a66b4d6a286c959b3c26093e35926bf86db56cc1887ddcb130001f76a +F autosetup/sqlite-config.tcl 858c567f0b945e690c693c8e0860ae591596e9221760de643d3f4c1a46ce238c F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x F contrib/sqlitecon.tcl eb4c6578e08dd353263958da0dc620f8400b869a50d06e271ab0be85a51a08d3 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P b78a474ecba6cae4f0e867a515c214fbfe229808145df1870315328d4e13d462 -R 9aa2d52ba180605dad925fa228fdde81 +P 357563bc7c01a744d4038ed3ccc475260b819e98cf90a4270764f79c73d2497e +R ef52006426abfa48ef858a065d3f7a17 U stephan -Z 2db58c825c2b8a1bbf25d32c18ff3da7 +Z 0cc8fc7951010a8bd69a18e1e79e4610 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 27edce24a0..ddea5dc6c4 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -357563bc7c01a744d4038ed3ccc475260b819e98cf90a4270764f79c73d2497e +244c2b75c10c68bc0499d60b707a925836a4b9d490813785587522109fc11fe2 From 82d05b7b541b6d3857162d876c7cfa805258369d Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 4 Apr 2025 13:23:03 +0000 Subject: [PATCH 061/120] The win32lock and win32longpath tests don't work on Cygwin FossilOrigin-Name: 32ef3f26e7fb34dfdb23617a19bb9baa2e4c3dca564a88850b58a0fbe6446cf8 --- manifest | 18 +++++++++--------- manifest.uuid | 2 +- src/test1.c | 2 +- test/win32lock.test | 2 +- test/win32longpath.test | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/manifest b/manifest index bcf2bc662d..aeb3cf252f 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Minor\sconfigure-internal\scleanups\sto\ssupport\sthe\sautosetup\sport\sof\sthe\sTEA\sbuild. -D 2025-04-04T13:08:43.411 +C The\swin32lock\sand\swin32longpath\stests\sdon't\swork\son\sCygwin +D 2025-04-04T13:23:03.839 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -796,7 +796,7 @@ F src/status.c 0e72e4f6be6ccfde2488eb63210297e75f569f3ce9920f6c3d77590ec6ce5ffd F src/table.c 0f141b58a16de7e2fbe81c308379e7279f4c6b50eb08efeec5892794a0ba30d1 F src/tclsqlite.c 767a11d470b031e85f51b8924a0e8929b2362ff1975aee3474a10eba3c2e0d36 F src/tclsqlite.h 65e2c761446e1c9fa0342b7d2612a703483643c8b6a316d12a65b745a4727395 -F src/test1.c e89a11192dd15da20e8f7dc0731297182b2fff56cf4afe6ca6f9aeab890595c5 +F src/test1.c 9b54135e5f1352f06b1d23d7c183f124c1f33de6ea8997cd801f0f215c43591d F src/test2.c 62f0830958f9075692c29c6de51b495ae8969e1bef85f239ffcd9ba5fb44a5ff F src/test3.c 432646f581d8af1bb495e58fc98234380250954f5d5535e507fc785eccc3987a F src/test4.c 0ac87fc13cdb334ab3a71823f99b6c32a6bebe5d603cd6a71d84c823d43a25a0 @@ -2070,8 +2070,8 @@ F test/wherelimit2.test b9e4bfe7b4d7c2f85f99cf2bd2c51369378d04b1f3d1b60557423752 F test/wherelimit3.test 22d73e046870cf8bbe15573eda6b432b07ebe64a88711f9f849c6b3667c1fae6 F test/widetab1.test c296a98e123762de79917350e45fa33fdf88577a2571eb3a64c8bf7e44ef74d1 F test/win32heap.test 1ec2ce646aee491ec23bfcdfd005b33c79f13bf91467966f374a76ffe7c7e85f -F test/win32lock.test 4fc496691504d90621157aa43b1155a1461347261ad182c3e3d5923f4e0b879c -F test/win32longpath.test df477a2891bd6a1a4e78e43290ea219a777da85eb2590092e36da65f2fb5f1cf +F test/win32lock.test e56d7a9b6cf9d5f3867c2dd19ff36c5326881e4038c6867610ecb3a9868ea4eb +F test/win32longpath.test 0f9837039b306735c13521c5f25b6ed42937b600dace58e28a3d2f8baf429b6a F test/win32nolock.test 95854dc0206b8a95e4aee15a76acc082767b38f079b2e24676aed6cbb0f32798 F test/window1.test 79dc3b9a2226f622d7e104a1fc750d1c4c3c08d6147b59085bdbe05352947ffa F test/window2.tcl 492c125fa550cda1dd3555768a2303b3effbeceee215293adf8871efc25f1476 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 357563bc7c01a744d4038ed3ccc475260b819e98cf90a4270764f79c73d2497e -R ef52006426abfa48ef858a065d3f7a17 -U stephan -Z 0cc8fc7951010a8bd69a18e1e79e4610 +P 244c2b75c10c68bc0499d60b707a925836a4b9d490813785587522109fc11fe2 +R dd73bc19146d018b472217465906040b +U jan.nijtmans +Z 0a9d51a17f8a004b247523e8da988010 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index ddea5dc6c4..0d33878e2b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -244c2b75c10c68bc0499d60b707a925836a4b9d490813785587522109fc11fe2 +32ef3f26e7fb34dfdb23617a19bb9baa2e4c3dca564a88850b58a0fbe6446cf8 diff --git a/src/test1.c b/src/test1.c index f86fef36ff..bb2f2d3b9d 100644 --- a/src/test1.c +++ b/src/test1.c @@ -7984,7 +7984,7 @@ struct win32FileLocker { #endif -#if SQLITE_OS_WIN +#ifdef _WIN32 #include /* ** The background thread that does file locking. diff --git a/test/win32lock.test b/test/win32lock.test index 96cdfa7fd8..40ff5d5127 100644 --- a/test/win32lock.test +++ b/test/win32lock.test @@ -15,7 +15,7 @@ # TESTRUNNER: slow # -if {$tcl_platform(os) ne "Windows NT"} return +if {$tcl_platform(platform) ne "windows"} return set testdir [file dirname $argv0] source $testdir/tester.tcl diff --git a/test/win32longpath.test b/test/win32longpath.test index 419a371f18..2545c55a16 100644 --- a/test/win32longpath.test +++ b/test/win32longpath.test @@ -13,7 +13,7 @@ # by the "win32-longpath" VFS. # -if {$tcl_platform(os) ne "Windows NT"} return +if {$tcl_platform(platform) ne "windows"} return set testdir [file dirname $argv0] source $testdir/tester.tcl From 91db54f07ad3fee7d0b6c63ddf139e409083293a Mon Sep 17 00:00:00 2001 From: stephan Date: Fri, 4 Apr 2025 15:41:19 +0000 Subject: [PATCH 062/120] Improve --all flag handling so that combinations of (--all --disable-FEATURE) and (--disable-all --FEATURE) work more intuitively. Add missing handling of the --fts3 flag (it was accepted but ignored before). Add TCL_LIBS to the set of vars exported via tclConfig.sh for use in the tea build. FossilOrigin-Name: 26ef0ff4bfbb4425baa26fa5c8420f5da0603c38ef651104e566c7dc85bfaa3a --- autosetup/proj.tcl | 1 + autosetup/sqlite-config.tcl | 44 +++++++++++++++++++++++++++++-------- manifest | 16 +++++++------- manifest.uuid | 2 +- 4 files changed, 45 insertions(+), 18 deletions(-) diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl index b8b9d3dcb7..707da947e7 100644 --- a/autosetup/proj.tcl +++ b/autosetup/proj.tcl @@ -1402,6 +1402,7 @@ proc proj-tclConfig-sh-to-autosetup {tclConfigSh} { set shBody {} set tclVars { TCL_INCLUDE_SPEC + TCL_LIBS TCL_LIB_SPEC TCL_STUB_LIB_SPEC TCL_EXEC_PREFIX diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl index 3b07621bac..00f35cad1e 100644 --- a/autosetup/sqlite-config.tcl +++ b/autosetup/sqlite-config.tcl @@ -720,15 +720,41 @@ proc sqlite-setup-default-cflags {} { # Handle various SQLITE_ENABLE/OMIT_... feature flags. proc sqlite-handle-common-feature-flags {} { msg-result "Feature flags..." - foreach {boolFlag featureFlag ifSetEvalThis} { - all {} { - # The 'all' option must be first in this list. - proj-opt-set fts4 - proj-opt-set fts5 - proj-opt-set geopoly - proj-opt-set rtree - proj-opt-set session + if {"tcl-extension" eq $::sqliteConfig(build-mode)} { + set allFlagEnables {fts3 fts4 fts5 rtree geopoly} + } else { + set allFlagEnables {fts4 fts5 rtree rtree geopoly session} + } + if {![opt-bool all]} { + # Special handling for --disable-all + foreach flag $allFlagEnables { + if {![proj-opt-was-provided $flag]} { + proj-opt-set $flag 0 + } } + } + foreach {boolFlag featureFlag ifSetEvalThis} [proj-strip-hash-comments { + all {} { + # The 'all' option must be first in this list. This impl makes + # an effort to only apply flags which the user did not already + # apply, so that combinations like (--all --disable-geopoly) + # will indeed disable geopoly. There are corner cases where + # flags which depend on each other will behave in non-intuitive + # ways: + # + # --all --disable-rtree + # + # Will NOT disable geopoly, though geopoly depends on rtree. + # The --geopoly flag, though, will automatically re-enable + # --rtree, so --disable-rtree won't actually disable anything in + # that case. + foreach k $allFlagEnables { + if {![proj-opt-was-provided $k]} { + proj-opt-set $k 1 + } + } + } + fts3 -DSQLITE_ENABLE_FTS3 {sqlite-affirm-have-math fts3} fts4 -DSQLITE_ENABLE_FTS4 {sqlite-affirm-have-math fts4} fts5 -DSQLITE_ENABLE_FTS5 {sqlite-affirm-have-math fts5} geopoly -DSQLITE_ENABLE_GEOPOLY {proj-opt-set rtree} @@ -745,7 +771,7 @@ proc sqlite-handle-common-feature-flags {} { } } scanstatus -DSQLITE_ENABLE_STMT_SCANSTATUS {} - } { + }] { if {$boolFlag ni $::autosetup(options)} { # Skip flags which are in the canonical build but not # the autoconf bundle. diff --git a/manifest b/manifest index aeb3cf252f..9e35c1a15d 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C The\swin32lock\sand\swin32longpath\stests\sdon't\swork\son\sCygwin -D 2025-04-04T13:23:03.839 +C Improve\s--all\sflag\shandling\sso\sthat\scombinations\sof\s(--all\s--disable-FEATURE)\sand\s(--disable-all\s--FEATURE)\swork\smore\sintuitively.\sAdd\smissing\shandling\sof\sthe\s--fts3\sflag\s(it\swas\saccepted\sbut\signored\sbefore).\sAdd\sTCL_LIBS\sto\sthe\sset\sof\svars\sexported\svia\stclConfig.sh\sfor\suse\sin\sthe\stea\sbuild. +D 2025-04-04T15:41:19.342 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -51,8 +51,8 @@ F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e F autosetup/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1821baf61bc86a7e F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba -F autosetup/proj.tcl 89b1822a66b4d6a286c959b3c26093e35926bf86db56cc1887ddcb130001f76a -F autosetup/sqlite-config.tcl 858c567f0b945e690c693c8e0860ae591596e9221760de643d3f4c1a46ce238c +F autosetup/proj.tcl 1e244d61c93fd79586be59e4718f8e3538ee47a9cbff325f62f7b222863c2fea +F autosetup/sqlite-config.tcl 294a1e0e0f4c39bb210523b148e286d9f70a18f8f7407388ac77878da58c8a5c F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x F contrib/sqlitecon.tcl eb4c6578e08dd353263958da0dc620f8400b869a50d06e271ab0be85a51a08d3 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 244c2b75c10c68bc0499d60b707a925836a4b9d490813785587522109fc11fe2 -R dd73bc19146d018b472217465906040b -U jan.nijtmans -Z 0a9d51a17f8a004b247523e8da988010 +P 32ef3f26e7fb34dfdb23617a19bb9baa2e4c3dca564a88850b58a0fbe6446cf8 +R 0155e095440bdd5fe99e88b4e49cb70c +U stephan +Z a056ac7f76093e9e0558ddb35384b15d # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 0d33878e2b..c952cb3795 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -32ef3f26e7fb34dfdb23617a19bb9baa2e4c3dca564a88850b58a0fbe6446cf8 +26ef0ff4bfbb4425baa26fa5c8420f5da0603c38ef651104e566c7dc85bfaa3a From 24fe85b99a975094d835ea3f895b16e572512ad4 Mon Sep 17 00:00:00 2001 From: stephan Date: Fri, 4 Apr 2025 16:17:02 +0000 Subject: [PATCH 063/120] Adapt the --all flag to apply to a different set of features, and default to enabled, for the tcl-extension build. FossilOrigin-Name: b229c8f65acf41b57afacfde712c3a8040d3bd5139bd5e30d450669658185ddd --- autosetup/proj.tcl | 3 +++ autosetup/sqlite-config.tcl | 30 ++++++++++++++++++++++-------- manifest | 14 +++++++------- manifest.uuid | 2 +- 4 files changed, 33 insertions(+), 16 deletions(-) diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl index 707da947e7..33f95afa4a 100644 --- a/autosetup/proj.tcl +++ b/autosetup/proj.tcl @@ -345,6 +345,9 @@ proc proj-first-bin-of {args} { # to the default value of baz. If the user does not explicitly pass in # --foo-bar (with or without a value) then this returns 0. # +# Calling [proj-opt-set] is, for purposes of the above, equivalent to +# explicitly passing in the flag. +# # Note: unlike most functions which deal with configure --flags, this # one does not validate that $key refers to a pre-defined flag. i.e. # it accepts arbitrary keys, even those not defined via an [options] diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl index 00f35cad1e..a9375b130f 100644 --- a/autosetup/sqlite-config.tcl +++ b/autosetup/sqlite-config.tcl @@ -60,6 +60,19 @@ array set sqliteConfig [subst [proj-strip-hash-comments { # (dump-defines-txt) but also a JSON file named after this option's # value. dump-defines-json "" + + # + # The list of feature --flags which the --all flag implies. This + # requires special handling in a few places and gets replaced with + # a different list in the tcl-extension build. + # + all-flag-enables {fts4 fts5 rtree geopoly session} + + # + # Default value for the --all flag. Gets changed for the + # tcl-extension build. + # + all-flag-default 0 }]] ######################################################################## @@ -88,6 +101,12 @@ proc sqlite-configure {buildMode configScript} { if {$buildMode ni $allBuildModes} { user-error "Invalid build mode: $buildMode. Expecting one of: $allBuildModes" } + if {$::sqliteConfig(all-flag-default)} { + set allFlagHelp "Disable these extensions: $::sqliteConfig(all-flag-enables)" + } else { + set allFlagHelp "Enable these extensions: $::sqliteConfig(all-flag-enables)" + } + set ::sqliteConfig(build-mode) $buildMode ######################################################################## # A gentle introduction to flags handling in autosetup @@ -194,7 +213,7 @@ proc sqlite-configure {buildMode configScript} { geopoly => {Enable the GEOPOLY extension} rtree => {Enable the RTREE extension} session => {Enable the SESSION extension} - all => {Enable FTS4, FTS5, Geopoly, RTree, Sessions} + all=$::sqliteConfig(all-flag-default) => {$allFlagHelp} largefile=1 => {This legacy flag has no effect on the library but may influence the generated sqlite_cfg.h by adding #define HAVE_LFS} @@ -720,14 +739,9 @@ proc sqlite-setup-default-cflags {} { # Handle various SQLITE_ENABLE/OMIT_... feature flags. proc sqlite-handle-common-feature-flags {} { msg-result "Feature flags..." - if {"tcl-extension" eq $::sqliteConfig(build-mode)} { - set allFlagEnables {fts3 fts4 fts5 rtree geopoly} - } else { - set allFlagEnables {fts4 fts5 rtree rtree geopoly session} - } if {![opt-bool all]} { # Special handling for --disable-all - foreach flag $allFlagEnables { + foreach flag $::sqliteConfig(all-flag-enables) { if {![proj-opt-was-provided $flag]} { proj-opt-set $flag 0 } @@ -748,7 +762,7 @@ proc sqlite-handle-common-feature-flags {} { # The --geopoly flag, though, will automatically re-enable # --rtree, so --disable-rtree won't actually disable anything in # that case. - foreach k $allFlagEnables { + foreach k $::sqliteConfig(all-flag-enables) { if {![proj-opt-was-provided $k]} { proj-opt-set $k 1 } diff --git a/manifest b/manifest index 9e35c1a15d..5931b1dca2 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Improve\s--all\sflag\shandling\sso\sthat\scombinations\sof\s(--all\s--disable-FEATURE)\sand\s(--disable-all\s--FEATURE)\swork\smore\sintuitively.\sAdd\smissing\shandling\sof\sthe\s--fts3\sflag\s(it\swas\saccepted\sbut\signored\sbefore).\sAdd\sTCL_LIBS\sto\sthe\sset\sof\svars\sexported\svia\stclConfig.sh\sfor\suse\sin\sthe\stea\sbuild. -D 2025-04-04T15:41:19.342 +C Adapt\sthe\s--all\sflag\sto\sapply\sto\sa\sdifferent\sset\sof\sfeatures,\sand\sdefault\sto\senabled,\sfor\sthe\stcl-extension\sbuild. +D 2025-04-04T16:17:02.677 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -51,8 +51,8 @@ F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e F autosetup/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1821baf61bc86a7e F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba -F autosetup/proj.tcl 1e244d61c93fd79586be59e4718f8e3538ee47a9cbff325f62f7b222863c2fea -F autosetup/sqlite-config.tcl 294a1e0e0f4c39bb210523b148e286d9f70a18f8f7407388ac77878da58c8a5c +F autosetup/proj.tcl ad2cf7a01c3ff3571fea1da299910c76b00484f6662f3ba7a625051117837e8e +F autosetup/sqlite-config.tcl 4349a7b68e100137b59b9fe27da7d622185a4932b95b77c7b7922800af5920bf F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x F contrib/sqlitecon.tcl eb4c6578e08dd353263958da0dc620f8400b869a50d06e271ab0be85a51a08d3 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 32ef3f26e7fb34dfdb23617a19bb9baa2e4c3dca564a88850b58a0fbe6446cf8 -R 0155e095440bdd5fe99e88b4e49cb70c +P 26ef0ff4bfbb4425baa26fa5c8420f5da0603c38ef651104e566c7dc85bfaa3a +R 5ab57a421300c0c0e5e98ecd6d96713d U stephan -Z a056ac7f76093e9e0558ddb35384b15d +Z 68f06e0eff70f5e6c5a65134984dc57b # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index c952cb3795..b17172fa7d 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -26ef0ff4bfbb4425baa26fa5c8420f5da0603c38ef651104e566c7dc85bfaa3a +b229c8f65acf41b57afacfde712c3a8040d3bd5139bd5e30d450669658185ddd From 31076c5f269a00911bbd764105099ff0bce3550c Mon Sep 17 00:00:00 2001 From: stephan Date: Fri, 4 Apr 2025 20:50:00 +0000 Subject: [PATCH 064/120] Account for the Mac-specific -instal_name linker flag, which is apparently needed for linking some third-party code. See [forum:5651662b8875ec0a|forum post 5651662b8875ec0a]. FossilOrigin-Name: 4947c1c78298253a51939adf6cf70ee233075db6d60cd7a183a4162c926e667c --- Makefile.in | 5 ++++- autoconf/Makefile.in | 6 ++---- autosetup/sqlite-config.tcl | 23 +++++++++++++++++++++++ manifest | 16 ++++++++-------- manifest.uuid | 2 +- 5 files changed, 38 insertions(+), 14 deletions(-) diff --git a/Makefile.in b/Makefile.in index 9f33492b2d..57728b0498 100644 --- a/Makefile.in +++ b/Makefile.in @@ -122,10 +122,13 @@ LDFLAGS.rt = @LDFLAGS_RT@ CFLAGS.icu = @CFLAGS_ICU@ LDFLAGS.libsqlite3.soname = @LDFLAGS_LIBSQLITE3_SONAME@ # soname: see https://sqlite.org/src/forumpost/5a3b44f510df8ded -LDFLAGS.libsqlite3.os-specific = @LDFLAGS_MAC_CVERSION@ @LDFLAGS_OUT_IMPLIB@ +LDFLAGS.libsqlite3.os-specific = \ + @LDFLAGS_MAC_CVERSION@ @LDFLAGS_MAC_INSTALL_NAME@ @LDFLAGS_OUT_IMPLIB@ # os-specific: see # - https://sqlite.org/forum/forumpost/9dfd5b8fd525a5d7 # - https://sqlite.org/forum/forumpost/0c7fc097b2 +# - https://sqlite.org/forum/forumpost/5651662b8875ec0a + libsqlite3.DLL.basename = @SQLITE_DLL_BASENAME@ # DLL.basename: see https://sqlite.org/forum/forumpost/828fdfe904 libsqlite3.out.implib = @SQLITE_OUT_IMPLIB@ diff --git a/autoconf/Makefile.in b/autoconf/Makefile.in index 923075c8ec..633bfd41e1 100644 --- a/autoconf/Makefile.in +++ b/autoconf/Makefile.in @@ -125,10 +125,8 @@ OPT_FEATURE_FLAGS = @OPT_FEATURE_FLAGS@ LDFLAGS.libsqlite3.soname = @LDFLAGS_LIBSQLITE3_SONAME@ # soname: see https://sqlite.org/src/forumpost/5a3b44f510df8ded -LDFLAGS.libsqlite3.os-specific = @LDFLAGS_MAC_CVERSION@ @LDFLAGS_OUT_IMPLIB@ -# os-specific: see -# - https://sqlite.org/forum/forumpost/9dfd5b8fd525a5d7 -# - https://sqlite.org/forum/forumpost/0c7fc097b2 +LDFLAGS.libsqlite3.os-specific = \ + @LDFLAGS_MAC_CVERSION@ @LDFLAGS_MAC_INSTALL_NAME@ @LDFLAGS_OUT_IMPLIB@ LDFLAGS.libsqlite3 = \ $(LDFLAGS.rpath) $(LDFLAGS.pthread) \ diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl index a9375b130f..8a99d774e4 100644 --- a/autosetup/sqlite-config.tcl +++ b/autosetup/sqlite-config.tcl @@ -1508,6 +1508,28 @@ proc sqlite-handle-mac-cversion {} { return $rc } +######################################################################## +# If this is a Mac platform, check for support for +# -Wl,-install_name,... and, if it's set, define +# LDFLAGS_MAC_INSTALL_NAME to a variant of that string which is +# intended to expand at make-time, else set LDFLAGS_MAC_INSTALL_NAME +# to an empty string. +# +# https://sqlite.org/forum/forumpost/5651662b8875ec0a +proc sqlite-handle-mac-install-name {} { + define LDFLAGS_MAC_INSTALL_NAME ""; # {-Wl,-install_name,"$(install-dir.lib)/$(libsqlite3.SO)"} + set rc 0 + if {[proj-looks-like-mac]} { + cc-with {-link 1} { + if {[cc-check-flags "-Wl,-install_name,/usr/local/lib/libsqlite3.dylib"]} { + define LDFLAGS_MAC_INSTALL_NAME {-Wl,-install_name,"$(install-dir.lib)/$(libsqlite3.SO)"} + set rc 1 + } + } + } + return $rc +} + ######################################################################## # Handles the --dll-basename configure flag. [define]'s # SQLITE_DLL_BASENAME to the DLL's preferred base name (minus @@ -1680,6 +1702,7 @@ proc sqlite-handle-env-quirks {} { sqlite-handle-dll-basename sqlite-handle-out-implib sqlite-handle-mac-cversion + sqlite-handle-mac-install-name if {[llength [info proc sqlite-custom-handle-flags]] > 0} { # sqlite-custom-handle-flags is assumed to be imported via a # client-specific import: autosetup/sqlite-custom.tcl. diff --git a/manifest b/manifest index 5931b1dca2..2ed7ee6944 100644 --- a/manifest +++ b/manifest @@ -1,10 +1,10 @@ -C Adapt\sthe\s--all\sflag\sto\sapply\sto\sa\sdifferent\sset\sof\sfeatures,\sand\sdefault\sto\senabled,\sfor\sthe\stcl-extension\sbuild. -D 2025-04-04T16:17:02.677 +C Account\sfor\sthe\sMac-specific\s-instal_name\slinker\sflag,\swhich\sis\sapparently\sneeded\sfor\slinking\ssome\sthird-party\scode.\sSee\s[forum:5651662b8875ec0a|forum\spost\s5651662b8875ec0a]. +D 2025-04-04T20:50:00.816 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d -F Makefile.in 6fabbdf631cae9fb53a9926130da019f8e3b8838fcc561a4a37e7f4ba5b14812 +F Makefile.in c3e414df4dc8dfb12f1f6baf129fcb6d18cd0ebd3c9109370fb3fceeeef9a37a F Makefile.linux-generic bd3e3cacd369821a6241d4ea1967395c962dfe3057e38cb0a435cee0e8b789d0 F Makefile.msc bb2cc6f75bbcb2d690fbdd1489914a2febd5e99bad9c77538cb3330d304694c6 F README.md a953c0cffd6e4f2501a306c00ee2b6e1e6630c25031e094629307fe99dd003d1 @@ -17,7 +17,7 @@ F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2 F art/sqlite370.svg 40b7e2fe8aac3add5d56dd86ab8d427a4eca5bcb3fe4f8946cb3794e1821d531 F auto.def 82c32443a91c1062f7a48beec37dbb2d8d03447b1286bce8df5ebb6d8d353f8a F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac -F autoconf/Makefile.in 10e274d965584af947be20213e0052112ee8dec928134d20e256f5fc4c51b758 +F autoconf/Makefile.in 78ff1feb1b934b2e9d24ae50a3b4ed9e53ef368b940b9cf10f5a68956ec6de93 F autoconf/Makefile.msc 5bc67d3912444c40c6f96d003e5c90663e51abb83d204a520110b1b2038dcd8b F autoconf/README.first f1d3876e9a7852c22f275a6f06814e64934cecbc0b5b9617d64849094c1fd136 F autoconf/README.txt 1a32296d8bbdd67110c79d224c92c05545a0b5bd0c272950025fe3c7c7b49580 @@ -52,7 +52,7 @@ F autosetup/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1 F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba F autosetup/proj.tcl ad2cf7a01c3ff3571fea1da299910c76b00484f6662f3ba7a625051117837e8e -F autosetup/sqlite-config.tcl 4349a7b68e100137b59b9fe27da7d622185a4932b95b77c7b7922800af5920bf +F autosetup/sqlite-config.tcl ec2aeddaf2fd4e41686d6be6f152f31b6b485cfee20d059ad5c33a1d3031d452 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x F contrib/sqlitecon.tcl eb4c6578e08dd353263958da0dc620f8400b869a50d06e271ab0be85a51a08d3 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 26ef0ff4bfbb4425baa26fa5c8420f5da0603c38ef651104e566c7dc85bfaa3a -R 5ab57a421300c0c0e5e98ecd6d96713d +P b229c8f65acf41b57afacfde712c3a8040d3bd5139bd5e30d450669658185ddd +R aebe7336d7b841479099c5bc94312574 U stephan -Z 68f06e0eff70f5e6c5a65134984dc57b +Z b888f6d0253d65e6b8f1d274ddad43d2 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index b17172fa7d..7ebac3dac4 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -b229c8f65acf41b57afacfde712c3a8040d3bd5139bd5e30d450669658185ddd +4947c1c78298253a51939adf6cf70ee233075db6d60cd7a183a4162c926e667c From 205d9960cbd9c0eb46bb545078cddce99b202a47 Mon Sep 17 00:00:00 2001 From: stephan Date: Fri, 4 Apr 2025 22:14:18 +0000 Subject: [PATCH 065/120] Add more vars to the tclConfig.sh-to-tcl exporter, for use in the TEA build. FossilOrigin-Name: b0e1e49c7a4af526143214ce7dee97ef0da5e7baa85728fc667b1f7607693ab7 --- autosetup/proj.tcl | 4 ++++ autosetup/sqlite-config.tcl | 2 +- manifest | 14 +++++++------- manifest.uuid | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl index 33f95afa4a..4f6a602863 100644 --- a/autosetup/proj.tcl +++ b/autosetup/proj.tcl @@ -1411,6 +1411,10 @@ proc proj-tclConfig-sh-to-autosetup {tclConfigSh} { TCL_EXEC_PREFIX TCL_PREFIX TCL_VERSION + TCL_MAJOR_VERSION + TCL_MINOR_VERSION + TCL_PATCH_LEVEL + TCL_SHLIB_SUFFIX } # Build a small shell script which proxies the $tclVars from # $tclConfigSh into autosetup code... diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl index 8a99d774e4..8f15ddb4c0 100644 --- a/autosetup/sqlite-config.tcl +++ b/autosetup/sqlite-config.tcl @@ -1510,7 +1510,7 @@ proc sqlite-handle-mac-cversion {} { ######################################################################## # If this is a Mac platform, check for support for -# -Wl,-install_name,... and, if it's set, define +# -Wl,-install_name,... and, if it's available, define # LDFLAGS_MAC_INSTALL_NAME to a variant of that string which is # intended to expand at make-time, else set LDFLAGS_MAC_INSTALL_NAME # to an empty string. diff --git a/manifest b/manifest index 2ed7ee6944..4a6b77a55a 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Account\sfor\sthe\sMac-specific\s-instal_name\slinker\sflag,\swhich\sis\sapparently\sneeded\sfor\slinking\ssome\sthird-party\scode.\sSee\s[forum:5651662b8875ec0a|forum\spost\s5651662b8875ec0a]. -D 2025-04-04T20:50:00.816 +C Add\smore\svars\sto\sthe\stclConfig.sh-to-tcl\sexporter,\sfor\suse\sin\sthe\sTEA\sbuild. +D 2025-04-04T22:14:18.035 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -51,8 +51,8 @@ F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e F autosetup/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1821baf61bc86a7e F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba -F autosetup/proj.tcl ad2cf7a01c3ff3571fea1da299910c76b00484f6662f3ba7a625051117837e8e -F autosetup/sqlite-config.tcl ec2aeddaf2fd4e41686d6be6f152f31b6b485cfee20d059ad5c33a1d3031d452 +F autosetup/proj.tcl b808e3b176671d994358fcd6c47d5645a284658773e6f9e3c6292ed698a0b220 +F autosetup/sqlite-config.tcl 8341c9bc702eef826f5f9a426ce3464c4bf3906d526a4c441c6111cf24e1cc8e F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x F contrib/sqlitecon.tcl eb4c6578e08dd353263958da0dc620f8400b869a50d06e271ab0be85a51a08d3 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P b229c8f65acf41b57afacfde712c3a8040d3bd5139bd5e30d450669658185ddd -R aebe7336d7b841479099c5bc94312574 +P 4947c1c78298253a51939adf6cf70ee233075db6d60cd7a183a4162c926e667c +R 81caf4fec44dc4f3520227e408930067 U stephan -Z b888f6d0253d65e6b8f1d274ddad43d2 +Z c68c7100b9bcee4fb09ef349948adcf6 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 7ebac3dac4..50bf04571c 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -4947c1c78298253a51939adf6cf70ee233075db6d60cd7a183a4162c926e667c +b0e1e49c7a4af526143214ce7dee97ef0da5e7baa85728fc667b1f7607693ab7 From d09fc819397fb681e65f431495087c2e1f9c982a Mon Sep 17 00:00:00 2001 From: stephan Date: Fri, 4 Apr 2025 22:59:32 +0000 Subject: [PATCH 066/120] Correct a makefile var name type in the configure script, introduced in [4947c1c782]. FossilOrigin-Name: 84d77c5fe84d99d4af695a4da424b7dfc65f2343624e201736b7d673b2a8f179 --- autosetup/sqlite-config.tcl | 4 ++-- manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl index 8f15ddb4c0..56569ed5fe 100644 --- a/autosetup/sqlite-config.tcl +++ b/autosetup/sqlite-config.tcl @@ -1517,12 +1517,12 @@ proc sqlite-handle-mac-cversion {} { # # https://sqlite.org/forum/forumpost/5651662b8875ec0a proc sqlite-handle-mac-install-name {} { - define LDFLAGS_MAC_INSTALL_NAME ""; # {-Wl,-install_name,"$(install-dir.lib)/$(libsqlite3.SO)"} + define LDFLAGS_MAC_INSTALL_NAME ""; # {-Wl,-install_name,"$(install-dir.lib)/$(libsqlite3.DLL)"} set rc 0 if {[proj-looks-like-mac]} { cc-with {-link 1} { if {[cc-check-flags "-Wl,-install_name,/usr/local/lib/libsqlite3.dylib"]} { - define LDFLAGS_MAC_INSTALL_NAME {-Wl,-install_name,"$(install-dir.lib)/$(libsqlite3.SO)"} + define LDFLAGS_MAC_INSTALL_NAME {-Wl,-install_name,"$(install-dir.lib)/$(libsqlite3.DLL)"} set rc 1 } } diff --git a/manifest b/manifest index 4a6b77a55a..b02230dcd4 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\smore\svars\sto\sthe\stclConfig.sh-to-tcl\sexporter,\sfor\suse\sin\sthe\sTEA\sbuild. -D 2025-04-04T22:14:18.035 +C Correct\sa\smakefile\svar\sname\stype\sin\sthe\sconfigure\sscript,\sintroduced\sin\s[4947c1c782]. +D 2025-04-04T22:59:32.701 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -52,7 +52,7 @@ F autosetup/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1 F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba F autosetup/proj.tcl b808e3b176671d994358fcd6c47d5645a284658773e6f9e3c6292ed698a0b220 -F autosetup/sqlite-config.tcl 8341c9bc702eef826f5f9a426ce3464c4bf3906d526a4c441c6111cf24e1cc8e +F autosetup/sqlite-config.tcl 5c356e61d53b4f8b358b1a18aa27bc7856b745c425d5324c30b5231c967c9e52 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x F contrib/sqlitecon.tcl eb4c6578e08dd353263958da0dc620f8400b869a50d06e271ab0be85a51a08d3 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 4947c1c78298253a51939adf6cf70ee233075db6d60cd7a183a4162c926e667c -R 81caf4fec44dc4f3520227e408930067 +P b0e1e49c7a4af526143214ce7dee97ef0da5e7baa85728fc667b1f7607693ab7 +R 38ac2cde604486aba3e9d7b4f05e364a U stephan -Z c68c7100b9bcee4fb09ef349948adcf6 +Z 85caa2e9f1276fc2e57e5363e1142a89 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 50bf04571c..162c48e330 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -b0e1e49c7a4af526143214ce7dee97ef0da5e7baa85728fc667b1f7607693ab7 +84d77c5fe84d99d4af695a4da424b7dfc65f2343624e201736b7d673b2a8f179 From 86527e84e6c2a43e12e17187ede4f8f434ee8a6c Mon Sep 17 00:00:00 2001 From: stephan Date: Fri, 4 Apr 2025 23:12:32 +0000 Subject: [PATCH 067/120] Rename makefile var libtclsqlite3.SO to libtclsqlite3.DLL for consistency. FossilOrigin-Name: 6fb364c853be84c8d1f20497a2cae6e8f06a1d10ae364e3b011cadeaa3e0244b --- main.mk | 18 +++++++++--------- manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/main.mk b/main.mk index a79afe029a..e553ffaaaf 100644 --- a/main.mk +++ b/main.mk @@ -1630,8 +1630,8 @@ pkgIndex.tcl: pkgIndex.tcl-1: pkgIndex.tcl pkgIndex.tcl-0 pkgIndex.tcl-: tcl: pkgIndex.tcl-$(HAVE_TCL) -libtclsqlite3.SO = libtclsqlite3$(T.dll) -$(libtclsqlite3.SO): $(T.tcl.env.sh) tclsqlite.o $(LIBOBJ) +libtclsqlite3.DLL = libtclsqlite3$(T.dll) +$(libtclsqlite3.DLL): $(T.tcl.env.sh) tclsqlite.o $(LIBOBJ) $(T.tcl.env.source); \ $(T.link.shared) -o $@ tclsqlite.o \ $$TCL_INCLUDE_SPEC $$TCL_STUB_LIB_SPEC $(LDFLAGS.libsqlite3) \ @@ -1639,19 +1639,19 @@ $(libtclsqlite3.SO): $(T.tcl.env.sh) tclsqlite.o $(LIBOBJ) # ^^^ that rpath bit is defined as TCL_LD_SEARCH_FLAGS in # tclConfig.sh, but it's defined in such a way as to be useless for a # _static_ makefile. -$(libtclsqlite3.SO)-1: $(libtclsqlite3.SO) -$(libtclsqlite3.SO)-0 $(libtclsqlite3.SO)-: -libtcl: $(libtclsqlite3.SO)-$(HAVE_TCL) +$(libtclsqlite3.DLL)-1: $(libtclsqlite3.DLL) +$(libtclsqlite3.DLL)-0 $(libtclsqlite3.DLL)-: +libtcl: $(libtclsqlite3.DLL)-$(HAVE_TCL) tcl: libtcl all: tcl -install-tcl-1: $(libtclsqlite3.SO) pkgIndex.tcl +install-tcl-1: $(libtclsqlite3.DLL) pkgIndex.tcl $(T.tcl.env.source); \ $(INSTALL) -d "$(DESTDIR)$$TCLLIBDIR"; \ - $(INSTALL) $(libtclsqlite3.SO) "$(DESTDIR)$$TCLLIBDIR"; \ + $(INSTALL) $(libtclsqlite3.DLL) "$(DESTDIR)$$TCLLIBDIR"; \ $(INSTALL.noexec) pkgIndex.tcl "$(DESTDIR)$$TCLLIBDIR" install-tcl-0 install-tcl-: - @echo "TCL support disabled, so not installing $(libtclsqlite3.SO)" + @echo "TCL support disabled, so not installing $(libtclsqlite3.DLL)" install-tcl: install-tcl-$(HAVE_TCL) install: install-tcl @@ -2557,7 +2557,7 @@ tidy: rm -f lemon$(B.exe) sqlite*.tar.gz rm -f mkkeywordhash$(B.exe) mksourceid$(B.exe) rm -f parse.* fts5parse.* - rm -f $(libsqlite3.DLL) $(libsqlite3.LIB) $(libtclsqlite3.SO) libsqlite3$(T.dll).a + rm -f $(libsqlite3.DLL) $(libsqlite3.LIB) $(libtclsqlite3.DLL) libsqlite3$(T.dll).a rm -f tclsqlite3$(T.exe) $(TESTPROGS) rm -f LogEst$(T.exe) fts3view$(T.exe) rollback-test$(T.exe) showdb$(T.exe) rm -f showjournal$(T.exe) showstat4$(T.exe) showwal$(T.exe) speedtest1$(T.exe) diff --git a/manifest b/manifest index b02230dcd4..bfb96183ce 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Correct\sa\smakefile\svar\sname\stype\sin\sthe\sconfigure\sscript,\sintroduced\sin\s[4947c1c782]. -D 2025-04-04T22:59:32.701 +C Rename\smakefile\svar\slibtclsqlite3.SO\sto\slibtclsqlite3.DLL\sfor\sconsistency. +D 2025-04-04T23:12:32.981 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -709,7 +709,7 @@ F ext/wasm/tests/opfs/sahpool/sahpool-pausing.js f264925cfc82155de38cecb3d204c36 F ext/wasm/tests/opfs/sahpool/sahpool-worker.js bd25a43fc2ab2d1bafd8f2854ad3943ef673f7c3be03e95ecf1612ff6e8e2a61 F ext/wasm/wasmfs.make 68999f5bd8c489239592d59a420f8c627c99169bbd6fa16a404751f757b9f702 F magic.txt 5ade0bc977aa135e79e3faaea894d5671b26107cc91e70783aa7dc83f22f3ba0 -F main.mk 9692d882ecb43332b62295b3d0aa5ba356d4c2ad387d322b85e5bc98800e9285 +F main.mk f03c2af6e15b4a24ae18e2f675da306cc8e95e3d064a9763bf50eff2e7d83b5f F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271 F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504 F mptest/crash01.test 61e61469e257df0850df4293d7d4d6c2af301421 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P b0e1e49c7a4af526143214ce7dee97ef0da5e7baa85728fc667b1f7607693ab7 -R 38ac2cde604486aba3e9d7b4f05e364a +P 84d77c5fe84d99d4af695a4da424b7dfc65f2343624e201736b7d673b2a8f179 +R 41dbfa3a3eb3de976c07f1845f1b45cd U stephan -Z 85caa2e9f1276fc2e57e5363e1142a89 +Z 62730cb1d0d281d2a24934aa35440eec # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 162c48e330..9f3da7735a 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -84d77c5fe84d99d4af695a4da424b7dfc65f2343624e201736b7d673b2a8f179 +6fb364c853be84c8d1f20497a2cae6e8f06a1d10ae364e3b011cadeaa3e0244b From 7cf1b290652ff8cfc1c6bac052c6ed9c74017777 Mon Sep 17 00:00:00 2001 From: stephan Date: Sat, 5 Apr 2025 02:59:37 +0000 Subject: [PATCH 068/120] Refactor proj-make-from-dot-in and friends to be more useful and remove some annoying limitations. FossilOrigin-Name: 501ff84e1263e2b026b0ca5f043bcc912ea935229b625b113b7402955df20dd3 --- autosetup/proj.tcl | 139 +++++++++++++++++++++++++++++++----- autosetup/sqlite-config.tcl | 41 ++++++----- manifest | 14 ++-- manifest.uuid | 2 +- 4 files changed, 148 insertions(+), 48 deletions(-) diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl index 4f6a602863..55ea3c4373 100644 --- a/autosetup/proj.tcl +++ b/autosetup/proj.tcl @@ -54,6 +54,16 @@ # $proj_ is an internal-use-only array for storing whatever generic # internal stuff we need stored. array set proj_ {} +# +# List of dot-in files to filter in the final stages of +# configuration. Some configuration steps may append to this. Each +# one in this list which exists will trigger the generation of a +# file with that same name, minus the ".in", in the build directory +# (which differ from the source dir in out-of-tree builds). +# +# See: proj-dot-ins-append and proj-dot-ins-process +# +set proj_(dot-in-files) {} set proj_(isatty) [isatty? stdout] ######################################################################## @@ -71,7 +81,7 @@ proc proj-warn {msg} { # Emits an error message to stderr and exits with non-0. proc proj-fatal {msg} { show-notices - puts stderr "ERROR: $msg" + puts stderr "ERROR: \[[proj-current-proc-name 1]]: $msg" exit 1 } @@ -670,11 +680,18 @@ proc proj-touch {filename} { } ######################################################################## -# @proj-make-from-dot-in ?-touch? filename... +# @proj-make-from-dot-in ?-touch? infile ?outfile? # -# Uses [make-template] to create makefile(-like) file(s) $filename -# from $filename.in but explicitly makes the output read-only, to -# avoid inadvertent editing (who, me?). +# Uses [make-template] to create makefile(-like) file(s) $outfile from +# $infile but explicitly makes the output read-only, to avoid +# inadvertent editing (who, me?). +# +# If $outfile is empty then: +# +# - If $infile is a 2-element list, it is assumed to be an in/out pair, +# and $outfile is set from the 2nd entry in that list. Else... +# +# - $outfile is set to $infile stripped of its extension. # # If the first argument is -touch then the generated file is touched # to update its timestamp. This can be used as a workaround for @@ -684,26 +701,35 @@ proc proj-touch {filename} { # # Failures when running chmod or touch are silently ignored. proc proj-make-from-dot-in {args} { - set filename $args + set fIn "" + set fOut "" set touch 0 if {[lindex $args 0] eq "-touch"} { set touch 1 - set filename [lrange $args 1 end] + lassign $args - fIn fOut + } else { + lassign $args fIn fOut } - foreach f $filename { - set f [string trim $f] - if {[file exists $f]} { - catch { exec chmod u+w $f } - } - make-template $f.in $f - if {$touch} { - proj-touch $f - } - catch { - exec chmod -w $f - #file attributes -w $f; #jimtcl has no 'attributes' + if {"" eq $fOut} { + if {2==[llength $fIn]} { + lassign $fIn fIn fOut + } else { + set fOut [file rootname $fIn] } } + #puts "filenames=$filename" + if {[file exists $fOut]} { + catch { exec chmod u+w $fOut } + } + #puts "making template: $fIn ==> $fOut" + make-template $fIn $fOut + if {$touch} { + proj-touch $fOut + } + catch { + exec chmod -w $fOut + #file attributes -w $f; #jimtcl has no 'attributes' + } } ######################################################################## @@ -1476,3 +1502,78 @@ proc proj-tweak-default-env-dirs {} { } return 0 } + +######################################################################## +# @proj-dot-ins-append {file ?fileOut?}... +# +# Queues up an autosetup [make-template]-style file to be processed +# at a later time using [proj-dot-ins-process]. +# +# $file is the input file. If $fileOut is empty then this function +# derives $fileOut from $file, stripping both its directory and +# extension parts. +# +# See [proj-dot-ins-process] +proc proj-dot-ins-append {args} { + set srcdir $::autosetup(srcdir) + foreach f ${args} { + if {1==[llength $f]} { + lappend f [file rootname [file tail $f]] + } + #puts "******* [proj-current-proc-name]: adding $f" + lappend ::proj_(dot-in-files) $f + } +} + +######################################################################## +# @proj-dot-ins-list +# +# Returns the current list of [proj-dot-ins-append]'d files, noting +# that each entry is a 2-element list. +proc proj-dot-ins-list {} { + return $::proj_(dot-in-files) +} + +######################################################################## +# @proj-dot-ins-process ?-touch? +# +# Each file which has previously been passed to [proj-dot-ins-append] +# is processed, with its passing its in-file out-file names to +# [proj-make-from-dot-in]. +# +# The optional argument may be the -touch flag, which is passed on to +# that [proj-make-from-dot-in]. +# +# The intent is that a project accumulate any number of files to +# filter and delay their actual filtering until the last stage of the +# configure script, calling this function at that time. +proc proj-dot-ins-process {args} { + set flags "" + if {"-touch" eq $args} { + set flags "-touch" + } + foreach f $::proj_(dot-in-files) { + proj-assert {2==[llength $f]} + lassign $f fIn fOut + #puts "DOING $fIn ==> $fOut" + proj-make-from-dot-in {*}$flags $fIn $fOut + } +} + +######################################################################## +# @proj-validate-no-unresolved-ats filenames... +# +# For each filename given to it, it validates that the file has no +# unresolved @VAR@ references. If it finds any, it produces an error +# with location information. +proc proj-validate-no-unresolved-ats {args} { + foreach f $args { + set lnno 1 + foreach line [proj-file-content-list $f] { + if {[regexp {(@[A-Za-z0-9_]+@)} $line match]} { + error "Unresolved reference to $match at line $lnno of $f" + } + incr lnno + } + } +} diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl index 56569ed5fe..b723a53c6d 100644 --- a/autosetup/sqlite-config.tcl +++ b/autosetup/sqlite-config.tcl @@ -490,6 +490,12 @@ proc sqlite-configure-phase1 {buildMode} { # may not) define HAVE_LFS. cc-check-lfs } + + set srcdir $::autosetup(srcdir) + proj-dot-ins-append $srcdir/Makefile.in + if {[file exists $srcdir/sqlite3.pc.in]} { + proj-dot-ins-append $srcdir/sqlite3.pc.in + } }; # sqlite-configure-phase1 ######################################################################## @@ -1005,8 +1011,17 @@ proc sqlite-handle-emsdk {} { # Maybe there's a copy in the path? proj-bin-define wasm-opt BIN_WASM_OPT } - proj-make-from-dot-in $emccSh $extWasmConfig + # + # We would prefer to pass these to proj-dot-ins-append but that + # family of APIs cannot handle the output being in a dir other + # than the current one. Also, we need to chmod +x $emccSh, and we + # don't have a hook to do that with if we defer dot-in-processing + # it. + # + proj-make-from-dot-in $emccSh.in + proj-make-from-dot-in $extWasmConfig.in catch {exec chmod u+x $emccSh} + proj-validate-no-unresolved-ats $emccSh $extWasmConfig } else { define EMCC_WRAPPER "" file delete -force -- $emccSh $extWasmConfig @@ -1725,15 +1740,7 @@ proc sqlite-process-dot-in-files {} { # (e.g. [proj-check-rpath]) may do so before we "mangle" them here. proj-remap-autoconf-dir-vars - set srcdir $::autosetup(srcdir)/ - foreach f {Makefile sqlite3.pc} { - if {[file exists $srcdir/$f.in]} { - # ^^^ we do this only so that this block can be made to work for - # multiple builds. e.g. the tea build (under construction) does - # not hae sqlite3.pc.in. - proj-make-from-dot-in -touch $f - } - } + proj-dot-ins-process make-config-header sqlite_cfg.h \ -bare {SIZEOF_* HAVE_DECL_*} \ -none {HAVE_CFLAG_* LDFLAGS_* SH_* SQLITE_AUTORECONFIG @@ -1755,17 +1762,9 @@ proc sqlite-post-config-validation {} { # contain any unresolved @VAR@ refs. That may indicate an # unexported/unused var or a typo. set srcdir $::autosetup(srcdir) - foreach f [list Makefile sqlite3.pc \ - $srcdir/tool/emcc.sh \ - $srcdir/ext/wasm/config.make] { - if {![file exists $f]} continue - set lnno 1 - foreach line [proj-file-content-list $f] { - if {[regexp {(@[A-Za-z0-9_]+@)} $line match]} { - error "Unresolved reference to $match at line $lnno of $f" - } - incr lnno - } + foreach f [proj-dot-ins-list] { + proj-assert {2==[llength $f]} + proj-validate-no-unresolved-ats [lindex $f 1] } } diff --git a/manifest b/manifest index bfb96183ce..e88ea04072 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Rename\smakefile\svar\slibtclsqlite3.SO\sto\slibtclsqlite3.DLL\sfor\sconsistency. -D 2025-04-04T23:12:32.981 +C Refactor\sproj-make-from-dot-in\sand\sfriends\sto\sbe\smore\suseful\sand\sremove\ssome\sannoying\slimitations. +D 2025-04-05T02:59:37.477 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -51,8 +51,8 @@ F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e F autosetup/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1821baf61bc86a7e F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba -F autosetup/proj.tcl b808e3b176671d994358fcd6c47d5645a284658773e6f9e3c6292ed698a0b220 -F autosetup/sqlite-config.tcl 5c356e61d53b4f8b358b1a18aa27bc7856b745c425d5324c30b5231c967c9e52 +F autosetup/proj.tcl b180256ed6ebf651c49afcbb9c53bd471865f86db68357c90e2fc5a62a6a318c +F autosetup/sqlite-config.tcl 397cc72249133f72b21337c0d51426ee1cbc4e48ab9b53aa1f0fca8870104d64 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x F contrib/sqlitecon.tcl eb4c6578e08dd353263958da0dc620f8400b869a50d06e271ab0be85a51a08d3 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 84d77c5fe84d99d4af695a4da424b7dfc65f2343624e201736b7d673b2a8f179 -R 41dbfa3a3eb3de976c07f1845f1b45cd +P 6fb364c853be84c8d1f20497a2cae6e8f06a1d10ae364e3b011cadeaa3e0244b +R f77f5fd6c14452717ebb4784f39f44f1 U stephan -Z 62730cb1d0d281d2a24934aa35440eec +Z e4146e4a510a3a048f586eec271c895c # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 9f3da7735a..d48122b9a7 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -6fb364c853be84c8d1f20497a2cae6e8f06a1d10ae364e3b011cadeaa3e0244b +501ff84e1263e2b026b0ca5f043bcc912ea935229b625b113b7402955df20dd3 From 4d411659c4e9f9bc5230b48005132eabb718e7d2 Mon Sep 17 00:00:00 2001 From: stephan Date: Sat, 5 Apr 2025 07:12:41 +0000 Subject: [PATCH 069/120] Move the automatic reconfigure tcl code from sqlite-config.tcl to proj.tcl so that the TEA bits can reuse it. FossilOrigin-Name: 52839db2fcdf37631d13c05165ecb551a89c05bd6836f62d62f8f0b7bbe6c6cd --- autosetup/proj.tcl | 55 +++++++++++++++++++++++++++++++------ autosetup/sqlite-config.tcl | 23 +--------------- manifest | 14 +++++----- manifest.uuid | 2 +- 4 files changed, 55 insertions(+), 39 deletions(-) diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl index 55ea3c4373..b582a1a59a 100644 --- a/autosetup/proj.tcl +++ b/autosetup/proj.tcl @@ -1504,7 +1504,7 @@ proc proj-tweak-default-env-dirs {} { } ######################################################################## -# @proj-dot-ins-append {file ?fileOut?}... +# @proj-dot-ins-append file ?fileOut? # # Queues up an autosetup [make-template]-style file to be processed # at a later time using [proj-dot-ins-process]. @@ -1514,22 +1514,22 @@ proc proj-tweak-default-env-dirs {} { # extension parts. # # See [proj-dot-ins-process] -proc proj-dot-ins-append {args} { +proc proj-dot-ins-append {fileIn {fileOut ""}} { set srcdir $::autosetup(srcdir) - foreach f ${args} { - if {1==[llength $f]} { - lappend f [file rootname [file tail $f]] - } - #puts "******* [proj-current-proc-name]: adding $f" - lappend ::proj_(dot-in-files) $f + if {"" eq $fileOut} { + lappend fileIn [file rootname [file tail $fileIn]] + } else { + lappend fileIn $fileOut } + #puts "******* [proj-current-proc-name]: adding $fileIn" + lappend ::proj_(dot-in-files) $fileIn } ######################################################################## # @proj-dot-ins-list # # Returns the current list of [proj-dot-ins-append]'d files, noting -# that each entry is a 2-element list. +# that each entry is a 2-element list of (input, output) file names. proc proj-dot-ins-list {} { return $::proj_(dot-in-files) } @@ -1577,3 +1577,40 @@ proc proj-validate-no-unresolved-ats {args} { } } } + +######################################################################## +# @proj-first-found fileList tgtVar +# +# Searches $fileList for an existing file. If one is found, its name is +# assigned to tgtVar and 1 is returned, else tgtVar is not modified +# and 0 is returned. +proc proj-first-file-found {fileList tgtVar} { + upvar $tgtVar tgt + foreach f $fileList { + if {[file exists $f]} { + set tgt $f + return 1 + } + } + return 0 +} + +######################################################################## +# Defines $defName to contain makefile recipe commands for re-running +# the configure script with its current set of $::argv flags. This +# can be used to automatically reconfigure. +proc proj-setup-autoreconfig {defName} { + set squote {{arg} { + # Wrap $arg in single-quotes if it looks like it might need that + # to avoid mis-handling as a shell argument. We assume that $arg + # will never contain any single-quote characters. + if {[string match {*[ &;$*"]*} $arg]} { return '$arg' } + return $arg + }} + define-append $defName cd [apply $squote $::autosetup(builddir)] \ + && [apply $squote $::autosetup(srcdir)/configure] + #{*}$::autosetup(argv) breaks with --flag='val with spaces', so... + foreach arg $::autosetup(argv) { + define-append $defName [apply $squote $arg] + } +} diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl index b723a53c6d..0f8b670807 100644 --- a/autosetup/sqlite-config.tcl +++ b/autosetup/sqlite-config.tcl @@ -469,7 +469,7 @@ proc sqlite-configure-phase1 {buildMode} { } set ::sqliteConfig(msg-debug-enabled) [proj-val-truthy [get-env msg-debug 0]] proc-debug "msg-debug is enabled" - sqlite-autoreconfig + proj-setup-autoreconfig SQLITE_AUTORECONFIG proj-file-extensions if {".exe" eq [get-define TARGET_EXEEXT]} { define SQLITE_OS_UNIX 0 @@ -548,27 +548,6 @@ proc proc-debug {msg} { msg-debug "\[[proj-current-proc-name 1]\]: $msg" } -######################################################################## -# Sets up the SQLITE_AUTORECONFIG define. -proc sqlite-autoreconfig {} { - # SQLITE_AUTORECONFIG contains make target rules for re-running the - # configure script with the same arguments it was initially invoked - # with. This can be used to automatically reconfigure. - set squote {{arg} { - # Wrap $arg in single-quotes if it looks like it might need that - # to avoid mis-handling as a shell argument. We assume that $arg - # will never contain any single-quote characters. - if {[string match {*[ &;$*"]*} $arg]} { return '$arg' } - return $arg - }} - define-append SQLITE_AUTORECONFIG cd [apply $squote $::autosetup(builddir)] \ - && [apply $squote $::autosetup(srcdir)/configure] - #{*}$::autosetup(argv) breaks with --flag='val with spaces', so... - foreach arg $::autosetup(argv) { - define-append SQLITE_AUTORECONFIG [apply $squote $arg] - } -} - define OPT_FEATURE_FLAGS {} ; # -DSQLITE_OMIT/ENABLE flags. define OPT_SHELL {} ; # Feature-related CFLAGS for the sqlite3 CLI app ######################################################################## diff --git a/manifest b/manifest index e88ea04072..43d0de5fdf 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Refactor\sproj-make-from-dot-in\sand\sfriends\sto\sbe\smore\suseful\sand\sremove\ssome\sannoying\slimitations. -D 2025-04-05T02:59:37.477 +C Move\sthe\sautomatic\sreconfigure\stcl\scode\sfrom\ssqlite-config.tcl\sto\sproj.tcl\sso\sthat\sthe\sTEA\sbits\scan\sreuse\sit. +D 2025-04-05T07:12:41.735 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -51,8 +51,8 @@ F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e F autosetup/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1821baf61bc86a7e F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba -F autosetup/proj.tcl b180256ed6ebf651c49afcbb9c53bd471865f86db68357c90e2fc5a62a6a318c -F autosetup/sqlite-config.tcl 397cc72249133f72b21337c0d51426ee1cbc4e48ab9b53aa1f0fca8870104d64 +F autosetup/proj.tcl 027847ee7b7bdd4733e303d5076a44034d76a65b468dcfafcba1b5fa7a8bb137 +F autosetup/sqlite-config.tcl c501e9ace3f7936a40a5b92e3f93dd616f5d30e555363dfe2ac4318bfccf7da5 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x F contrib/sqlitecon.tcl eb4c6578e08dd353263958da0dc620f8400b869a50d06e271ab0be85a51a08d3 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 6fb364c853be84c8d1f20497a2cae6e8f06a1d10ae364e3b011cadeaa3e0244b -R f77f5fd6c14452717ebb4784f39f44f1 +P 501ff84e1263e2b026b0ca5f043bcc912ea935229b625b113b7402955df20dd3 +R 6b214ec31a05839ac992b80f31178348 U stephan -Z e4146e4a510a3a048f586eec271c895c +Z d74082ee605e6d6207bfd34e76d865f3 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index d48122b9a7..faf9d776d1 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -501ff84e1263e2b026b0ca5f043bcc912ea935229b625b113b7402955df20dd3 +52839db2fcdf37631d13c05165ecb551a89c05bd6836f62d62f8f0b7bbe6c6cd From bc969569a2f84de38fa6e0d4f834eafbd6ebbf38 Mon Sep 17 00:00:00 2001 From: stephan Date: Sat, 5 Apr 2025 08:48:19 +0000 Subject: [PATCH 070/120] Add a note that SQLite's copy of proj.tcl can be considered the "canonical copy" for practical purposes. We now have at least 3 copies of it floating around in other trees. FossilOrigin-Name: 77d2c8e9ef9627c87c05beaf5615958628bd47c393c030ff6fcca607ba43e71f --- autosetup/proj.tcl | 6 +++++- manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl index b582a1a59a..b77bfd13ed 100644 --- a/autosetup/proj.tcl +++ b/autosetup/proj.tcl @@ -15,12 +15,16 @@ # The intent is that these routines be relatively generic, independent # of a given project. # +# For practical purposes, the copy of this file hosted in the SQLite +# project is the "canonical" one: +# +# https://sqlite.org/src/file/autosetup/proj.tcl +# # This file was initially derived from one used in the libfossil # project, authored by the same person who ported it here, and this is # noted here only as an indication that there are no licensing issues # despite this code having a handful of near-twins running around a # handful of third-party source trees. -# ######################################################################## # # Design notes: diff --git a/manifest b/manifest index 43d0de5fdf..a39f7c24ec 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Move\sthe\sautomatic\sreconfigure\stcl\scode\sfrom\ssqlite-config.tcl\sto\sproj.tcl\sso\sthat\sthe\sTEA\sbits\scan\sreuse\sit. -D 2025-04-05T07:12:41.735 +C Add\sa\snote\sthat\sSQLite's\scopy\sof\sproj.tcl\scan\sbe\sconsidered\sthe\s"canonical\scopy"\sfor\spractical\spurposes.\sWe\snow\shave\sat\sleast\s3\scopies\sof\sit\sfloating\saround\sin\sother\strees. +D 2025-04-05T08:48:19.760 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -51,7 +51,7 @@ F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e F autosetup/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1821baf61bc86a7e F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba -F autosetup/proj.tcl 027847ee7b7bdd4733e303d5076a44034d76a65b468dcfafcba1b5fa7a8bb137 +F autosetup/proj.tcl 620f7c4ea9517b20f2477c1357de1d685a3bac27d7762e800f3586ed18fa91d9 F autosetup/sqlite-config.tcl c501e9ace3f7936a40a5b92e3f93dd616f5d30e555363dfe2ac4318bfccf7da5 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 501ff84e1263e2b026b0ca5f043bcc912ea935229b625b113b7402955df20dd3 -R 6b214ec31a05839ac992b80f31178348 +P 52839db2fcdf37631d13c05165ecb551a89c05bd6836f62d62f8f0b7bbe6c6cd +R 31fcd20994c96960ddf59961361b0dbc U stephan -Z d74082ee605e6d6207bfd34e76d865f3 +Z fc2ea1a5f7471ead1bcccb57866abdd9 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index faf9d776d1..c8fc46a856 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -52839db2fcdf37631d13c05165ecb551a89c05bd6836f62d62f8f0b7bbe6c6cd +77d2c8e9ef9627c87c05beaf5615958628bd47c393c030ff6fcca607ba43e71f From 8aaf23a15e49deb02c056ccfc13fc8ab32a2c59b Mon Sep 17 00:00:00 2001 From: stephan Date: Sat, 5 Apr 2025 09:17:13 +0000 Subject: [PATCH 071/120] Extend proj-dot-ins-append to provide a way to use it for the special-case emcc.sh.in handling. FossilOrigin-Name: 0e98bbddc7b5e39310a8bf345521d05fdbcc906e279c23aa24cf30489ceeeff8 --- autosetup/proj.tcl | 45 +++++++++++++++++++++++++++---------- autosetup/sqlite-config.tcl | 19 +++++----------- manifest | 14 ++++++------ manifest.uuid | 2 +- 4 files changed, 47 insertions(+), 33 deletions(-) diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl index b77bfd13ed..bfbf4716a8 100644 --- a/autosetup/proj.tcl +++ b/autosetup/proj.tcl @@ -715,7 +715,7 @@ proc proj-make-from-dot-in {args} { lassign $args fIn fOut } if {"" eq $fOut} { - if {2==[llength $fIn]} { + if {[llength $fIn]>1} { lassign $fIn fIn fOut } else { set fOut [file rootname $fIn] @@ -1508,22 +1508,39 @@ proc proj-tweak-default-env-dirs {} { } ######################################################################## -# @proj-dot-ins-append file ?fileOut? +# @proj-dot-ins-append file ?fileOut ?postProcessScript?? # # Queues up an autosetup [make-template]-style file to be processed # at a later time using [proj-dot-ins-process]. # # $file is the input file. If $fileOut is empty then this function # derives $fileOut from $file, stripping both its directory and -# extension parts. +# extension parts. i.e. it defaults to writing the output to the +# current directory (typically $::autosetup(builddir)). # -# See [proj-dot-ins-process] -proc proj-dot-ins-append {fileIn {fileOut ""}} { +# If $postProcessScript is not empty then, during +# [proj-dot-ins-process], it will be eval'd immediately after +# processing the file. In the context of that script, the vars +# $fileIn and $fileOut will be set to the input and output file +# names. This can be used, for example, to make the output file +# executable or perform validation on its. +# +# See [proj-dot-ins-process], [proj-dot-ins-list] +proc proj-dot-ins-append {fileIn args} { set srcdir $::autosetup(srcdir) - if {"" eq $fileOut} { - lappend fileIn [file rootname [file tail $fileIn]] - } else { - lappend fileIn $fileOut + switch -exact -- [llength $args] { + 0 { + lappend fileIn [file rootname [file tail $fileIn]] "" + } + 1 { + lappend fileIn [join $args] "" + } + 2 { + lappend fileIn {*}$args + } + default { + proj-fatal "Too many arguments: $fileIn $args" + } } #puts "******* [proj-current-proc-name]: adding $fileIn" lappend ::proj_(dot-in-files) $fileIn @@ -1533,7 +1550,8 @@ proc proj-dot-ins-append {fileIn {fileOut ""}} { # @proj-dot-ins-list # # Returns the current list of [proj-dot-ins-append]'d files, noting -# that each entry is a 2-element list of (input, output) file names. +# that each entry is a 3-element list of (inputFileName, +# outputFileName, postProcessScript). proc proj-dot-ins-list {} { return $::proj_(dot-in-files) } @@ -1557,10 +1575,13 @@ proc proj-dot-ins-process {args} { set flags "-touch" } foreach f $::proj_(dot-in-files) { - proj-assert {2==[llength $f]} - lassign $f fIn fOut + proj-assert {3==[llength $f]} + lassign $f fIn fOut fScript #puts "DOING $fIn ==> $fOut" proj-make-from-dot-in {*}$flags $fIn $fOut + if {"" ne $fScript} { + uplevel 1 "set fileIn $fIn; set fileOut $fOut; eval {$fScript}" + } } } diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl index 0f8b670807..442039a780 100644 --- a/autosetup/sqlite-config.tcl +++ b/autosetup/sqlite-config.tcl @@ -490,7 +490,6 @@ proc sqlite-configure-phase1 {buildMode} { # may not) define HAVE_LFS. cc-check-lfs } - set srcdir $::autosetup(srcdir) proj-dot-ins-append $srcdir/Makefile.in if {[file exists $srcdir/sqlite3.pc.in]} { @@ -990,17 +989,10 @@ proc sqlite-handle-emsdk {} { # Maybe there's a copy in the path? proj-bin-define wasm-opt BIN_WASM_OPT } - # - # We would prefer to pass these to proj-dot-ins-append but that - # family of APIs cannot handle the output being in a dir other - # than the current one. Also, we need to chmod +x $emccSh, and we - # don't have a hook to do that with if we defer dot-in-processing - # it. - # - proj-make-from-dot-in $emccSh.in - proj-make-from-dot-in $extWasmConfig.in - catch {exec chmod u+x $emccSh} - proj-validate-no-unresolved-ats $emccSh $extWasmConfig + proj-dot-ins-append $emccSh.in $emccSh { + catch {exec chmod u+x $fileOut} + } + proj-dot-ins-append $extWasmConfig.in $extWasmConfig } else { define EMCC_WRAPPER "" file delete -force -- $emccSh $extWasmConfig @@ -1742,7 +1734,8 @@ proc sqlite-post-config-validation {} { # unexported/unused var or a typo. set srcdir $::autosetup(srcdir) foreach f [proj-dot-ins-list] { - proj-assert {2==[llength $f]} + proj-assert {3==[llength $f]} \ + "Expecting proj-dot-ins-list to be stored in 3-entry lists" proj-validate-no-unresolved-ats [lindex $f 1] } } diff --git a/manifest b/manifest index a39f7c24ec..1e1680a27b 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sa\snote\sthat\sSQLite's\scopy\sof\sproj.tcl\scan\sbe\sconsidered\sthe\s"canonical\scopy"\sfor\spractical\spurposes.\sWe\snow\shave\sat\sleast\s3\scopies\sof\sit\sfloating\saround\sin\sother\strees. -D 2025-04-05T08:48:19.760 +C Extend\sproj-dot-ins-append\sto\sprovide\sa\sway\sto\suse\sit\sfor\sthe\sspecial-case\semcc.sh.in\shandling. +D 2025-04-05T09:17:13.814 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -51,8 +51,8 @@ F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e F autosetup/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1821baf61bc86a7e F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba -F autosetup/proj.tcl 620f7c4ea9517b20f2477c1357de1d685a3bac27d7762e800f3586ed18fa91d9 -F autosetup/sqlite-config.tcl c501e9ace3f7936a40a5b92e3f93dd616f5d30e555363dfe2ac4318bfccf7da5 +F autosetup/proj.tcl 06ba9f7841e848cdebef11fe61e6e959e3e379b974edadc5eac8a76fd6885bb5 +F autosetup/sqlite-config.tcl 26fd6bca350a88a92253afdf02ddea0fa1f304ff18325a41f30478f7c0f10175 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x F contrib/sqlitecon.tcl eb4c6578e08dd353263958da0dc620f8400b869a50d06e271ab0be85a51a08d3 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 52839db2fcdf37631d13c05165ecb551a89c05bd6836f62d62f8f0b7bbe6c6cd -R 31fcd20994c96960ddf59961361b0dbc +P 77d2c8e9ef9627c87c05beaf5615958628bd47c393c030ff6fcca607ba43e71f +R d9334314847b8a0fe15ac5b6a1be0397 U stephan -Z fc2ea1a5f7471ead1bcccb57866abdd9 +Z bdc59ba3033c2d6bc844a137c31a6274 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index c8fc46a856..46c931f0ce 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -77d2c8e9ef9627c87c05beaf5615958628bd47c393c030ff6fcca607ba43e71f +0e98bbddc7b5e39310a8bf345521d05fdbcc906e279c23aa24cf30489ceeeff8 From 29c7c8b9135362fd1f9deee26e939c885439c36b Mon Sep 17 00:00:00 2001 From: drh <> Date: Sun, 6 Apr 2025 10:22:26 +0000 Subject: [PATCH 072/120] Fix a harmless code typo introduced by [b57e3c3db00a6bc6] and reported by [forum:/forumpost/09957d8b2a|forum post 09957d8b2a]. FossilOrigin-Name: f3a6cdb89b13bc173cfce9526f836600469b0242fe62b8f92f8747896d7d47bb --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/vdbeapi.c | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/manifest b/manifest index 1e1680a27b..34fae79b17 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Extend\sproj-dot-ins-append\sto\sprovide\sa\sway\sto\suse\sit\sfor\sthe\sspecial-case\semcc.sh.in\shandling. -D 2025-04-05T09:17:13.814 +C Fix\sa\sharmless\scode\stypo\sintroduced\sby\s[b57e3c3db00a6bc6]\sand\sreported\sby\n[forum:/forumpost/09957d8b2a|forum\spost\s09957d8b2a]. +D 2025-04-06T10:22:26.621 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -857,7 +857,7 @@ F src/vacuum.c fbfc3e074c865d2b5b10b8a65a3783275b80c152653590690747a102bb6cc770 F src/vdbe.c b5deed01000b3970cfca089dc531cf9342afd96d00cc8b4ad26d303f088116ee F src/vdbe.h 31eddcffc1d14c76c2a20fe4e137e1ee43d44f370896fae14a067052801a3625 F src/vdbeInt.h 5446f60e89b2aa7cdf3ab0ec4e7b01b8732cd9d52d9092a0b8b1bf700768f784 -F src/vdbeapi.c a9ad72afed9aaec2acdde4daa5caa2f342b298f8c8859704143f6e3b78cb9966 +F src/vdbeapi.c 28fab30ed0acc981aecfdcaab0a421503609078e29850eb28494816682baf0a7 F src/vdbeaux.c 72a1c99d9300a5e0adff2c708074ac1355a619664301db474a48e147418fba05 F src/vdbeblob.c b1b4032cac46b41e44b957c4d00aee9851f862dfd85ecb68116ba49884b03dfd F src/vdbemem.c 571ae3116dbf840a62c4aaa6bc09d577dfef8ad4d3978cf37275bb5f9653217b @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 77d2c8e9ef9627c87c05beaf5615958628bd47c393c030ff6fcca607ba43e71f -R d9334314847b8a0fe15ac5b6a1be0397 -U stephan -Z bdc59ba3033c2d6bc844a137c31a6274 +P 0e98bbddc7b5e39310a8bf345521d05fdbcc906e279c23aa24cf30489ceeeff8 +R 4ac80589d29845f42febfbd0c1aff7a6 +U drh +Z b03b8aeb0a4ead4233bdc4e4a1e00244 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 46c931f0ce..656e0da598 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -0e98bbddc7b5e39310a8bf345521d05fdbcc906e279c23aa24cf30489ceeeff8 +f3a6cdb89b13bc173cfce9526f836600469b0242fe62b8f92f8747896d7d47bb diff --git a/src/vdbeapi.c b/src/vdbeapi.c index 523f80097d..ed95494628 100644 --- a/src/vdbeapi.c +++ b/src/vdbeapi.c @@ -1808,7 +1808,7 @@ int sqlite3_bind_text64( assert( xDel!=SQLITE_DYNAMIC ); if( enc!=SQLITE_UTF8 ){ if( enc==SQLITE_UTF16 ) enc = SQLITE_UTF16NATIVE; - nData &= ~(u16)1; + nData &= ~(u64)1; } return bindText(pStmt, i, zData, nData, xDel, enc); } From 7d83ed04b11e7b7353f161f2ab706b4b88ec3c92 Mon Sep 17 00:00:00 2001 From: stephan Date: Mon, 7 Apr 2025 02:08:55 +0000 Subject: [PATCH 073/120] Make it legal to call proj-fatal from the global scope. FossilOrigin-Name: f1cf373b73f0e97767d6f3c9dd78ce04360eae1ed22f74bea4aeb922f3ca5b5b --- autosetup/proj.tcl | 23 +++++++++++++++-------- manifest | 14 +++++++------- manifest.uuid | 2 +- 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl index bfbf4716a8..f17ee37e86 100644 --- a/autosetup/proj.tcl +++ b/autosetup/proj.tcl @@ -74,18 +74,18 @@ set proj_(isatty) [isatty? stdout] # @proj-warn msg # # Emits a warning message to stderr. -proc proj-warn {msg} { +proc proj-warn {args} { show-notices - puts stderr "WARNING: $msg" + puts stderr "WARNING: $args" } ######################################################################## # @proj-error msg # # Emits an error message to stderr and exits with non-0. -proc proj-fatal {msg} { +proc proj-fatal {args} { show-notices - puts stderr "ERROR: \[[proj-current-proc-name 1]]: $msg" + puts stderr "ERROR: \[[proj-current-proc-name 1]]: $args" exit 1 } @@ -115,11 +115,11 @@ proc proj-assert {script {msg ""}} { # If this function believes that the current console might support # ANSI escape sequences then this returns $str wrapped in a sequence # to bold that text, else it returns $str as-is. -proc proj-bold {str} { +proc proj-bold {args} { if {$::autosetup(iswin) || !$::proj_(isatty)} { return $str } - return "\033\[1m${str}\033\[0m" + return "\033\[1m${args}\033\[0m" } ######################################################################## @@ -1417,10 +1417,17 @@ proc proj-get-env {var {dflt ""}} { # # Returns the name of the _calling_ proc from ($lvl + 1) levels up the # call stack (where the caller's level will be 1 up from _this_ -# call). It is not legal to call this from the top scope. +# call). If $lvl would resolve to global scope (or lower) then "global +# scope" is returned. proc proj-current-proc-name {{lvl 0}} { #uplevel [expr {$lvl + 1}] {lindex [info level 0] 0} - lindex [info level [expr {-$lvl - 1}]] 0 + set ilvl [info level] + set offset [expr {-$lvl - 1}] + if {[expr {$ilvl + $offset}] <= 0} { + return "global scope" + } else { + return lindex [info level $offset] 0 + } } diff --git a/manifest b/manifest index 34fae79b17..af4e5af960 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\sharmless\scode\stypo\sintroduced\sby\s[b57e3c3db00a6bc6]\sand\sreported\sby\n[forum:/forumpost/09957d8b2a|forum\spost\s09957d8b2a]. -D 2025-04-06T10:22:26.621 +C Make\sit\slegal\sto\scall\sproj-fatal\sfrom\sthe\sglobal\sscope. +D 2025-04-07T02:08:55.545 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -51,7 +51,7 @@ F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e F autosetup/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1821baf61bc86a7e F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba -F autosetup/proj.tcl 06ba9f7841e848cdebef11fe61e6e959e3e379b974edadc5eac8a76fd6885bb5 +F autosetup/proj.tcl 58800d7837f192a5457352a7b1b30dab610633dc9f656fe73644a3a49818aa08 F autosetup/sqlite-config.tcl 26fd6bca350a88a92253afdf02ddea0fa1f304ff18325a41f30478f7c0f10175 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 0e98bbddc7b5e39310a8bf345521d05fdbcc906e279c23aa24cf30489ceeeff8 -R 4ac80589d29845f42febfbd0c1aff7a6 -U drh -Z b03b8aeb0a4ead4233bdc4e4a1e00244 +P f3a6cdb89b13bc173cfce9526f836600469b0242fe62b8f92f8747896d7d47bb +R 7d67250d55da7e76d1914ae111cc9674 +U stephan +Z 19a4bbe3c3a5475c934efcf9544f10b0 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 656e0da598..7f183ca5a0 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -f3a6cdb89b13bc173cfce9526f836600469b0242fe62b8f92f8747896d7d47bb +f1cf373b73f0e97767d6f3c9dd78ce04360eae1ed22f74bea4aeb922f3ca5b5b From d2b9cc099d66fe220eb1c4883f865ec94cb37f52 Mon Sep 17 00:00:00 2001 From: stephan Date: Mon, 7 Apr 2025 02:16:26 +0000 Subject: [PATCH 074/120] Rename proj-current-proc-name to proj-current-scope and have it distinguish between global scope and an invalid scope level. FossilOrigin-Name: 1c7e5b6cab0f8c8d8ae4a1503ea04f2c65943b0788f3996c015fc163ae979a66 --- autosetup/proj.tcl | 21 ++++++++++++--------- autosetup/sqlite-config.tcl | 2 +- manifest | 14 +++++++------- manifest.uuid | 2 +- 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl index f17ee37e86..bfe21e5f6f 100644 --- a/autosetup/proj.tcl +++ b/autosetup/proj.tcl @@ -85,7 +85,7 @@ proc proj-warn {args} { # Emits an error message to stderr and exits with non-0. proc proj-fatal {args} { show-notices - puts stderr "ERROR: \[[proj-current-proc-name 1]]: $args" + puts stderr "ERROR: \[[proj-current-scope 1]]: $args" exit 1 } @@ -1413,20 +1413,23 @@ proc proj-get-env {var {dflt ""}} { } ######################################################################## -# @proj-current-proc-name +# @proj-current-scope ?lvl? # # Returns the name of the _calling_ proc from ($lvl + 1) levels up the # call stack (where the caller's level will be 1 up from _this_ -# call). If $lvl would resolve to global scope (or lower) then "global -# scope" is returned. -proc proj-current-proc-name {{lvl 0}} { +# call). If $lvl would resolve to global scope "global scope" is +# returned and if it would be negative then a string indicating such +# is returned (as opposed to throwing an error). +proc proj-current-scope {{lvl 0}} { #uplevel [expr {$lvl + 1}] {lindex [info level 0] 0} set ilvl [info level] - set offset [expr {-$lvl - 1}] - if {[expr {$ilvl + $offset}] <= 0} { + set offset [expr {$ilvl - $lvl - 1}] + if { $offset < 0} { + return "invalid scope ($offset)" + } elseif { $offset == 0} { return "global scope" } else { - return lindex [info level $offset] 0 + return [lindex [info level $offset] 0] } } @@ -1549,7 +1552,7 @@ proc proj-dot-ins-append {fileIn args} { proj-fatal "Too many arguments: $fileIn $args" } } - #puts "******* [proj-current-proc-name]: adding $fileIn" + #puts "******* [proj-current-scope]: adding $fileIn" lappend ::proj_(dot-in-files) $fileIn } diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl index 442039a780..2ab8508a8c 100644 --- a/autosetup/sqlite-config.tcl +++ b/autosetup/sqlite-config.tcl @@ -544,7 +544,7 @@ proc msg-debug {msg} { # the debug message. It is not legal to call this from the global # scope. proc proc-debug {msg} { - msg-debug "\[[proj-current-proc-name 1]\]: $msg" + msg-debug "\[[proj-current-scope 1]\]: $msg" } define OPT_FEATURE_FLAGS {} ; # -DSQLITE_OMIT/ENABLE flags. diff --git a/manifest b/manifest index af4e5af960..f3cf176924 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Make\sit\slegal\sto\scall\sproj-fatal\sfrom\sthe\sglobal\sscope. -D 2025-04-07T02:08:55.545 +C Rename\sproj-current-proc-name\sto\sproj-current-scope\sand\shave\sit\sdistinguish\sbetween\sglobal\sscope\sand\san\sinvalid\sscope\slevel. +D 2025-04-07T02:16:26.468 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -51,8 +51,8 @@ F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e F autosetup/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1821baf61bc86a7e F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba -F autosetup/proj.tcl 58800d7837f192a5457352a7b1b30dab610633dc9f656fe73644a3a49818aa08 -F autosetup/sqlite-config.tcl 26fd6bca350a88a92253afdf02ddea0fa1f304ff18325a41f30478f7c0f10175 +F autosetup/proj.tcl 6db2bf59cf8ba3c03de8b47dbd68384a889a14f6f2ef4d0ea2bb6daacd76a737 +F autosetup/sqlite-config.tcl 4d5d2a3baa2e3c1cba4558eb09b3436c40bf34697186315c61c7b2576eb88271 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x F contrib/sqlitecon.tcl eb4c6578e08dd353263958da0dc620f8400b869a50d06e271ab0be85a51a08d3 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P f3a6cdb89b13bc173cfce9526f836600469b0242fe62b8f92f8747896d7d47bb -R 7d67250d55da7e76d1914ae111cc9674 +P f1cf373b73f0e97767d6f3c9dd78ce04360eae1ed22f74bea4aeb922f3ca5b5b +R 272d71566c03b8b7d759df3c61c86b87 U stephan -Z 19a4bbe3c3a5475c934efcf9544f10b0 +Z df1186fc97cb233ff8f1984ae8875e7a # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 7f183ca5a0..a9396e5640 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -f1cf373b73f0e97767d6f3c9dd78ce04360eae1ed22f74bea4aeb922f3ca5b5b +1c7e5b6cab0f8c8d8ae4a1503ea04f2c65943b0788f3996c015fc163ae979a66 From f72c2fd19e9d20e2035d3e0b000fb9a37881734d Mon Sep 17 00:00:00 2001 From: stephan Date: Mon, 7 Apr 2025 18:29:57 +0000 Subject: [PATCH 075/120] During the post-configure validation of @VAR@ references, ignore commented-out references in files which seem (based on their name) to be makefiles, as it's sometimes handy to comment-out such vars during development of a configure script and its corresponding makefile(s). FossilOrigin-Name: 25d936b7b27d33b18bdac245bb193f7fbeaa9a7e7c320e47bdd433e6b371aef9 --- autosetup/proj.tcl | 15 +++++++++++++-- manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl index bfe21e5f6f..5c1f6bb346 100644 --- a/autosetup/proj.tcl +++ b/autosetup/proj.tcl @@ -1601,12 +1601,23 @@ proc proj-dot-ins-process {args} { # For each filename given to it, it validates that the file has no # unresolved @VAR@ references. If it finds any, it produces an error # with location information. +# +# Exception: if a filename matches the pattern {*[Mm]ake*} AND a given +# line begins with a # (not including leading whitespace) then that +# line is ignored for purposes of this validation. The intent is that +# @VAR@ inside of makefile comments should not (necessarily) cause +# validation to fail, as it's sometimes convenient to comment out +# sections during development of a configure script and its +# corresponding makefile(s). proc proj-validate-no-unresolved-ats {args} { foreach f $args { set lnno 1 + set isMake [string match {*[Mm]ake*} $f] foreach line [proj-file-content-list $f] { - if {[regexp {(@[A-Za-z0-9_]+@)} $line match]} { - error "Unresolved reference to $match at line $lnno of $f" + if {!$isMake || ![string match "#*" [string trimleft $line]]} { + if {[regexp {(@[A-Za-z0-9_]+@)} $line match]} { + error "Unresolved reference to $match at line $lnno of $f" + } } incr lnno } diff --git a/manifest b/manifest index f3cf176924..8c2c8582af 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Rename\sproj-current-proc-name\sto\sproj-current-scope\sand\shave\sit\sdistinguish\sbetween\sglobal\sscope\sand\san\sinvalid\sscope\slevel. -D 2025-04-07T02:16:26.468 +C During\sthe\spost-configure\svalidation\sof\s@VAR@\sreferences,\signore\scommented-out\sreferences\sin\sfiles\swhich\sseem\s(based\son\stheir\sname)\sto\sbe\smakefiles,\sas\sit's\ssometimes\shandy\sto\scomment-out\ssuch\svars\sduring\sdevelopment\sof\sa\sconfigure\sscript\sand\sits\scorresponding\smakefile(s). +D 2025-04-07T18:29:57.707 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -51,7 +51,7 @@ F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e F autosetup/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1821baf61bc86a7e F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba -F autosetup/proj.tcl 6db2bf59cf8ba3c03de8b47dbd68384a889a14f6f2ef4d0ea2bb6daacd76a737 +F autosetup/proj.tcl a02eddcb7a940e36732993c09b8e59e65fb4a196fedbd85af4d93713c4802797 F autosetup/sqlite-config.tcl 4d5d2a3baa2e3c1cba4558eb09b3436c40bf34697186315c61c7b2576eb88271 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P f1cf373b73f0e97767d6f3c9dd78ce04360eae1ed22f74bea4aeb922f3ca5b5b -R 272d71566c03b8b7d759df3c61c86b87 +P 1c7e5b6cab0f8c8d8ae4a1503ea04f2c65943b0788f3996c015fc163ae979a66 +R 26d5dd0f527a3c74906fdb59e7432e75 U stephan -Z df1186fc97cb233ff8f1984ae8875e7a +Z 0d654b488cce619861d795377994e868 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index a9396e5640..72b1465bb5 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -1c7e5b6cab0f8c8d8ae4a1503ea04f2c65943b0788f3996c015fc163ae979a66 +25d936b7b27d33b18bdac245bb193f7fbeaa9a7e7c320e47bdd433e6b371aef9 From 6864f78fdf9d112d478763bd24c0684a39362a84 Mon Sep 17 00:00:00 2001 From: dan Date: Tue, 8 Apr 2025 15:58:19 +0000 Subject: [PATCH 076/120] Have sqlite3session_diff() automatically attach tables to session objects, as it has always been documented to do. FossilOrigin-Name: ec1641858ec48d96f5a2ddce4575ebd40a18932d69831fdb4eafc9acf508f216 --- ext/session/sessionD.test | 28 ++++++++++++++++++++++++++++ ext/session/sqlite3session.c | 2 ++ manifest | 17 ++++++++--------- manifest.uuid | 2 +- 4 files changed, 39 insertions(+), 10 deletions(-) diff --git a/ext/session/sessionD.test b/ext/session/sessionD.test index 9fccbfa96f..f60fbabc2a 100644 --- a/ext/session/sessionD.test +++ b/ext/session/sessionD.test @@ -230,4 +230,32 @@ do_catchsql_test 4.5.2 { SELECT * FROM ixua.i8; } {1 {no such table: ixua.i8}} +#------------------------------------------------------------------------- +# Test that sqlite3session_diff() really does automatically attach tables, +# as documented. +# +reset_db +forcedelete test.db2 +do_execsql_test 4.0 { + ATTACH 'test.db2' AS two; + CREATE TABLE two.t1(a PRIMARY KEY, b, c); + CREATE TABLE t1(a PRIMARY KEY, b, c); + + INSERT INTO two.t1 VALUES(1, 2, 3), (4, 5, 6), (7, 8, 9); +} + +do_test 4.1 { + sqlite3session S db main + S attach t8 + S diff two t1 +} {} + +do_changeset_test 4.2 S { + {DELETE t1 0 X.. {i 1 i 2 i 3} {}} + {DELETE t1 0 X.. {i 4 i 5 i 6} {}} + {DELETE t1 0 X.. {i 7 i 8 i 9} {}} +} + +S delete + finish_test diff --git a/ext/session/sqlite3session.c b/ext/session/sqlite3session.c index 7d6f21255b..6c386f42e2 100644 --- a/ext/session/sqlite3session.c +++ b/ext/session/sqlite3session.c @@ -2216,7 +2216,9 @@ int sqlite3session_diff( SessionTable *pTo; /* Table zTbl */ /* Locate and if necessary initialize the target table object */ + pSession->bAutoAttach++; rc = sessionFindTable(pSession, zTbl, &pTo); + pSession->bAutoAttach--; if( pTo==0 ) goto diff_out; if( sessionInitTable(pSession, pTo, pSession->db, pSession->zDb) ){ rc = pSession->rc; diff --git a/manifest b/manifest index aa15323e07..7b327aaacc 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Reduce\sthe\sdelay\scaused\sby\santi-virus\sretries\sin\sWindows\swhen\sattempting\sto\nopen\sa\sdatabase\sfile\swith\sinsufficient\spermission. -D 2025-03-26T22:23:22.787 +C Have\ssqlite3session_diff()\sautomatically\sattach\stables\sto\ssession\sobjects,\sas\sit\shas\salways\sbeen\sdocumented\sto\sdo. +D 2025-04-08T15:58:19.760 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -588,7 +588,7 @@ F ext/session/session9.test 4e3aff62d6b4294498ddbe309076de06f4fddffad4fe5f5a6c03 F ext/session/sessionA.test 1feeab0b8e03527f08f2f1defb442da25480138f F ext/session/sessionB.test c4fb7f8a688787111606e123a555f18ee04f65bb9f2a4bb2aa71d55ce4e6d02c F ext/session/sessionC.test f8a5508bc059ae646e5ec9bdbca66ad24bc92fe99fda5790ac57e1f59fce2fdf -F ext/session/sessionD.test f5c6a762d00bc6ca9d561695c322ba8ecca2bed370486707ef37cf565d2f6c73 +F ext/session/sessionD.test 9d5d1d07bfc2de8400cd8607297dcd405e2889ccae58ae17db054de5fcae37ab F ext/session/sessionE.test b2010949c9d7415306f64e3c2072ddabc4b8250c98478d3c0c4d064bce83111d F ext/session/sessionF.test d37ed800881e742c208df443537bf29aa49fd56eac520d0f0c6df3e6320f3401 F ext/session/sessionG.test 3efe388282d641b65485b5462e67851002cd91a282dc95b685d085eb8efdad0a @@ -616,7 +616,7 @@ F ext/session/sessionrowid.test 85187c2f1b38861a5844868126f69f9ec62223a03449a98a F ext/session/sessionsize.test 8fcf4685993c3dbaa46a24183940ab9f5aa9ed0d23e5fb63bfffbdb56134b795 F ext/session/sessionstat1.test 5e718d5888c0c49bbb33a7a4f816366db85f59f6a4f97544a806421b85dc2dec F ext/session/sessionwor.test 6fd9a2256442cebde5b2284936ae9e0d54bde692d0f5fd009ecef8511f4cf3fc -F ext/session/sqlite3session.c 8011b9531c7dd8dce55226def022f3303ce40d0b45966877f2c35185f4b1c3fc +F ext/session/sqlite3session.c b0f44e89facdf03feacd040b18b6fb04a5cc55095be8b688f3cbb1412eeab993 F ext/session/sqlite3session.h aa5de3ec8ef0e5313e9f65dafd69e8ba292d170f07b57da9200c040068dab061 F ext/session/test_session.c 12e0a2c15fd60f92da4bb29c697c9177ff0c0dbcdc5129a54c47e999f147937a F ext/wasm/EXPORTED_FUNCTIONS.fiddle.in 27450c8b8c70875a260aca55435ec927068b34cef801a96205adb81bdcefc65c @@ -2215,9 +2215,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 1f98fc07fdf06d699ffbf1521b0b5e937a582017e4325bd994b488e06becbecc ccdd67ad9a508530ccfcec582410768c24bca4eb8b05939577fb99a50dd44b15 -R 6c2ac8039a69021b5d572668708823ae -T +closed ccdd67ad9a508530ccfcec582410768c24bca4eb8b05939577fb99a50dd44b15 -U drh -Z 0d5fc73351502e2a61a26190ba1c4a5b +P d25c8a6222d4e3f20c137b1490572ad491d9c404ff12947d5867c3e00fcb615c +R 13e264ccaec04013121101913f0528fa +U dan +Z c782dc2350defbb4dda4222346152588 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 35e8e088e6..c9ba77d521 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -d25c8a6222d4e3f20c137b1490572ad491d9c404ff12947d5867c3e00fcb615c +ec1641858ec48d96f5a2ddce4575ebd40a18932d69831fdb4eafc9acf508f216 From fda6e50ac86bfd926c0bd42cf350e743cfdf5bca Mon Sep 17 00:00:00 2001 From: drh <> Date: Tue, 8 Apr 2025 20:00:33 +0000 Subject: [PATCH 077/120] Remove an incorrect ALWAYS() macro. [forum:/forumpost/23875495059357a2|Forum post 2025-04-08T19:16:42Z]. FossilOrigin-Name: 062cca9c63ef6d7b9a525df69391e9b032284703aeb45a18c728305dd5957c43 --- manifest | 15 +++++++-------- manifest.uuid | 2 +- src/utf.c | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/manifest b/manifest index 22e04a0a40..5c53411289 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Have\ssqlite3session_diff()\sautomatically\sattach\stables\sto\ssession\sobjects,\sas\sit\shas\salways\sbeen\sdocumented\sto\sdo. -D 2025-04-08T17:18:01.341 +C Remove\san\sincorrect\sALWAYS()\smacro.\s\s[forum:/forumpost/23875495059357a2|Forum\spost\s2025-04-08T19:16:42Z]. +D 2025-04-08T20:00:33.824 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -851,7 +851,7 @@ F src/treeview.c d85ce76e6d1498d781957c07cb234da6d77ce0ed2d196480d516f54dabc6227 F src/trigger.c 3ffb8ed6b64dbcc0ccae6e82435d01be3bf547e13b814e2d46f7df9bef84748e F src/update.c 3e5e7ff66fa19ebe4d1b113d480639a24cc1175adbefabbd1a948a07f28e37cf F src/upsert.c 215328c3f91623c520ec8672c44323553f12caeb4f01b1090ebdca99fdf7b4f1 -F src/utf.c d4d55ca95106a2029ec1cdbd2497a34e69ea1d338f1a9d80ef15ebf4ff01690d +F src/utf.c 3a20cbae9688af4c1e3754cc2520189d00762e37f60c2deb0b303360d166bba6 F src/util.c 36fb1150062957280777655976f3f9a75db236cb8207a0770ceae8d5ec17fcd3 F src/vacuum.c fbfc3e074c865d2b5b10b8a65a3783275b80c152653590690747a102bb6cc770 F src/vdbe.c b5deed01000b3970cfca089dc531cf9342afd96d00cc8b4ad26d303f088116ee @@ -2216,9 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 25d936b7b27d33b18bdac245bb193f7fbeaa9a7e7c320e47bdd433e6b371aef9 ec1641858ec48d96f5a2ddce4575ebd40a18932d69831fdb4eafc9acf508f216 -R 6ebf5bfd5cb344d6acbf7a36fe4e2d13 -T +closed ec1641858ec48d96f5a2ddce4575ebd40a18932d69831fdb4eafc9acf508f216 -U dan -Z e1edca485bdff3fedae013ef977a47a5 +P 99827144f112303e27a829c990b1858d227bd7369095100a435c367637985fad +R 91b13f4ff305e3d80ef9a44cf85a7a37 +U drh +Z da0ef43ade8651ffc793a2c525f660e1 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index ac7be16e77..11830e35f0 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -99827144f112303e27a829c990b1858d227bd7369095100a435c367637985fad +062cca9c63ef6d7b9a525df69391e9b032284703aeb45a18c728305dd5957c43 diff --git a/src/utf.c b/src/utf.c index 57700bf20d..e24e1586bb 100644 --- a/src/utf.c +++ b/src/utf.c @@ -555,7 +555,7 @@ int sqlite3Utf16ByteLen(const void *zIn, int nByte, int nChar){ int n = 0; if( SQLITE_UTF16NATIVE==SQLITE_UTF16LE ) z++; - while( n=0xd8 && c<0xdc && z<=zEnd && z[0]>=0xdc && z[0]<0xe0 ) z += 2; From 509d899a2dec05549c88147429c205598d9ee061 Mon Sep 17 00:00:00 2001 From: stephan Date: Wed, 9 Apr 2025 13:32:15 +0000 Subject: [PATCH 078/120] Doc updates in proj.tcl. Improve configure check for whether fdatasync or nanosleep require -lrt. Remove references to 'tcl-config' build mode from sqlite-config.tcl, as that build is now implemented without a depency on sqlite-config.tcl because the TEA build's needs are considerably more modest. FossilOrigin-Name: 394bef54411c81fd8ca3aafc13ec2a774e9ff56c7282d90b8425cc8f383aa74c --- autosetup/proj.tcl | 17 +++++++++++++---- autosetup/sqlite-config.tcl | 33 +++++++++++++++++++-------------- manifest | 16 ++++++++-------- manifest.uuid | 2 +- 4 files changed, 41 insertions(+), 27 deletions(-) diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl index 5c1f6bb346..75ec46c64c 100644 --- a/autosetup/proj.tcl +++ b/autosetup/proj.tcl @@ -648,10 +648,12 @@ proc proj-file-write {args} { # which controls whether to run/skip this check. # # Returns 1 if supported, else 0. Defines MAKE_COMPILATION_DB to "yes" -# if supported, "no" if not. +# if supported, "no" if not. The use of MAKE_COMPILATION_DB is +# deprecated/discouraged. It also sets HAVE_COMPILE_COMMANDS to 0 or +# 1, and that's the preferred usage. # -# This test has a long history of false positive results because of -# compilers reacting differently to the -MJ flag. +# ACHTUNG: this test has a long history of false positive results +# because of compilers reacting differently to the -MJ flag. proc proj-check-compile-commands {{configFlag {}}} { msg-checking "compile_commands.json support... " if {"" ne $configFlag && ![proj-opt-truthy $configFlag]} { @@ -664,11 +666,13 @@ proc proj-check-compile-commands {{configFlag {}}} { # Martin G.'s older systems. drh also reports a false # positive on an unspecified older Mac system. msg-result "compiler supports compile_commands.json" - define MAKE_COMPILATION_DB yes + define MAKE_COMPILATION_DB yes; # deprecated + define HAVE_COMPILE_COMMANDS 1 return 1 } else { msg-result "compiler does not support compile_commands.json" define MAKE_COMPILATION_DB no + define HAVE_COMPILE_COMMANDS 0 return 0 } } @@ -1259,6 +1263,11 @@ proc proj-dump-defs-json {file args} { # over any values from hidden aliases into their canonical names, such # that [opt-value canonical] will return X if --alias=X is passed to # configure. +# +# That said: autosetup's [opt-src] does support alias forms, but it +# requires that the caller know all possible aliases. It's simpler, in +# terms of options handling, if there's only a single canonical name +# which each down-stream call of [opt-...] has to know. proc proj-xfer-options-aliases {mapping} { foreach {hidden - canonical} [proj-strip-hash-comments $mapping] { if {[proj-opt-was-provided $hidden]} { diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl index 2ab8508a8c..0e50f9dd25 100644 --- a/autosetup/sqlite-config.tcl +++ b/autosetup/sqlite-config.tcl @@ -63,14 +63,13 @@ array set sqliteConfig [subst [proj-strip-hash-comments { # # The list of feature --flags which the --all flag implies. This - # requires special handling in a few places and gets replaced with - # a different list in the tcl-extension build. + # requires special handling in a few places. # all-flag-enables {fts4 fts5 rtree geopoly session} # - # Default value for the --all flag. Gets changed for the - # tcl-extension build. + # Default value for the --all flag. Can hypothetically be modified + # by non-canonical builds. # all-flag-default 0 }]] @@ -97,7 +96,7 @@ array set sqliteConfig [subst [proj-strip-hash-comments { proc sqlite-configure {buildMode configScript} { proj-assert {$::sqliteConfig(build-mode) eq "unknown"} \ "sqlite-configure must not be called more than once" - set allBuildModes {canonical autoconf tcl-extension} + set allBuildModes {canonical autoconf} if {$buildMode ni $allBuildModes} { user-error "Invalid build mode: $buildMode. Expecting one of: $allBuildModes" } @@ -229,7 +228,7 @@ proc sqlite-configure {buildMode configScript} { copy of autosetup/jimsh0.c for that. The SQLite TCL extension and the test code require a canonical tclsh.} } - {canonical tcl-extension} { + {canonical} { with-tcl:DIR => {Directory containing tclConfig.sh or a directory one level up from that, from which we can derive a directory containing tclConfig.sh. @@ -620,15 +619,21 @@ proc sqlite-check-common-system-deps {} { cc-check-functions gmtime_r isnan localtime_r localtime_s \ malloc_usable_size strchrnul usleep utime pread pread64 pwrite pwrite64 - set ldrt "" - # Collapse funcs from librt into LDFLAGS_RT. - # Some systems (ex: SunOS) require -lrt in order to use nanosleep - foreach func {fdatasync nanosleep} { - if {[proj-check-function-in-lib $func rt]} { - lappend ldrt [get-define lib_${func}] + apply {{} { + set ldrt "" + # Collapse funcs from librt into LDFLAGS_RT. + # Some systems (ex: SunOS) require -lrt in order to use nanosleep + foreach func {fdatasync nanosleep} { + if {[proj-check-function-in-lib $func rt]} { + set ldrt [get-define lib_${func} ""] + undefine lib_${func} + if {"" ne $ldrt} { + break + } + } } - } - define LDFLAGS_RT [join [lsort -unique $ldrt] ""] + define LDFLAGS_RT $ldrt + }} # Check for needed/wanted headers cc-check-includes \ diff --git a/manifest b/manifest index 5c53411289..31ce7f2d77 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Remove\san\sincorrect\sALWAYS()\smacro.\s\s[forum:/forumpost/23875495059357a2|Forum\spost\s2025-04-08T19:16:42Z]. -D 2025-04-08T20:00:33.824 +C Doc\supdates\sin\sproj.tcl.\sImprove\sconfigure\scheck\sfor\swhether\sfdatasync\sor\snanosleep\srequire\s-lrt.\sRemove\sreferences\sto\s'tcl-config'\sbuild\smode\sfrom\ssqlite-config.tcl,\sas\sthat\sbuild\sis\snow\simplemented\swithout\sa\sdepency\son\ssqlite-config.tcl\sbecause\sthe\sTEA\sbuild's\sneeds\sare\sconsiderably\smore\smodest. +D 2025-04-09T13:32:15.311 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -51,8 +51,8 @@ F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e F autosetup/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1821baf61bc86a7e F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba -F autosetup/proj.tcl a02eddcb7a940e36732993c09b8e59e65fb4a196fedbd85af4d93713c4802797 -F autosetup/sqlite-config.tcl 4d5d2a3baa2e3c1cba4558eb09b3436c40bf34697186315c61c7b2576eb88271 +F autosetup/proj.tcl e4170f543e417fcc1ae3c8aedcf8d6044221dbdeb880d324579730e0c96a6198 +F autosetup/sqlite-config.tcl a61e86a4033e3a77680bfba45e7950950285beaf756ddc2d14bec5147972d2b1 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x F contrib/sqlitecon.tcl eb4c6578e08dd353263958da0dc620f8400b869a50d06e271ab0be85a51a08d3 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 99827144f112303e27a829c990b1858d227bd7369095100a435c367637985fad -R 91b13f4ff305e3d80ef9a44cf85a7a37 -U drh -Z da0ef43ade8651ffc793a2c525f660e1 +P 062cca9c63ef6d7b9a525df69391e9b032284703aeb45a18c728305dd5957c43 +R 92b3c5f2612e90a858308a2688d29a68 +U stephan +Z 18638b3b1088f615bed2bb48a17a75b6 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 11830e35f0..66e517a16a 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -062cca9c63ef6d7b9a525df69391e9b032284703aeb45a18c728305dd5957c43 +394bef54411c81fd8ca3aafc13ec2a774e9ff56c7282d90b8425cc8f383aa74c From 8a6f89c845763b11023e438e0fa63dc80aeda72d Mon Sep 17 00:00:00 2001 From: drh <> Date: Thu, 10 Apr 2025 10:18:07 +0000 Subject: [PATCH 079/120] Remove unnecessary "www." prefixes on domain names in URLs. FossilOrigin-Name: 20acd630b91609725794ce84f9eda01d5f3c898407f0948264830851d25ccaa6 --- README.md | 24 +-- autoconf/README.txt | 2 +- autoconf/tea/doc/sqlite3.n | 4 +- doc/lemon.html | 2 +- ext/README.md | 2 +- ext/fts5/fts5_test_mi.c | 2 +- ext/fts5/fts5_unicode2.c | 1 - .../org/sqlite/jni/wrapper1/SqlFunction.java | 2 +- ext/misc/README.md | 12 +- ext/misc/closure.c | 2 +- ext/misc/fossildelta.c | 2 +- ext/misc/series.c | 2 +- ext/misc/spellfix.c | 2 +- ext/misc/vfsstat.c | 2 +- ext/wasm/api/sqlite3-api-prologue.js | 4 +- manifest | 172 +++++++++--------- manifest.uuid | 2 +- src/build.c | 4 +- src/insert.c | 2 +- src/select.c | 2 +- src/sqlite.h.in | 2 +- src/sqlite3.rc | 2 +- src/vacuum.c | 2 +- src/vdbemem.c | 2 +- src/wherecode.c | 2 +- test/affinity2.test | 2 +- test/affinity3.test | 8 +- test/alter4.test | 2 +- test/altercol.test | 2 +- test/altertab2.test | 2 +- test/analyzeC.test | 2 +- test/autoinc.test | 2 +- test/autoindex5.test | 2 +- test/btree01.test | 2 +- test/cast.test | 8 +- test/colname.test | 2 +- test/conflict.test | 2 +- test/date.test | 2 +- test/delete4.test | 2 +- test/expr.test | 2 +- test/func.test | 2 +- test/func3.test | 2 +- test/gencol1.test | 6 +- test/in.test | 6 +- test/index.test | 4 +- test/index6.test | 8 +- test/indexexpr1.test | 10 +- test/insert.test | 6 +- test/instr.test | 2 +- test/intpkey.test | 4 +- test/join.test | 6 +- test/join5.test | 4 +- test/json101.test | 6 +- test/json103.test | 2 +- test/like.test | 2 +- test/like3.test | 6 +- test/limit2.test | 8 +- test/minmax.test | 2 +- test/orderby1.test | 2 +- test/orderby3.test | 2 +- test/orderby4.test | 2 +- test/rowvalue.test | 8 +- test/rowvalue3.test | 2 +- test/rowvalue7.test | 2 +- test/savepoint7.test | 2 +- test/select3.test | 2 +- test/select4.test | 4 +- test/select6.test | 2 +- test/subquery2.test | 2 +- test/tabfunc01.test | 2 +- test/table.test | 6 +- test/trigger1.test | 2 +- test/triggerG.test | 2 +- test/update.test | 8 +- test/upsert1.test | 2 +- test/where.test | 8 +- test/where2.test | 2 +- test/whereG.test | 4 +- test/window1.test | 6 +- test/with1.test | 2 +- test/without_rowid1.test | 6 +- tool/srcck1.c | 2 +- 82 files changed, 233 insertions(+), 234 deletions(-) diff --git a/README.md b/README.md index d6d41da3b9..0be1fb9f43 100644 --- a/README.md +++ b/README.md @@ -57,18 +57,18 @@ If you do not want to use Fossil, you can download tarballs or ZIP archives or [SQLite archives](https://sqlite.org/cli.html#sqlar) as follows: * Latest trunk check-in as - [Tarball](https://www.sqlite.org/src/tarball/sqlite.tar.gz), - [ZIP-archive](https://www.sqlite.org/src/zip/sqlite.zip), or - [SQLite-archive](https://www.sqlite.org/src/sqlar/sqlite.sqlar). + [Tarball](https://sqlite.org/src/tarball/sqlite.tar.gz), + [ZIP-archive](https://sqlite.org/src/zip/sqlite.zip), or + [SQLite-archive](https://sqlite.org/src/sqlar/sqlite.sqlar). * Latest release as - [Tarball](https://www.sqlite.org/src/tarball/sqlite.tar.gz?r=release), - [ZIP-archive](https://www.sqlite.org/src/zip/sqlite.zip?r=release), or - [SQLite-archive](https://www.sqlite.org/src/sqlar/sqlite.sqlar?r=release). + [Tarball](https://sqlite.org/src/tarball/sqlite.tar.gz?r=release), + [ZIP-archive](https://sqlite.org/src/zip/sqlite.zip?r=release), or + [SQLite-archive](https://sqlite.org/src/sqlar/sqlite.sqlar?r=release). * For other check-ins, substitute an appropriate branch name or tag or hash prefix in place of "release" in the URLs of the previous - bullet. Or browse the [timeline](https://www.sqlite.org/src/timeline) + bullet. Or browse the [timeline](https://sqlite.org/src/timeline) to locate the check-in desired, click on its information page link, then click on the "Tarball" or "ZIP Archive" links on the information page. @@ -308,14 +308,14 @@ individual source file exceeds 32K lines in length. ## How It All Fits Together SQLite is modular in design. -See the [architectural description](https://www.sqlite.org/arch.html) +See the [architectural description](https://sqlite.org/arch.html) for details. Other documents that are useful in helping to understand how SQLite works include the -[file format](https://www.sqlite.org/fileformat2.html) description, -the [virtual machine](https://www.sqlite.org/opcode.html) that runs +[file format](https://sqlite.org/fileformat2.html) description, +the [virtual machine](https://sqlite.org/opcode.html) that runs prepared statements, the description of -[how transactions work](https://www.sqlite.org/atomiccommit.html), and -the [overview of the query planner](https://www.sqlite.org/optoverview.html). +[how transactions work](https://sqlite.org/atomiccommit.html), and +the [overview of the query planner](https://sqlite.org/optoverview.html). Decades of effort have gone into optimizing SQLite, both for small size and high performance. And optimizations tend to result in diff --git a/autoconf/README.txt b/autoconf/README.txt index 1192a80fb1..ca0ed20fd4 100644 --- a/autoconf/README.txt +++ b/autoconf/README.txt @@ -90,7 +90,7 @@ Other preprocessor defines Additionally, preprocessor defines may be specified by using the OPTS macro on the NMAKE command line. However, not all possible preprocessor defines may be specified in this manner as some require the amalgamation to be built -with them enabled (see http://www.sqlite.org/compile.html). For example, the +with them enabled (see http://sqlite.org/compile.html). For example, the following will work: "OPTS=-DSQLITE_ENABLE_STAT4=1 -DSQLITE_OMIT_JSON=1" diff --git a/autoconf/tea/doc/sqlite3.n b/autoconf/tea/doc/sqlite3.n index 13913e5583..a19e1811ad 100644 --- a/autoconf/tea/doc/sqlite3.n +++ b/autoconf/tea/doc/sqlite3.n @@ -11,5 +11,5 @@ SQLite3 is a self-contains, zero-configuration, transactional SQL database engine. This extension provides an easy to use interface for accessing SQLite database files from Tcl. .PP -For full documentation see \fIhttp://www.sqlite.org/\fR and -in particular \fIhttp://www.sqlite.org/tclsqlite.html\fR. +For full documentation see \fIhttp://sqlite.org/\fR and +in particular \fIhttp://sqlite.org/tclsqlite.html\fR. diff --git a/doc/lemon.html b/doc/lemon.html index 24bccce082..965f305c04 100644 --- a/doc/lemon.html +++ b/doc/lemon.html @@ -846,7 +846,7 @@ or more tokens. The alternative meaning is tried if the original token would have generated a syntax error.

The %fallback directive was added to support robust parsing of SQL -syntax in SQLite. +syntax in SQLite. The SQL language contains a large assortment of keywords, each of which appears as a different token to the language parser. SQL contains so many keywords that it can be difficult for programmers to keep up with diff --git a/ext/README.md b/ext/README.md index 933a33d053..78312819ab 100644 --- a/ext/README.md +++ b/ext/README.md @@ -1,6 +1,6 @@ ## Loadable Extensions -Various [loadable extensions](https://www.sqlite.org/loadext.html) for +Various [loadable extensions](https://sqlite.org/loadext.html) for SQLite are found in subfolders. Most subfolders are dedicated to a single loadable extension (for diff --git a/ext/fts5/fts5_test_mi.c b/ext/fts5/fts5_test_mi.c index f56c890cd7..e8648a4d22 100644 --- a/ext/fts5/fts5_test_mi.c +++ b/ext/fts5/fts5_test_mi.c @@ -14,7 +14,7 @@ ** versions of FTS5. It contains the implementation of an FTS5 auxiliary ** function very similar to the FTS4 function matchinfo(): ** -** https://www.sqlite.org/fts3.html#matchinfo +** https://sqlite.org/fts3.html#matchinfo ** ** Known differences are that: ** diff --git a/ext/fts5/fts5_unicode2.c b/ext/fts5/fts5_unicode2.c index cc164a4569..2133d5d5b8 100644 --- a/ext/fts5/fts5_unicode2.c +++ b/ext/fts5/fts5_unicode2.c @@ -778,4 +778,3 @@ void sqlite3Fts5UnicodeAscii(u8 *aArray, u8 *aAscii){ } aAscii[0] = 0; /* 0x00 is never a token character */ } - diff --git a/ext/jni/src/org/sqlite/jni/wrapper1/SqlFunction.java b/ext/jni/src/org/sqlite/jni/wrapper1/SqlFunction.java index dcfc2ebebd..a700dd7779 100644 --- a/ext/jni/src/org/sqlite/jni/wrapper1/SqlFunction.java +++ b/ext/jni/src/org/sqlite/jni/wrapper1/SqlFunction.java @@ -144,7 +144,7 @@ public interface SqlFunction { range. */ public void setAuxData(int argNdx, Object o){ - /* From the API docs: https://www.sqlite.org/c3ref/get_auxdata.html + /* From the API docs: https://sqlite.org/c3ref/get_auxdata.html The value of the N parameter to these interfaces should be non-negative. Future enhancements may make use of negative N diff --git a/ext/misc/README.md b/ext/misc/README.md index 69cb230255..cfc9e867c0 100644 --- a/ext/misc/README.md +++ b/ext/misc/README.md @@ -1,7 +1,7 @@ ## Miscellaneous Extensions This folder contains a collection of smaller loadable extensions. -See for instructions on how +See for instructions on how to compile and use loadable extensions. Each extension in this folder is implemented in a single file of C code. @@ -10,9 +10,9 @@ header comments for details about each extension. Additional notes are as follows: * **carray.c** — This module implements the - [carray](https://www.sqlite.org/carray.html) table-valued function. + [carray](https://sqlite.org/carray.html) table-valued function. It is a good example of how to go about implementing a custom - [table-valued function](https://www.sqlite.org/vtab.html#tabfunc2). + [table-valued function](https://sqlite.org/vtab.html#tabfunc2). * **csv.c** — A [virtual table](https://sqlite.org/vtab.html) for reading @@ -21,7 +21,7 @@ as follows: * **dbdump.c** — This is not actually a loadable extension, but rather a library that implements an approximate equivalent to the ".dump" command of the - [command-line shell](https://www.sqlite.org/cli.html). + [command-line shell](https://sqlite.org/cli.html). * **json1.c** — Various SQL functions and table-valued functions for processing JSON. This extension is already built into the @@ -29,7 +29,7 @@ as follows: for additional information. * **memvfs.c** — This file implements a custom - [VFS](https://www.sqlite.org/vfs.html) that stores an entire database + [VFS](https://sqlite.org/vfs.html) that stores an entire database file in a single block of RAM. It serves as a good example of how to implement a simple custom VFS. @@ -38,7 +38,7 @@ as follows: new custom SQL functions for SQLite. * **series.c** — This is an implementation of the - "generate_series" [virtual table](https://www.sqlite.org/vtab.html). + "generate_series" [virtual table](https://sqlite.org/vtab.html). It can make a good template for new custom virtual table implementations. * **shathree.c** — An implementation of the sha3() and diff --git a/ext/misc/closure.c b/ext/misc/closure.c index 267ae1c424..14caf271f9 100644 --- a/ext/misc/closure.c +++ b/ext/misc/closure.c @@ -137,7 +137,7 @@ ** AND closure.idname='groupId' ** AND closure.parentname='parentId'; ** -** See the documentation at http://www.sqlite.org/loadext.html for information +** See the documentation at http://sqlite.org/loadext.html for information ** on how to compile and use loadable extensions such as this one. */ #include "sqlite3ext.h" diff --git a/ext/misc/fossildelta.c b/ext/misc/fossildelta.c index e638737d2b..9f81270d7b 100644 --- a/ext/misc/fossildelta.c +++ b/ext/misc/fossildelta.c @@ -22,7 +22,7 @@ ** The delta format is the Fossil delta format, described in a comment ** on the delete_create() function implementation below, and also at ** -** https://www.fossil-scm.org/fossil/doc/trunk/www/delta_format.wiki +** https://fossil-scm.org/fossil/doc/trunk/www/delta_format.wiki ** ** This delta format is used by the RBU extension, which is the main ** reason that these routines are included in the extension library. diff --git a/ext/misc/series.c b/ext/misc/series.c index 4e328d298c..22e0f7edbe 100644 --- a/ext/misc/series.c +++ b/ext/misc/series.c @@ -580,7 +580,7 @@ static int seriesFilter( for(i=0; iaiColumn[j] = pPk->aiColumn[i]; pIdx->azColl[j] = pPk->azColl[i]; if( pPk->aSortOrder[i] ){ - /* See ticket https://www.sqlite.org/src/info/bba7b69f9849b5bf */ + /* See ticket https://sqlite.org/src/info/bba7b69f9849b5bf */ pIdx->bAscKeyBug = 1; } j++; @@ -3835,7 +3835,7 @@ static void sqlite3RefillIndex(Parse *pParse, Index *pIndex, int memRootPage){ ** not work for UNIQUE constraint indexes on WITHOUT ROWID tables ** with DESC primary keys, since those indexes have there keys in ** a different order from the main table. - ** See ticket: https://www.sqlite.org/src/info/bba7b69f9849b5bf + ** See ticket: https://sqlite.org/src/info/bba7b69f9849b5bf */ sqlite3VdbeAddOp1(v, OP_SeekEnd, iIdx); } diff --git a/src/insert.c b/src/insert.c index 7dc9bfd8b1..fdd9c8da2a 100644 --- a/src/insert.c +++ b/src/insert.c @@ -2113,7 +2113,7 @@ void sqlite3GenerateConstraintChecks( ** could happen in any order, but they are grouped up front for ** convenience. ** - ** 2018-08-14: Ticket https://www.sqlite.org/src/info/908f001483982c43 + ** 2018-08-14: Ticket https://sqlite.org/src/info/908f001483982c43 ** The order of constraints used to have OE_Update as (2) and OE_Abort ** and so forth as (1). But apparently PostgreSQL checks the OE_Update ** constraint before any others, so it had to be moved. diff --git a/src/select.c b/src/select.c index b2f2cc7fb8..315471ef1b 100644 --- a/src/select.c +++ b/src/select.c @@ -5586,7 +5586,7 @@ int sqlite3IndexedByLookup(Parse *pParse, SrcItem *pFrom){ ** above that generates the code for a compound SELECT with an ORDER BY clause ** uses a merge algorithm that requires the same collating sequence on the ** result columns as on the ORDER BY clause. See ticket -** http://www.sqlite.org/src/info/6709574d2a +** http://sqlite.org/src/info/6709574d2a ** ** This transformation is only needed for EXCEPT, INTERSECT, and UNION. ** The UNION ALL operator works fine with multiSelectOrderBy() even when diff --git a/src/sqlite.h.in b/src/sqlite.h.in index 71338031c8..d3164d9068 100644 --- a/src/sqlite.h.in +++ b/src/sqlite.h.in @@ -133,7 +133,7 @@ extern "C" { ** ** Since [version 3.6.18] ([dateof:3.6.18]), ** SQLite source code has been stored in the -** Fossil configuration management +** Fossil configuration management ** system. ^The SQLITE_SOURCE_ID macro evaluates to ** a string which identifies a particular check-in of SQLite ** within its configuration management system. ^The SQLITE_SOURCE_ID diff --git a/src/sqlite3.rc b/src/sqlite3.rc index 5a856490d6..aad468d349 100644 --- a/src/sqlite3.rc +++ b/src/sqlite3.rc @@ -70,7 +70,7 @@ BEGIN VALUE "FileDescription", "SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine." VALUE "FileVersion", SQLITE_VERSION VALUE "InternalName", "sqlite3" - VALUE "LegalCopyright", "http://www.sqlite.org/copyright.html" + VALUE "LegalCopyright", "http://sqlite.org/copyright.html" VALUE "ProductName", "SQLite" VALUE "ProductVersion", SQLITE_VERSION VALUE "SourceId", SQLITE_SOURCE_ID diff --git a/src/vacuum.c b/src/vacuum.c index ae3af86b7a..96d77e5bc4 100644 --- a/src/vacuum.c +++ b/src/vacuum.c @@ -116,7 +116,7 @@ void sqlite3Vacuum(Parse *pParse, Token *pNm, Expr *pInto){ #else /* When SQLITE_BUG_COMPATIBLE_20160819 is defined, unrecognized arguments ** to VACUUM are silently ignored. This is a back-out of a bug fix that - ** occurred on 2016-08-19 (https://www.sqlite.org/src/info/083f9e6270). + ** occurred on 2016-08-19 (https://sqlite.org/src/info/083f9e6270). ** The buggy behavior is required for binary compatibility with some ** legacy applications. */ iDb = sqlite3FindDb(pParse->db, pNm); diff --git a/src/vdbemem.c b/src/vdbemem.c index 8534849432..6db9e4b1a7 100644 --- a/src/vdbemem.c +++ b/src/vdbemem.c @@ -141,7 +141,7 @@ static void vdbeMemRenderNum(int sz, char *zBuf, Mem *p){ ** corresponding string value, then it is important that the string be ** derived from the numeric value, not the other way around, to ensure ** that the index and table are consistent. See ticket -** https://www.sqlite.org/src/info/343634942dd54ab (2018-01-31) for +** https://sqlite.org/src/info/343634942dd54ab (2018-01-31) for ** an example. ** ** This routine looks at pMem to verify that if it has both a numeric diff --git a/src/wherecode.c b/src/wherecode.c index 5fe2308137..76f7ec60a2 100644 --- a/src/wherecode.c +++ b/src/wherecode.c @@ -2364,7 +2364,7 @@ Bitmask sqlite3WhereCodeOneLoopStart( ** ** This optimization also only applies if the (x1 OR x2 OR ...) term ** is not contained in the ON clause of a LEFT JOIN. - ** See ticket http://www.sqlite.org/src/info/f2369304e4 + ** See ticket http://sqlite.org/src/info/f2369304e4 ** ** 2022-02-04: Do not push down slices of a row-value comparison. ** In other words, "w" or "y" may not be a slice of a vector. Otherwise, diff --git a/test/affinity2.test b/test/affinity2.test index 6ad257ac36..59f9dada53 100644 --- a/test/affinity2.test +++ b/test/affinity2.test @@ -116,7 +116,7 @@ do_execsql_test 507 { SELECT * FROM t0 WHERE +-+'ce' >= t0.c0; } {-1 {}} -# 2019-08-30 ticket https://www.sqlite.org/src/info/40812aea1fde9594 +# 2019-08-30 ticket https://sqlite.org/src/info/40812aea1fde9594 # # Due to some differences in floating point computations, these tests do not # work under valgrind. diff --git a/test/affinity3.test b/test/affinity3.test index 3695ea8479..be415de46c 100644 --- a/test/affinity3.test +++ b/test/affinity3.test @@ -11,14 +11,14 @@ # # Test cases for bugs: # -# https://www.sqlite.org/src/info/91e2e8ba6ff2e2 -# https://www.sqlite.org/src/info/7ffd1ca1d2ad4ecf +# https://sqlite.org/src/info/91e2e8ba6ff2e2 +# https://sqlite.org/src/info/7ffd1ca1d2ad4ecf # set testdir [file dirname $argv0] source $testdir/tester.tcl -# Ticket https://www.sqlite.org/src/info/91e2e8ba6ff2e2 (2011-09-19) +# Ticket https://sqlite.org/src/info/91e2e8ba6ff2e2 (2011-09-19) # Automatic index causes undesired type conversions # do_execsql_test affinity3-100 { @@ -87,7 +87,7 @@ do_execsql_test affinity3-142 { SELECT id, (apr / 100), typeof(apr) apr_type FROM v2rjrj; } {1 0.12 real 2 0.1201 real} -# Ticket https://www.sqlite.org/src/info/7ffd1ca1d2ad4ecf (2017-01-16) +# Ticket https://sqlite.org/src/info/7ffd1ca1d2ad4ecf (2017-01-16) # Incorrect affinity when using automatic indexes # do_execsql_test affinity3-200 { diff --git a/test/alter4.test b/test/alter4.test index f6ada8f3fb..7e2d7e66a8 100644 --- a/test/alter4.test +++ b/test/alter4.test @@ -379,7 +379,7 @@ do_execsql_test alter4-9.3 { # Confirm that doing an ALTER TABLE on a legacy format database # does not corrupt DESC indexes. # -# Ticket https://www.sqlite.org/src/tktview/f68bf68513a1c +# Ticket https://sqlite.org/src/tktview/f68bf68513a1c # do_test alter4-10.1 { db close diff --git a/test/altercol.test b/test/altercol.test index f44aa2e065..5f7de57a4e 100644 --- a/test/altercol.test +++ b/test/altercol.test @@ -796,7 +796,7 @@ do_execsql_test 19.1 { {CREATE VIEW v2(e) AS SELECT coalesce(t2.c,t1.f) FROM t1, t2 WHERE t1.b=t2.d} } -# 2019-01-08: https://www.sqlite.org/src/tktview/bc8d94f0fbd633fd9a051e3 +# 2019-01-08: https://sqlite.org/src/tktview/bc8d94f0fbd633fd9a051e3 # # ALTER TABLE RENAME COLUMN does not work for tables that have redundant # UNIQUE constraints. diff --git a/test/altertab2.test b/test/altertab2.test index 576dc49670..56e42f1a69 100644 --- a/test/altertab2.test +++ b/test/altertab2.test @@ -351,7 +351,7 @@ do_execsql_test 8.5 { SELECT sql FROM sqlite_master WHERE name = 'v4' } {{CREATE VIEW v4 AS SELECT * FROM t4 WHERE (c=1 AND 0) OR b=2}} -# 2019-06-10 https://www.sqlite.org/src/info/533010b8cacebe82 +# 2019-06-10 https://sqlite.org/src/info/533010b8cacebe82 reset_db do_catchsql_test 8.6 { CREATE TABLE t0(c0); diff --git a/test/analyzeC.test b/test/analyzeC.test index 2f43d57a1e..f5bcaeb781 100644 --- a/test/analyzeC.test +++ b/test/analyzeC.test @@ -133,7 +133,7 @@ do_execsql_test 4.3 { } {/.*INDEX t1ca.*/} # 2019-08-15. -# Ticket https://www.sqlite.org/src/tktview/e4598ecbdd18bd82945f602901 +# Ticket https://sqlite.org/src/tktview/e4598ecbdd18bd82945f602901 # The sz=N parameter in the sqlite_stat1 table needs to have a value of # 2 or more to avoid a division by zero in the query planner. # diff --git a/test/autoinc.test b/test/autoinc.test index 2c7ee2a7e8..9f869f35ea 100644 --- a/test/autoinc.test +++ b/test/autoinc.test @@ -669,7 +669,7 @@ ifcapable trigger { } {1 124 2 10123} } -# 2016-10-03 ticket https://www.sqlite.org/src/tktview/7b3328086a5c1 +# 2016-10-03 ticket https://sqlite.org/src/tktview/7b3328086a5c1 # Make sure autoincrement plays nicely with the xfer optimization # do_execsql_test autoinc-10.1 { diff --git a/test/autoindex5.test b/test/autoindex5.test index aa8dec27d9..adfc3e5f76 100644 --- a/test/autoindex5.test +++ b/test/autoindex5.test @@ -142,7 +142,7 @@ do_catchsql_test 2.2 { ); } {0 9} -# Ticket https://www.sqlite.org/src/info/787fa716be3a7f65 +# Ticket https://sqlite.org/src/info/787fa716be3a7f65 # Segfault due to multiple uses of the same subquery where the # subquery is implemented via coroutine. # diff --git a/test/btree01.test b/test/btree01.test index 6e4717ae65..b1909a3adb 100644 --- a/test/btree01.test +++ b/test/btree01.test @@ -17,7 +17,7 @@ source $testdir/tester.tcl set testprefix btree01 # The refactoring on the b-tree balance() routine in check-in -# http://www.sqlite.org/src/info/face33bea1ba3a (2014-10-27) +# http://sqlite.org/src/info/face33bea1ba3a (2014-10-27) # caused the integrity_check on the following SQL to fail. # do_execsql_test btree01-1.1 { diff --git a/test/cast.test b/test/cast.test index 1c9071d775..c1b564328a 100644 --- a/test/cast.test +++ b/test/cast.test @@ -385,7 +385,7 @@ do_execsql_test cast-6.1 { } {9000000000000000001 9000000000000000001 9000000000000000001 9000000000000000001} # 2019-06-07 -# https://www.sqlite.org/src/info/4c2d7639f076aa7c +# https://sqlite.org/src/info/4c2d7639f076aa7c do_execsql_test cast-7.1 { SELECT CAST('-' AS NUMERIC); } {0} @@ -400,7 +400,7 @@ do_execsql_test cast-7.4 { } {0} # 2019-06-07 -# https://www.sqlite.org/src/info/e8bedb2a184001bb +# https://sqlite.org/src/info/e8bedb2a184001bb do_execsql_test cast-7.10 { SELECT '' - 2851427734582196970; } {-2851427734582196970} @@ -412,7 +412,7 @@ do_execsql_test cast-7.12 { } {-1} # 2019-06-10 -# https://www.sqlite.org/src/info/dd6bffbfb6e61db9 +# https://sqlite.org/src/info/dd6bffbfb6e61db9 # # EVIDENCE-OF: R-55084-10555 Casting a TEXT or BLOB value into NUMERIC # yields either an INTEGER or a REAL result. @@ -441,7 +441,7 @@ do_execsql_test cast-7.33 { } 0 # 2019-06-12 -# https://www.sqlite.org/src/info/674385aeba91c774 +# https://sqlite.org/src/info/674385aeba91c774 # do_execsql_test cast-7.40 { SELECT CAST('-0.0' AS numeric); diff --git a/test/colname.test b/test/colname.test index 24fb51acfc..0907df641e 100644 --- a/test/colname.test +++ b/test/colname.test @@ -378,7 +378,7 @@ do_test colname-9.210 { execsql2 {SELECT t1.a, v3.a AS n FROM t1 JOIN v3} } {a 1 n 3} -# 2017-12-23: Ticket https://www.sqlite.org/src/info/3b4450072511e621 +# 2017-12-23: Ticket https://sqlite.org/src/info/3b4450072511e621 # Inconsistent column names in CREATE TABLE AS # # Verify that the names of columns in the created table of a CREATE TABLE AS diff --git a/test/conflict.test b/test/conflict.test index ba3ad9b0dd..54c01d36de 100644 --- a/test/conflict.test +++ b/test/conflict.test @@ -824,7 +824,7 @@ do_test conflict-13.2 { } {1 3} -# Ticket https://www.sqlite.org/src/tktview/e6f1f2e34dceeb1ed61531c7e9 +# Ticket https://sqlite.org/src/tktview/e6f1f2e34dceeb1ed61531c7e9 # Verify that it is not possible to sneak a NULL value into a NOT NULL # column using REPLACE. # diff --git a/test/date.test b/test/date.test index 2042880a92..8badccf3fb 100644 --- a/test/date.test +++ b/test/date.test @@ -584,7 +584,7 @@ datetest 16.30 {datetime(5373484,'-14712 years')} {-4713-12-31 12:00:00} datetest 16.31 {datetime(5373484,'-14713 years')} NULL # 2017-03-02: Wrong 'start of day' computation. -# https://www.sqlite.org/src/info/6097cb92745327a1 +# https://sqlite.org/src/info/6097cb92745327a1 # datetest 17.1 {datetime(2457754, 'start of day')} {2016-12-31 00:00:00} datetest 17.2 {datetime(2457828)} {2017-03-15 12:00:00} diff --git a/test/delete4.test b/test/delete4.test index 8d6a1b8c7c..34151446b1 100644 --- a/test/delete4.test +++ b/test/delete4.test @@ -170,7 +170,7 @@ do_execsql_test 5.0 { } {} # 2016-05-02 -# Ticket https://www.sqlite.org/src/tktview/dc6ebeda93960877 +# Ticket https://sqlite.org/src/tktview/dc6ebeda93960877 # A subquery in the WHERE clause of a one-pass DELETE can cause an # incorrect answer. # diff --git a/test/expr.test b/test/expr.test index 55b1dc9502..71518df690 100644 --- a/test/expr.test +++ b/test/expr.test @@ -1002,7 +1002,7 @@ do_execsql_test expr-13.9 { SELECT '' <= ""; } {1} -# 2018-02-26. Ticket https://www.sqlite.org/src/tktview/36fae083b450e3af85 +# 2018-02-26. Ticket https://sqlite.org/src/tktview/36fae083b450e3af85 # do_execsql_test expr-14.1 { DROP TABLE IF EXISTS t1; diff --git a/test/func.test b/test/func.test index 85c9ada7eb..4e5f617e74 100644 --- a/test/func.test +++ b/test/func.test @@ -1241,7 +1241,7 @@ do_test func-24.12 { WHEN 'program' THEN null ELSE t1 END) FROM tbl1 } } {,is,free,software} -# Tests to verify ticket http://www.sqlite.org/src/tktview/55746f9e65f8587c0 +# Tests to verify ticket http://sqlite.org/src/tktview/55746f9e65f8587c0 do_test func-24.13 { execsql { SELECT typeof(group_concat(x)) FROM (SELECT '' AS x); diff --git a/test/func3.test b/test/func3.test index 0221a0dfd6..518bd51c79 100644 --- a/test/func3.test +++ b/test/func3.test @@ -154,7 +154,7 @@ do_test func3-5.39 { } [db eval {EXPLAIN SELECT min(1.0+'2.0',4*11)}] # Unlikely() does not preserve the affinity of X. -# ticket https://www.sqlite.org/src/tktview/0c620df60b +# ticket https://sqlite.org/src/tktview/0c620df60b # do_execsql_test func3-5.40 { SELECT likely(CAST(1 AS INT))=='1'; diff --git a/test/gencol1.test b/test/gencol1.test index ed7ea567d4..a247a7148d 100644 --- a/test/gencol1.test +++ b/test/gencol1.test @@ -211,9 +211,9 @@ do_catchsql_test gencol1-6.10 { REPLACE INTO t0(c1) VALUES(NULL); } {1 {NOT NULL constraint failed: t0.c0}} -# 2019-11-06 ticket https://www.sqlite.org/src/info/2399f5986134f79c -# 2019-12-27 ticket https://www.sqlite.org/src/info/5fbc159eeb092130 -# 2019-12-27 ticket https://www.sqlite.org/src/info/37823501c68a09f9 +# 2019-11-06 ticket https://sqlite.org/src/info/2399f5986134f79c +# 2019-12-27 ticket https://sqlite.org/src/info/5fbc159eeb092130 +# 2019-12-27 ticket https://sqlite.org/src/info/37823501c68a09f9 # # All of the above tickets deal with NOT NULL ON CONFLICT REPLACE # constraints on tables that have generated columns. diff --git a/test/in.test b/test/in.test index 601c7e3b4d..67fdd4f555 100644 --- a/test/in.test +++ b/test/in.test @@ -652,7 +652,7 @@ do_execsql_test in-14.1 { SELECT * FROM c1 WHERE a IN (SELECT a FROM c1) ORDER BY 1 } {1 2 3 4} -# 2019-02-20 Ticket https://www.sqlite.org/src/tktview/df46dfb631f75694fbb97033b69 +# 2019-02-20 Ticket https://sqlite.org/src/tktview/df46dfb631f75694fbb97033b69 # do_execsql_test in-15.0 { DROP TABLE IF EXISTS t1; @@ -736,7 +736,7 @@ do_execsql_test in-16.2 { } {} # 2019-06-11 -# https://www.sqlite.org/src/info/57353f8243c637c0 +# https://sqlite.org/src/info/57353f8243c637c0 # do_execsql_test in-17.1 { SELECT 1 IN ('1'); @@ -760,7 +760,7 @@ do_execsql_test in-18.1 { SELECT * FROM t0 WHERE '1' IN (t0.c0); } {} -# 2019-09-02 ticket https://www.sqlite.org/src/info/2841e99d104c6436 +# 2019-09-02 ticket https://sqlite.org/src/info/2841e99d104c6436 # For the IN_INDEX_NOOP optimization, apply REAL affinity to the LHS # values prior to comparison if the RHS has REAL affinity. # diff --git a/test/index.test b/test/index.test index 11d3d7191c..25ff41762d 100644 --- a/test/index.test +++ b/test/index.test @@ -738,7 +738,7 @@ do_test index-21.2 { } } {0 {9 5 1}} -# 2019-05-01 ticket https://www.sqlite.org/src/info/3be1295b264be2fa +# 2019-05-01 ticket https://sqlite.org/src/info/3be1295b264be2fa do_execsql_test index-22.0 { DROP TABLE IF EXISTS t1; CREATE TABLE t1(a, b TEXT); @@ -748,7 +748,7 @@ do_execsql_test index-22.0 { SELECT a, b, '|' FROM t1; } {a 1 | a 0 |} -# 2019-05-10 ticket https://www.sqlite.org/src/info/ae0f637bddc5290b +# 2019-05-10 ticket https://sqlite.org/src/info/ae0f637bddc5290b do_execsql_test index-23.0 { DROP TABLE t1; CREATE TABLE t1(a TEXT, b REAL); diff --git a/test/index6.test b/test/index6.test index 16370f521d..007823a283 100644 --- a/test/index6.test +++ b/test/index6.test @@ -391,7 +391,7 @@ do_execsql_test index6-11.2 { } {/USING INDEX t11x/} # 2018-12-08 -# Ticket https://www.sqlite.org/src/info/1d958d90596593a7 +# Ticket https://sqlite.org/src/info/1d958d90596593a7 # NOT IN operator fails when using a partial index. # do_execsql_test index6-12.1 { @@ -412,7 +412,7 @@ do_execsql_test index6-12.2 { } {1 2} # 2019-05-04 -# Ticket https://www.sqlite.org/src/tktview/5c6955204c392ae763a95 +# Ticket https://sqlite.org/src/tktview/5c6955204c392ae763a95 # Theorem prover error # do_execsql_test index6-13.1 { @@ -438,8 +438,8 @@ do_execsql_test index6-14.2 { } {{} row} # 2019-08-30 -# Ticket https://www.sqlite.org/src/info/a6408d42b9f44462 -# Ticket https://www.sqlite.org/src/info/fba33c8b1df6a915 +# Ticket https://sqlite.org/src/info/a6408d42b9f44462 +# Ticket https://sqlite.org/src/info/fba33c8b1df6a915 # https://sqlite.org/src/info/bac716244fddac1fe841 # do_execsql_test index6-15.1 { diff --git a/test/indexexpr1.test b/test/indexexpr1.test index d5c47e403e..ca6682cda7 100644 --- a/test/indexexpr1.test +++ b/test/indexexpr1.test @@ -330,7 +330,7 @@ do_execsql_test indexexpr1-1010 { # 2016-10-10 # Make sure indexes on expressions skip over initial NULL values in the # index as they are suppose to do. -# Ticket https://www.sqlite.org/src/tktview/4baa46491212947 +# Ticket https://sqlite.org/src/tktview/4baa46491212947 # do_execsql_test indexexpr1-1100 { DROP TABLE IF EXISTS t1; @@ -374,7 +374,7 @@ do_execsql_test indexexpr1-1200.4 { 0 0 0 2 0 4 2 0 2 2 4 0 } -# Ticket https://www.sqlite.org/src/tktview/eb703ba7b50c1a +# Ticket https://sqlite.org/src/tktview/eb703ba7b50c1a # Incorrect result using an index on an expression with a collating function # do_execsql_test indexexpr1-1300.1 { @@ -429,7 +429,7 @@ do_execsql_test indexexpr1-1510 { REPLACE INTO t1 SELECT a, randomblob(a) FROM t1 } {} -# 2018-01-31 https://www.sqlite.org/src/tktview/343634942dd54ab57b702411 +# 2018-01-31 https://sqlite.org/src/tktview/343634942dd54ab57b702411 # When an index on an expression depends on the string representation of # a numeric table column, trouble can arise since there are multiple # string that can map to the same numeric value. (Ex: 123, 0123, 000123). @@ -449,7 +449,7 @@ do_execsql_test indexexpr1-1620 { SELECT b FROM t1 WHERE lower(a)='01234' ORDER BY +b; } {} -# 2019-08-09 https://www.sqlite.org/src/info/9080b6227fabb466 +# 2019-08-09 https://sqlite.org/src/info/9080b6227fabb466 # ExprImpliesExpr theorem prover bug: # "(NULL IS FALSE) IS FALSE" does not imply "NULL IS NULL" # @@ -461,7 +461,7 @@ do_execsql_test indexexpr1-1700 { SELECT * FROM t0 WHERE ((NULL IS FALSE) IS FALSE); } {0} -# 2019-09-02 https://www.sqlite.org/src/tktview/57af00b6642ecd6848 +# 2019-09-02 https://sqlite.org/src/tktview/57af00b6642ecd6848 # When the expression of an an index-on-expression references a # table column of type REAL that is actually holding an MEM_IntReal # value, be sure to use the REAL value and not the INT value when diff --git a/test/insert.test b/test/insert.test index 51e62268db..fd08eb43b8 100644 --- a/test/insert.test +++ b/test/insert.test @@ -413,7 +413,7 @@ do_execsql_test insert-11.1 { # More columns of input than there are columns in the table. -# Ticket http://www.sqlite.org/src/info/e9654505cfda9361 +# Ticket http://sqlite.org/src/info/e9654505cfda9361 # do_execsql_test insert-12.1 { CREATE TABLE t12a(a,b,c,d,e,f,g); @@ -437,7 +437,7 @@ do_execsql_test insert-12.3 { # 2018-06-11. From OSSFuzz. A column cache malfunction in # the constraint checking on an index of expressions causes # an assertion fault in a REPLACE. Ticket -# https://www.sqlite.org/src/info/c2432ef9089ee73b +# https://sqlite.org/src/info/c2432ef9089ee73b # do_execsql_test insert-13.1 { DROP TABLE IF EXISTS t13; @@ -475,7 +475,7 @@ do_execsql_test insert-15.1 { } {4 33000} # 2019-10-16 -# ticket https://www.sqlite.org/src/info/a8a4847a2d96f5de +# ticket https://sqlite.org/src/info/a8a4847a2d96f5de # On a REPLACE INTO, if an AFTER trigger adds back the conflicting # row, you can end up with the wrong number of rows in an index. # diff --git a/test/instr.test b/test/instr.test index d23d66c25c..326f8eb9ee 100644 --- a/test/instr.test +++ b/test/instr.test @@ -257,7 +257,7 @@ do_execsql_test instr-1.64 { SELECT instr(a, b) FROM x1; } 0 -# 2019-09-16 ticket https://www.sqlite.org/src/info/587791f92620090e +# 2019-09-16 ticket https://sqlite.org/src/info/587791f92620090e # do_execsql_test instr-2.0 { DROP TABLE IF EXISTS t0; diff --git a/test/intpkey.test b/test/intpkey.test index d6b8833a27..a8d2fb2ffb 100644 --- a/test/intpkey.test +++ b/test/intpkey.test @@ -604,7 +604,7 @@ do_test intpkey-15.7 { } } {} -# 2016-04-18 ticket https://www.sqlite.org/src/tktview/7d7525cb01b68712495d3a +# 2016-04-18 ticket https://sqlite.org/src/tktview/7d7525cb01b68712495d3a # Be sure to escape quoted typenames. # do_execsql_test intpkey-16.0 { @@ -614,7 +614,7 @@ do_execsql_test intpkey-16.1 { PRAGMA table_info=t16a; } {0 id INTEGER 0 {} 1 1 b TEXT 0 {} 0 2 c INT 0 {} 0} -# 2016-05-06 ticket https://www.sqlite.org/src/tktview/16c9801ceba4923939085 +# 2016-05-06 ticket https://sqlite.org/src/tktview/16c9801ceba4923939085 # When the schema contains an index on the IPK and no other index # and a WHERE clause on a delete uses an OR where both sides referencing # the IPK, then it is possible that the OP_Delete will fail because there diff --git a/test/join.test b/test/join.test index aa526aeb29..b34136f5dd 100644 --- a/test/join.test +++ b/test/join.test @@ -799,7 +799,7 @@ do_execsql_test join-14.9 { } {111 {}} # Verify the fix to ticket -# https://www.sqlite.org/src/tktview/7fde638e94287d2c948cd9389 +# https://sqlite.org/src/tktview/7fde638e94287d2c948cd9389 # db close sqlite3 db :memory: @@ -819,7 +819,7 @@ do_execsql_test join-14.12 { } {4 {} {} | 2 2 1 |} # Verify the fix for ticket -# https://www.sqlite.org/src/info/892fc34f173e99d8 +# https://sqlite.org/src/info/892fc34f173e99d8 # db close sqlite3 db :memory: @@ -904,7 +904,7 @@ do_execsql_test join-15.110 { ORDER BY a1, a2, a3, a4, a5; } {1 {} {} {} {} 1 11 {} {} {} 1 12 {} {} {} 1 12 121 {} {} 1 13 {} {} {}} -# 2019-02-05 Ticket https://www.sqlite.org/src/tktview/5948e09b8c415bc45da5c +# 2019-02-05 Ticket https://sqlite.org/src/tktview/5948e09b8c415bc45da5c # Error in join due to the LEFT JOIN strength reduction optimization. # do_execsql_test join-16.100 { diff --git a/test/join5.test b/test/join5.test index 703c256f86..eb8ba3c7b5 100644 --- a/test/join5.test +++ b/test/join5.test @@ -106,7 +106,7 @@ do_test join5-2.12 { execsql {SELECT * FROM xy LEFT JOIN ab ON NULL WHERE NULL} } {} -# Ticket https://www.sqlite.org/src/tktview/6f2222d550f5b0ee7ed37601 +# Ticket https://sqlite.org/src/tktview/6f2222d550f5b0ee7ed37601 # Incorrect output on a LEFT JOIN. # do_execsql_test join5-3.1 { @@ -161,7 +161,7 @@ do_execsql_test join5-3.3 { SELECT * FROM x1 LEFT JOIN x2 JOIN x3 WHERE x3.d = x2.b; } {} -# Ticket https://www.sqlite.org/src/tktview/c2a19d81652f40568c770c43 on +# Ticket https://sqlite.org/src/tktview/c2a19d81652f40568c770c43 on # 2015-08-20. LEFT JOIN and the push-down optimization. # do_execsql_test join5-4.1 { diff --git a/test/json101.test b/test/json101.test index 3963ffbb6b..aec959acb2 100644 --- a/test/json101.test +++ b/test/json101.test @@ -444,7 +444,7 @@ foreach {tn isvalid ws} { $isvalid } -# Ticket https://www.sqlite.org/src/info/ad2559db380abf8e +# Ticket https://sqlite.org/src/info/ad2559db380abf8e # Control characters must be escaped in JSON strings. # do_execsql_test json101-8.1 { @@ -807,7 +807,7 @@ do_execsql_test json101-10.95 { } {0} #-------------------------------------------------------------------------- -# 2017-04-11. https://www.sqlite.org/src/info/981329adeef51011 +# 2017-04-11. https://sqlite.org/src/info/981329adeef51011 # Stack overflow on deeply nested JSON. # # The following tests confirm that deeply nested JSON is considered invalid. @@ -878,7 +878,7 @@ do_execsql_test json101-12.120b { } {0} # 2018-01-26 -# ticket https://www.sqlite.org/src/tktview/80177f0c226ff54f6ddd41 +# ticket https://sqlite.org/src/tktview/80177f0c226ff54f6ddd41 # Make sure the query planner knows about the arguments to table-valued functions. # do_execsql_test json101-13.100 { diff --git a/test/json103.test b/test/json103.test index e7483073b6..f94217ac10 100644 --- a/test/json103.test +++ b/test/json103.test @@ -55,7 +55,7 @@ do_execsql_test json103-220 { WHERE rowid<7 GROUP BY b ORDER BY b; } {0 {{"n3":3,"n6":6}} 1 {{"n1":1,"n4":4}} 2 {{"n2":2,"n5":5}}} -# ticket https://www.sqlite.org/src/info/f45ac567eaa9f93c 2016-01-30 +# ticket https://sqlite.org/src/info/f45ac567eaa9f93c 2016-01-30 # Invalid JSON generated by json_group_array() # # The underlying problem is a failure to reset Mem.eSubtype diff --git a/test/like.test b/test/like.test index 0d732b569c..1f9a810e5d 100644 --- a/test/like.test +++ b/test/like.test @@ -1013,7 +1013,7 @@ do_execsql_test like-12.16 { SELECT id FROM t12b WHERE x LIKE 'abc%' COLLATE binary ORDER BY +id; } {/SCAN/} -# Ticket [https://www.sqlite.org/src/tktview/80369eddd5c94d49f7fbbcf5] +# Ticket [https://sqlite.org/src/tktview/80369eddd5c94d49f7fbbcf5] # 2016-01-20 # do_execsql_test like-13.1 { diff --git a/test/like3.test b/test/like3.test index 01d19a54f6..03681606c3 100644 --- a/test/like3.test +++ b/test/like3.test @@ -112,7 +112,7 @@ do_execsql_test like3-4.2ck { SELECT quote(x) FROM t4 WHERE x LIKE 'ab%' ORDER BY +x ASC; } {'abc' 'abd' 'abe' X'616263' X'616264' X'616265'} -# 2018-09-10 ticket https://www.sqlite.org/src/tktview/c94369cae9b561b1f996 +# 2018-09-10 ticket https://sqlite.org/src/tktview/c94369cae9b561b1f996 # The like optimization fails for a column with numeric affinity if # the pattern '/%' or begins with the escape character. # @@ -199,7 +199,7 @@ do_execsql_test like3-5.400 { } {./} # 2019-06-14 -# Ticket https://www.sqlite.org/src/info/ce8717f0885af975 +# Ticket https://sqlite.org/src/info/ce8717f0885af975 do_execsql_test like3-5.410 { DROP TABLE IF EXISTS t0; CREATE TABLE t0(c0 INT UNIQUE COLLATE NOCASE); @@ -208,7 +208,7 @@ do_execsql_test like3-5.410 { } {.1%} # 2019-09-03 -# Ticket https://www.sqlite.org/src/info/0f0428096f +# Ticket https://sqlite.org/src/info/0f0428096f do_execsql_test like3-5.420 { DROP TABLE IF EXISTS t0; CREATE TABLE t0(c0 UNIQUE); diff --git a/test/limit2.test b/test/limit2.test index c03f39cd9c..2ecd8ab5f5 100644 --- a/test/limit2.test +++ b/test/limit2.test @@ -98,7 +98,7 @@ do_execsql_test limit2-210 { } {1 1 {} {} | 3 3 {} {} | 4 4 {} {} |} # Bug in the ORDER BY LIMIT optimization reported on 2016-09-06. -# Ticket https://www.sqlite.org/src/info/559733b09e96 +# Ticket https://sqlite.org/src/info/559733b09e96 # do_execsql_test limit2-300 { CREATE TABLE t300(a,b,c); @@ -150,11 +150,11 @@ do_execsql_test 502 { SELECT j FROM t502 WHERE i IN (1,2,3,4,5) ORDER BY j LIMIT 3; } {1 3 4} -# Ticket https://www.sqlite.org/src/info/123c9ba32130a6c9 2017-12-13 +# Ticket https://sqlite.org/src/info/123c9ba32130a6c9 2017-12-13 # Incorrect result when an idnex is used for an ordered join. # # This test case is in the limit2.test module because the problem was first -# exposed by check-in https://www.sqlite.org/src/info/559733b09e which +# exposed by check-in https://sqlite.org/src/info/559733b09e which # implemented the ORDER BY LIMIT optimization that limit2.test strives to # test. # @@ -167,7 +167,7 @@ do_execsql_test 600 { SELECT y FROM t1, t2 WHERE a=x AND b<=y ORDER BY b DESC; } {3} -# Ticket https://www.sqlite.org/src/info/9936b2fa443fec03 2018-09-08 +# Ticket https://sqlite.org/src/info/9936b2fa443fec03 2018-09-08 # Infinite loop due to the ORDER BY LIMIT optimization. # do_execsql_test 700 { diff --git a/test/minmax.test b/test/minmax.test index 81bd46dbe2..232ac14a05 100644 --- a/test/minmax.test +++ b/test/minmax.test @@ -633,7 +633,7 @@ do_test_13_noopt 13.7 { SELECT min(c), count(c) FROM t1 WHERE a='a'; } {1 5} -# 2016-07-26. https://www.sqlite.org/src/info/a0bac8b3c3d1bb75 +# 2016-07-26. https://sqlite.org/src/info/a0bac8b3c3d1bb75 # Incorrect result on a min() query after a CREATE INDEX. # do_execsql_test 14.1 { diff --git a/test/orderby1.test b/test/orderby1.test index 41444a44c3..73eda83992 100644 --- a/test/orderby1.test +++ b/test/orderby1.test @@ -536,7 +536,7 @@ do_test 8.3 { } 5000 #--------------------------------------------------------------------------- -# https://www.sqlite.org/src/tktview/cb3aa0641d9a413841c004293a4fc06cdc122029 +# https://sqlite.org/src/tktview/cb3aa0641d9a413841c004293a4fc06cdc122029 # # Adverse interaction between scalar subqueries and the partial-sorting # logic. diff --git a/test/orderby3.test b/test/orderby3.test index f005f0d2e8..09e9156d0f 100644 --- a/test/orderby3.test +++ b/test/orderby3.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. The # focus of this file is testing that the optimizations that disable # ORDER BY clauses work correctly on a 3-way join. See ticket -# http://www.sqlite.org/src/956e4d7f89 +# http://sqlite.org/src/956e4d7f89 # diff --git a/test/orderby4.test b/test/orderby4.test index ec6eb041f6..944a91f37d 100644 --- a/test/orderby4.test +++ b/test/orderby4.test @@ -12,7 +12,7 @@ # focus of this file is testing that the optimizations that disable # ORDER BY clauses work correctly on multi-value primary keys and # unique indices when only some prefix of the terms in the key are -# used. See ticket http://www.sqlite.org/src/info/a179fe74659 +# used. See ticket http://sqlite.org/src/info/a179fe74659 # diff --git a/test/rowvalue.test b/test/rowvalue.test index 59b44d9386..875fe1c608 100644 --- a/test/rowvalue.test +++ b/test/rowvalue.test @@ -255,7 +255,7 @@ do_catchsql_test 11.8 { SELECT * FROM t11 WHERE (a,a) IS NOT 1; } {1 {row value misused}} -# 2016-10-27: https://www.sqlite.org/src/tktview/fef4bb4bd9185ec8f +# 2016-10-27: https://sqlite.org/src/tktview/fef4bb4bd9185ec8f # Incorrect result from a LEFT JOIN with a row-value constraint # do_execsql_test 12.1 { @@ -349,7 +349,7 @@ do_catchsql_test 15.5 { #------------------------------------------------------------------------- # Row-values used in UPDATE statements within TRIGGERs # -# Ticket https://www.sqlite.org/src/info/8c9458e703666e1a +# Ticket https://sqlite.org/src/info/8c9458e703666e1a # do_execsql_test 16.1 { CREATE TABLE t16a(a,b,c); @@ -449,7 +449,7 @@ do_execsql_test 18.6 { } {1 1 1 1 2 1} -# 2018-02-13 Ticket https://www.sqlite.org/src/tktview/f484b65f3d6230593c3 +# 2018-02-13 Ticket https://sqlite.org/src/tktview/f484b65f3d6230593c3 # Incorrect result from a row-value comparison in the WHERE clause. # do_execsql_test 19.1 { @@ -558,7 +558,7 @@ do_catchsql_test 20.1 { SELECT 1 WHERE (2,(2,0)) IS (2,(2,0)); } {0 1} -# 2018-11-03: Ticket https://www.sqlite.org/src/info/1a84668dcfdebaf1 +# 2018-11-03: Ticket https://sqlite.org/src/info/1a84668dcfdebaf1 # Assertion fault when doing row-value operations on a primary key # containing duplicate columns. # diff --git a/test/rowvalue3.test b/test/rowvalue3.test index 80ebeb7617..7d07976948 100644 --- a/test/rowvalue3.test +++ b/test/rowvalue3.test @@ -203,7 +203,7 @@ foreach {tn idx} { #------------------------------------------------------------------------- # 2016-11-17. Query flattening in a vector SELECT on the RHS of an IN -# operator. Ticket https://www.sqlite.org/src/info/da7841375186386c +# operator. Ticket https://sqlite.org/src/info/da7841375186386c # do_execsql_test 5.0 { DROP TABLE IF EXISTS t1; diff --git a/test/rowvalue7.test b/test/rowvalue7.test index 03591afaf4..2823667e73 100644 --- a/test/rowvalue7.test +++ b/test/rowvalue7.test @@ -56,7 +56,7 @@ do_catchsql_test 2.2 { } {1 {3 columns assigned 2 values}} # 2019-08-26 -# ticket https://www.sqlite.org/src/info/78acc9d40f0786e8 +# ticket https://sqlite.org/src/info/78acc9d40f0786e8 # do_catchsql_test 3.0 { DROP TABLE IF EXISTS t1; diff --git a/test/savepoint7.test b/test/savepoint7.test index 59c3cd6cdc..2652cc3972 100644 --- a/test/savepoint7.test +++ b/test/savepoint7.test @@ -95,7 +95,7 @@ do_test savepoint7-2.2 { list $rc $msg [db eval {SELECT * FROM t2}] } {1 {abort due to ROLLBACK} {}} -# Ticket: https://www.sqlite.org/src/tktview/7f7f8026eda387d544b +# Ticket: https://sqlite.org/src/tktview/7f7f8026eda387d544b # Segfault in the in-memory journal logic triggered by a tricky # combination of SAVEPOINT operations. # diff --git a/test/select3.test b/test/select3.test index 4bbd70cc75..ab16ab9fd8 100644 --- a/test/select3.test +++ b/test/select3.test @@ -268,7 +268,7 @@ do_test select3-8.2 { } } {real} -# 2019-05-09 ticket https://www.sqlite.org/src/tktview/6c1d3febc00b22d457c7 +# 2019-05-09 ticket https://sqlite.org/src/tktview/6c1d3febc00b22d457c7 # unset -nocomplain x foreach {id x} { diff --git a/test/select4.test b/test/select4.test index d49708ece8..890897f2a9 100644 --- a/test/select4.test +++ b/test/select4.test @@ -915,7 +915,7 @@ do_execsql_test select4-14.17 { VALUES(1),(2),(3),(4) UNION ALL SELECT 5 LIMIT 3; } {1 2 3} -# Ticket https://www.sqlite.org/src/info/d06a25c84454a372 +# Ticket https://sqlite.org/src/info/d06a25c84454a372 # Incorrect answer due to two co-routines using the same registers and expecting # those register values to be preserved across a Yield. # @@ -968,7 +968,7 @@ do_execsql_test select4-16.3 { ORDER BY t3.a; } {95 96 97 98 99} -# Ticket https://www.sqlite.org/src/tktview/f7f8c97e975978d45 on 2016-04-25 +# Ticket https://sqlite.org/src/tktview/f7f8c97e975978d45 on 2016-04-25 # # The where push-down optimization from 2015-06-02 is suppose to disable # on aggregate subqueries. But if the subquery is a compound where the diff --git a/test/select6.test b/test/select6.test index f748ab47a4..301ec11c36 100644 --- a/test/select6.test +++ b/test/select6.test @@ -611,7 +611,7 @@ do_execsql_test 11.100 { FROM ( SELECT count(*) AS cnt FROM t1 ); } {{}} -# 2019-05-29 ticket https://www.sqlite.org/src/info/c41afac34f15781f +# 2019-05-29 ticket https://sqlite.org/src/info/c41afac34f15781f # A LIMIT clause in a subquery is incorrectly applied to a subquery. # do_execsql_test 12.100 { diff --git a/test/subquery2.test b/test/subquery2.test index 0c1bdc6697..8513dc75c8 100644 --- a/test/subquery2.test +++ b/test/subquery2.test @@ -104,7 +104,7 @@ do_execsql_test 2.2 { } {2 3 3 6 4 10} ############################################################################ -# Ticket http://www.sqlite.org/src/info/d11a6e908f (2014-09-20) +# Ticket http://sqlite.org/src/info/d11a6e908f (2014-09-20) # Query planner fault on three-way nested join with compound inner SELECT # do_execsql_test 3.0 { diff --git a/test/tabfunc01.test b/test/tabfunc01.test index 5938ec6cb6..0e29c35683 100644 --- a/test/tabfunc01.test +++ b/test/tabfunc01.test @@ -339,7 +339,7 @@ do_test tabfunc01-750 { } } {5.0 x5 | 7.0 x7 | 13.0 x13 | 17.0 x17 | 23.0 x23 |} -# ticket https://www.sqlite.org/src/info/2ae0c599b735d59e +# ticket https://sqlite.org/src/info/2ae0c599b735d59e # Verification of testtag-20230227a do_test tabfunc01-751 { db eval { diff --git a/test/table.test b/test/table.test index b961207f8b..46ecd7d23b 100644 --- a/test/table.test +++ b/test/table.test @@ -792,7 +792,7 @@ do_catchsql_test table-16.7 { INSERT INTO t16 DEFAULT VALUES; } {1 {unknown function: string_agg()}} -# Ticket [https://www.sqlite.org/src/info/094d39a4c95ee4abbc417f04214617675ba15c63] +# Ticket [https://sqlite.org/src/info/094d39a4c95ee4abbc417f04214617675ba15c63] # describes a assertion fault that occurs on a CREATE TABLE .. AS SELECT statement. # the following test verifies that the problem has been fixed. # @@ -810,7 +810,7 @@ do_execsql_test table-17.1 { } {1 1 | 2 2 |} # 2015-06-16 -# Ticket [https://www.sqlite.org/src/tktview/873cae2b6e25b1991ce5e9b782f9cd0409b96063] +# Ticket [https://sqlite.org/src/tktview/873cae2b6e25b1991ce5e9b782f9cd0409b96063] # Make sure a CREATE TABLE AS statement correctly rolls back partial changes to the # sqlite_master table when the SELECT on the right-hand side aborts. # @@ -825,7 +825,7 @@ do_execsql_test table-18.2 { } {ok} # 2015-09-09 -# Ticket [https://www.sqlite.org/src/info/acd12990885d9276] +# Ticket [https://sqlite.org/src/info/acd12990885d9276] # "CREATE TABLE ... AS SELECT ... FROM sqlite_master" fails because the row # in the sqlite_master table for the next table is initially populated # with a NULL instead of a record created by OP_Record. diff --git a/test/trigger1.test b/test/trigger1.test index afeb7ddccb..67943677f9 100644 --- a/test/trigger1.test +++ b/test/trigger1.test @@ -751,7 +751,7 @@ do_execsql_test trigger1-18.1 { SELECT * FROM t18; } {1 3 2} ;# Not: 1 1001 1000 -# 2018-04-26 ticket [https://www.sqlite.org/src/tktview/d85fffd6ffe856092e] +# 2018-04-26 ticket [https://sqlite.org/src/tktview/d85fffd6ffe856092e] # VDBE Program uses an expired value. # do_execsql_test trigger1-19.0 { diff --git a/test/triggerG.test b/test/triggerG.test index 8cf20b5ec9..b078fffb2e 100644 --- a/test/triggerG.test +++ b/test/triggerG.test @@ -19,7 +19,7 @@ ifcapable {!trigger} { } # Test cases for ticket -# https://www.sqlite.org/src/tktview/06796225f59c057cd120f +# https://sqlite.org/src/tktview/06796225f59c057cd120f # # The OP_Once opcode was not working correctly for recursive triggers. # diff --git a/test/update.test b/test/update.test index bf7666662a..0a380fa030 100644 --- a/test/update.test +++ b/test/update.test @@ -616,7 +616,7 @@ do_test update-14.4 { } ;# ifcapable {trigger} -# Ticket [https://www.sqlite.org/src/tktview/43107840f1c02] on 2014-10-29 +# Ticket [https://sqlite.org/src/tktview/43107840f1c02] on 2014-10-29 # An assertion fault on UPDATE # ifcapable altertable { @@ -703,7 +703,7 @@ do_execsql_test update-19.10 { SELECT * FROM t1; } {2 2} -# 2019-12-29 ticket https://www.sqlite.org/src/info/314cc133e5ada126 +# 2019-12-29 ticket https://sqlite.org/src/info/314cc133e5ada126 # REPLACE conflict resolution during an UPDATE causes a DELETE trigger # to fire. If that DELETE trigger subsequently modifies the row # being updated, bad things can happen. Prevent this by prohibiting @@ -711,8 +711,8 @@ do_execsql_test update-19.10 { # REPLACE conflict resolution on the UPDATE. # # See also tickets: -# https://www.sqlite.org/src/info/c1e19e12046d23fe 2019-10-25 -# https://www.sqlite.org/src/info/a8a4847a2d96f5de 2019-10-16 +# https://sqlite.org/src/info/c1e19e12046d23fe 2019-10-25 +# https://sqlite.org/src/info/a8a4847a2d96f5de 2019-10-16 # reset_db do_execsql_test update-20.10 { diff --git a/test/upsert1.test b/test/upsert1.test index 8af273a89a..49168f840b 100644 --- a/test/upsert1.test +++ b/test/upsert1.test @@ -129,7 +129,7 @@ do_execsql_test upsert1-610 { } {ok} # 2018-08-14 -# Ticket https://www.sqlite.org/src/info/908f001483982c43 +# Ticket https://sqlite.org/src/info/908f001483982c43 # If there are multiple uniqueness contraints, the UPSERT should fire # if the one constraint it targets fails, regardless of whether or not # the other constraints pass or fail. In other words, the UPSERT constraint diff --git a/test/where.test b/test/where.test index 0a8cfd572b..c377006fb9 100644 --- a/test/where.test +++ b/test/where.test @@ -1388,7 +1388,7 @@ do_execsql_test where-19.0 { SELECT t191.rowid FROM t192, t191 WHERE (a=y OR b=y) AND x=?1; } {/.* sqlite_autoindex_t191_1 .* sqlite_autoindex_t191_2 .*/} -# 2018-04-24 ticket [https://www.sqlite.org/src/info/4ba5abf65c5b0f9a] +# 2018-04-24 ticket [https://sqlite.org/src/info/4ba5abf65c5b0f9a] # Index on expressions leads to an incorrect answer for a LEFT JOIN # do_execsql_test where-20.0 { @@ -1422,7 +1422,7 @@ do_execsql_test where-21.1 { 4 0 1 } -# 2018-11-05: ticket [https://www.sqlite.org/src/tktview/65eb38f6e46de8c75e188a] +# 2018-11-05: ticket [https://sqlite.org/src/tktview/65eb38f6e46de8c75e188a] # Incorrect result in LEFT JOIN when STAT4 is enabled. # sqlite3 db :memory: @@ -1435,7 +1435,7 @@ do_execsql_test where-22.1 { } {5} # 20190-02-22: A bug introduced by checkin -# https://www.sqlite.org/src/info/fa792714ae62fa98. +# https://sqlite.org/src/info/fa792714ae62fa98. # do_execsql_test where-23.0 { DROP TABLE IF EXISTS t1; @@ -1547,7 +1547,7 @@ do_catchsql_test where-25.5 { ON CONFLICT(c) DO UPDATE SET b=NULL } {1 {corrupt database}} -# 2019-08-21 Ticket https://www.sqlite.org/src/info/d9f584e936c7a8d0 +# 2019-08-21 Ticket https://sqlite.org/src/info/d9f584e936c7a8d0 # db close sqlite3 db :memory: diff --git a/test/where2.test b/test/where2.test index 7a7e9b92ed..a38f6e54ba 100644 --- a/test/where2.test +++ b/test/where2.test @@ -767,7 +767,7 @@ do_execsql_test where2-13.1 { SELECT * FROM t13 WHERE (1=2 AND a=3) OR a=4; } {4 5} -# https://www.sqlite.org/src/info/5e3c886796e5512e (2016-03-09) +# https://sqlite.org/src/info/5e3c886796e5512e (2016-03-09) # Correlated subquery on the RHS of an IN operator # do_execsql_test where2-14.1 { diff --git a/test/whereG.test b/test/whereG.test index c154058233..6ee8634817 100644 --- a/test/whereG.test +++ b/test/whereG.test @@ -237,7 +237,7 @@ do_eqp_test 5.3.3 { } {SCAN t1} # 2015-06-18 -# Ticket [https://www.sqlite.org/see/tktview/472f0742a1868fb58862bc588ed70] +# Ticket [https://sqlite.org/see/tktview/472f0742a1868fb58862bc588ed70] # do_execsql_test 6.0 { DROP TABLE IF EXISTS t1; @@ -273,7 +273,7 @@ do_execsql_test 7.3 { } {1 3 1 4 9 3 9 4} # 2019-08-22 -# Ticket https://www.sqlite.org/src/info/7e07a3dbf5a8cd26 +# Ticket https://sqlite.org/src/info/7e07a3dbf5a8cd26 # do_execsql_test 8.1 { DROP TABLE IF EXISTS t0; diff --git a/test/window1.test b/test/window1.test index 457852c145..7457555680 100644 --- a/test/window1.test +++ b/test/window1.test @@ -630,7 +630,7 @@ do_execsql_test 13.5 { } {} # 2018-12-06 -# https://www.sqlite.org/src/info/f09fcd17810f65f7 +# https://sqlite.org/src/info/f09fcd17810f65f7 # Assertion fault when window functions are used. # # Root cause is the query flattener invoking sqlite3ExprDup() on @@ -657,7 +657,7 @@ do_execsql_test 14.1 { } {1 2 3} # 2018-12-31 -# https://www.sqlite.org/src/info/d0866b26f83e9c55 +# https://sqlite.org/src/info/d0866b26f83e9c55 # Window function in correlated subquery causes assertion fault # do_catchsql_test 15.0 { @@ -1205,7 +1205,7 @@ do_execsql_test 29.2 { # 2019-07-18 # Check-in [7ef7b23cbb1b9ace] (which was itself a fix for ticket -# https://www.sqlite.org/src/info/1be72aab9) introduced a new problem +# https://sqlite.org/src/info/1be72aab9) introduced a new problem # if the LHS of a BETWEEN operator is a WINDOW function. The problem # was found by (the recently enhanced) dbsqlfuzz. # diff --git a/test/with1.test b/test/with1.test index 7400a7adf3..5ddf9dce0b 100644 --- a/test/with1.test +++ b/test/with1.test @@ -1092,7 +1092,7 @@ do_catchsql_test 22.1 { } {1 {too many FROM clause terms, max: 200}} # 2019-05-22 -# ticket https://www.sqlite.org/src/tktview/ce823231949d3abf42453c8f20 +# ticket https://sqlite.org/src/tktview/ce823231949d3abf42453c8f20 # sqlite3 db :memory: do_execsql_test 23.1 { diff --git a/test/without_rowid1.test b/test/without_rowid1.test index 5d0bc81105..5134e5e809 100644 --- a/test/without_rowid1.test +++ b/test/without_rowid1.test @@ -415,7 +415,7 @@ do_execsql_test 10.6 { SELECT * FROM t1; } {b a 3 b b 4} -# 2019-04-29 ticket https://www.sqlite.org/src/info/3182d3879020ef3 +# 2019-04-29 ticket https://sqlite.org/src/info/3182d3879020ef3 do_execsql_test 11.1 { CREATE TABLE t11(a TEXT PRIMARY KEY, b INT) WITHOUT ROWID; CREATE INDEX t11a ON t11(a COLLATE NOCASE); @@ -424,7 +424,7 @@ do_execsql_test 11.1 { SELECT a FROM t11 ORDER BY a COLLATE binary; } {ok A a} -# 2019-05-13 ticket https://www.sqlite.org/src/info/bba7b69f9849b5b +# 2019-05-13 ticket https://sqlite.org/src/info/bba7b69f9849b5b do_execsql_test 12.1 { DROP TABLE IF EXISTS t0; CREATE TABLE t0 (c0 INTEGER PRIMARY KEY DESC, c1 UNIQUE DEFAULT NULL) WITHOUT ROWID; @@ -433,7 +433,7 @@ do_execsql_test 12.1 { PRAGMA integrity_check; } {ok} -# 2019-11-07 ticket https://www.sqlite.org/src/info/302027baf1374498 +# 2019-11-07 ticket https://sqlite.org/src/info/302027baf1374498 # The xferCompatibleIndex() function confuses a PRIMARY KEY index # with a UNIQUE index. # diff --git a/tool/srcck1.c b/tool/srcck1.c index 20084ac47f..5a1158beb9 100644 --- a/tool/srcck1.c +++ b/tool/srcck1.c @@ -13,7 +13,7 @@ ** The aim of this utility is to prevent recurrences of errors such ** as the one fixed at: ** -** https://www.sqlite.org/src/info/a2952231ac7abe16 +** https://sqlite.org/src/info/a2952231ac7abe16 ** ** Note that another similar error was found by this utility when it was ** first written. That other error was fixed by the same check-in that From 2d1c71abeb2c862f152379599fcc6074e3ebc23a Mon Sep 17 00:00:00 2001 From: dan Date: Thu, 10 Apr 2025 14:53:32 +0000 Subject: [PATCH 080/120] Fix an obscure problem allowing the propagate-constants optimization to improperly substitute a column of a sub-query with NONE affinity. FossilOrigin-Name: d82725dcaec7437f37fc15dfb492b51a4f9dbbbcaea04e387d9471b7d291cde2 --- manifest | 19 +++++++++++-------- manifest.uuid | 2 +- src/select.c | 6 ++++-- test/whereL.test | 40 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 56 insertions(+), 11 deletions(-) diff --git a/manifest b/manifest index bbaafc817e..9c1feab556 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Remove\sunnecessary\s"www."\sprefixes\son\sdomain\snames\sin\sURLs. -D 2025-04-10T10:18:07.458 +C Fix\san\sobscure\sproblem\sallowing\sthe\spropagate-constants\soptimization\sto\simproperly\ssubstitute\sa\scolumn\sof\sa\ssub-query\swith\sNONE\saffinity. +D 2025-04-10T14:53:32.965 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -785,7 +785,7 @@ F src/printf.c 33fc0d7643c848a098afdcb6e1db6de12379d47084b1cd0912cfce1d09345e44 F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c F src/resolve.c 20e1fbe8f840ffc0cd835e33f68a802a22e34faa918d7a269f3de242fda02f99 F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97 -F src/select.c effa93763d32664a665d18951fd0ec04de8fb1bcb120dd5a6802a6dc4857f54d +F src/select.c 716a49f7f6348771442b8dae47863bad8ddbd8d5ae9a0d82d0eeb1852aea1cf7 F src/shell.c.in 1e8b9bf369e80cdf9b029142e773038bc12bd38aea1c56df4af6bf7b46cae955 F src/sqlite.h.in 22882ddd3a70751aa8864c81993ee4562ed54c2c508b6270f75e223ffee38e1b F src/sqlite3.rc 015537e6ac1eec6c7050e17b616c2ffe6f70fca241835a84a4f0d5937383c479 @@ -2060,7 +2060,7 @@ F test/whereH.test e4b07f7a3c2f5d31195cd33710054c78667573b2 F test/whereI.test c4bb7e2ca56d49bd8ab5c7bd085b8b83e353922b46904d68aefb3c7468643581 F test/whereJ.test fc05e374cc9f2dc204148d6c06822c380ad388895fe97a6d335b94a26a08aecf F test/whereK.test 0270ab7f04ba5436fb9156d31d642a1c82727f4c4bfe5ba90d435c78cf44684a -F test/whereL.test 438a397fa883b77bb6361c08a8befa41b52e9cfbe15a2a43715d122f8cfa8649 +F test/whereL.test cb115604cc9bd61acbc99a1f1df0eb1ea7a7875a77fef25ba9282f01d10283e1 F test/whereM.test 0dbc9998783458ddcf3cc078ca7c2951d8b2677d472ecf0028f449ed327c0250 F test/whereN.test 63a3584b71acfb6963416de82f26c6b1644abc5ca6080c76546b9246734c8803 F test/wherefault.test 6cf2a9c5712952d463d3f45ebee7f6caf400984df51a195d884cfb7eb0e837a7 @@ -2216,8 +2216,11 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 394bef54411c81fd8ca3aafc13ec2a774e9ff56c7282d90b8425cc8f383aa74c -R 5b336d04628266a31565711fa551eff8 -U drh -Z d59719f0b5a7503b3051272d2a11d03f +P 20acd630b91609725794ce84f9eda01d5f3c898407f0948264830851d25ccaa6 +R 47ed749e6cbdb9364e8a1ddc5a4d9530 +T *branch * forum-0109bca824 +T *sym-forum-0109bca824 * +T -sym-trunk * +U dan +Z c2d2e2caf31431a29ac413ff9e101826 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index f2dfd21c3e..3921cf808e 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -20acd630b91609725794ce84f9eda01d5f3c898407f0948264830851d25ccaa6 +d82725dcaec7437f37fc15dfb492b51a4f9dbbbcaea04e387d9471b7d291cde2 diff --git a/src/select.c b/src/select.c index 315471ef1b..91690c3273 100644 --- a/src/select.c +++ b/src/select.c @@ -4858,7 +4858,8 @@ static void constInsert( return; /* Already present. Return without doing anything. */ } } - if( sqlite3ExprAffinity(pColumn)==SQLITE_AFF_BLOB ){ + assert( SQLITE_AFF_NONEbHasAffBlob = 1; } @@ -4933,7 +4934,8 @@ static int propagateConstantExprRewriteOne( if( pColumn==pExpr ) continue; if( pColumn->iTable!=pExpr->iTable ) continue; if( pColumn->iColumn!=pExpr->iColumn ) continue; - if( bIgnoreAffBlob && sqlite3ExprAffinity(pColumn)==SQLITE_AFF_BLOB ){ + assert( SQLITE_AFF_NONE Date: Thu, 10 Apr 2025 16:48:04 +0000 Subject: [PATCH 081/120] Improve the error messages returned by sqlite3session_diff(). FossilOrigin-Name: a3217cdb75fd305705856f6504f8816c2b6b0a10907725cb74d025a5c4e369b8 --- ext/session/sessionD.test | 42 ++++++++++++++++++++++++++++++++++-- ext/session/sqlite3session.c | 40 ++++++++++++++++++++++++++++------ ext/session/sqlite3session.h | 5 +++-- manifest | 17 +++++++-------- manifest.uuid | 2 +- 5 files changed, 85 insertions(+), 21 deletions(-) diff --git a/ext/session/sessionD.test b/ext/session/sessionD.test index f60fbabc2a..74bb101e31 100644 --- a/ext/session/sessionD.test +++ b/ext/session/sessionD.test @@ -202,7 +202,7 @@ do_test 4.3.1 { S attach t4 execsql { CREATE TABLE t4(i PRIMARY KEY, b) } list [catch { S diff ixua t4 } msg] $msg -} {1 {SQLITE_SCHEMA - table schemas do not match}} +} {1 {SQLITE_SCHEMA - no such table: ixua.t4}} S delete do_catchsql_test 4.3.2 { SELECT * FROM ixua.t4; @@ -214,7 +214,7 @@ do_test 4.4.1 { execsql { ANALYZE } execsql { DROP TABLE ixua.sqlite_stat1 } list [catch { S diff ixua sqlite_stat1 } msg] $msg -} {1 {SQLITE_SCHEMA - table schemas do not match}} +} {1 {SQLITE_SCHEMA - no such table: ixua.sqlite_stat1}} S delete do_catchsql_test 4.4.2 { SELECT * FROM ixua.sqlite_stat1; @@ -258,4 +258,42 @@ do_changeset_test 4.2 S { S delete +#------------------------------------------------------------------------- +# Test that sqlite3session_diff() really does return errors if +# +reset_db +forcedelete test.db2 +do_execsql_test 5.0 { + ATTACH 'test.db2' AS two; + CREATE TABLE main.t1(a INTEGER PRIMARY KEY, b); + CREATE TABLE main.t2(a INTEGER PRIMARY KEY, b); + CREATE TABLE two.t1(a, b INTEGER PRIMARY KEY); +} + +proc do_sessions_diff_error {tn db tbl err} { + sqlite3session S db main + set rc [catch {S diff $db $tbl} msg] + + set ::sdgot [list $rc $msg] + do_test $tn [list set sdgot] [list {*}$err] + + S delete +} + +# Test that it is an error if the named db is missing. +breakpoint +do_sessions_diff_error 5.1 nosuchdb t1 { + 1 {SQLITE_SCHEMA - no such table: nosuchdb.t1} +} + +# Test that it is an error if the named db is present, but named table is not. +do_sessions_diff_error 5.2 two t2 { + 1 {SQLITE_SCHEMA - no such table: two.t2} +} + +# Test that it is an error if the tables are present, but schemas do not match. +do_sessions_diff_error 5.3 two t1 { + 1 {SQLITE_SCHEMA - table schemas do not match} +} + finish_test diff --git a/ext/session/sqlite3session.c b/ext/session/sqlite3session.c index 6c386f42e2..d049f69862 100644 --- a/ext/session/sqlite3session.c +++ b/ext/session/sqlite3session.c @@ -2229,17 +2229,43 @@ int sqlite3session_diff( if( rc==SQLITE_OK ){ int bHasPk = 0; int bMismatch = 0; - int nCol; /* Columns in zFrom.zTbl */ + int nCol = 0; /* Columns in zFrom.zTbl */ int bRowid = 0; - u8 *abPK; + u8 *abPK = 0; const char **azCol = 0; - rc = sessionTableInfo(0, db, zFrom, zTbl, - &nCol, 0, 0, &azCol, 0, 0, &abPK, - pSession->bImplicitPK ? &bRowid : 0 - ); + char *zDbExists = 0; + + /* Check that database zFrom is attached. */ + zDbExists = sqlite3_mprintf("SELECT * FROM %Q.sqlite_schema", zFrom); + if( zDbExists==0 ){ + rc = SQLITE_NOMEM; + }else{ + sqlite3_stmt *pDbExists = 0; + rc = sqlite3_prepare_v2(db, zDbExists, -1, &pDbExists, 0); + if( rc==SQLITE_ERROR ){ + rc = SQLITE_OK; + nCol = -1; + } + sqlite3_finalize(pDbExists); + sqlite3_free(zDbExists); + } + + if( rc==SQLITE_OK && nCol==0 ){ + rc = sessionTableInfo(0, db, zFrom, zTbl, + &nCol, 0, 0, &azCol, 0, 0, &abPK, + pSession->bImplicitPK ? &bRowid : 0 + ); + } if( rc==SQLITE_OK ){ if( pTo->nCol!=nCol ){ - bMismatch = 1; + if( nCol<=0 ){ + rc = SQLITE_SCHEMA; + if( pzErrMsg ){ + *pzErrMsg = sqlite3_mprintf("no such table: %s.%s", zFrom, zTbl); + } + }else{ + bMismatch = 1; + } }else{ int i; for(i=0; i Date: Thu, 10 Apr 2025 17:25:57 +0000 Subject: [PATCH 082/120] Fix a comment in sessionD.test. FossilOrigin-Name: 3516354ee57b683c134de206f5321f064f9cb627aa12ba6fde98e59a9093c50c --- ext/session/sessionD.test | 3 ++- manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/ext/session/sessionD.test b/ext/session/sessionD.test index 74bb101e31..17cb13d4ea 100644 --- a/ext/session/sessionD.test +++ b/ext/session/sessionD.test @@ -259,7 +259,8 @@ do_changeset_test 4.2 S { S delete #------------------------------------------------------------------------- -# Test that sqlite3session_diff() really does return errors if +# Test that sqlite3session_diff() really does return errors if the named +# table or database do not exist. # reset_db forcedelete test.db2 diff --git a/manifest b/manifest index 7be17f10ec..959e6e479e 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Improve\sthe\serror\smessages\sreturned\sby\ssqlite3session_diff(). -D 2025-04-10T16:48:04.265 +C Fix\sa\scomment\sin\ssessionD.test. +D 2025-04-10T17:25:57.906 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -589,7 +589,7 @@ F ext/session/session9.test 4e3aff62d6b4294498ddbe309076de06f4fddffad4fe5f5a6c03 F ext/session/sessionA.test 1feeab0b8e03527f08f2f1defb442da25480138f F ext/session/sessionB.test c4fb7f8a688787111606e123a555f18ee04f65bb9f2a4bb2aa71d55ce4e6d02c F ext/session/sessionC.test f8a5508bc059ae646e5ec9bdbca66ad24bc92fe99fda5790ac57e1f59fce2fdf -F ext/session/sessionD.test 06fa4c7548f0bb88df1be26c0da3a69caac7f49d1a282e7971aeeb4fa94cf803 +F ext/session/sessionD.test 9e38ee4efd80722b7e9b73fa0019775ff1d9ccb98f22d878f44ad389582bbdc4 F ext/session/sessionE.test b2010949c9d7415306f64e3c2072ddabc4b8250c98478d3c0c4d064bce83111d F ext/session/sessionF.test d37ed800881e742c208df443537bf29aa49fd56eac520d0f0c6df3e6320f3401 F ext/session/sessionG.test 3efe388282d641b65485b5462e67851002cd91a282dc95b685d085eb8efdad0a @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 979f384a93d25e24f760469681618101feaab873738e1b52a7d4b818f7c527d9 -R 4b5c476eaf3c97d6673579173944e73c +P a3217cdb75fd305705856f6504f8816c2b6b0a10907725cb74d025a5c4e369b8 +R e9c3c58b6aa871893824790c20bbd8a9 U dan -Z 8c83c1cee68bcdb1cf7731347bbc44c3 +Z 63c562955bebecfff475275cc957670d # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 7e4dede233..904480715f 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a3217cdb75fd305705856f6504f8816c2b6b0a10907725cb74d025a5c4e369b8 +3516354ee57b683c134de206f5321f064f9cb627aa12ba6fde98e59a9093c50c From e4856e86cda3f40deeecc519f41b4daf78846c22 Mon Sep 17 00:00:00 2001 From: drh <> Date: Thu, 10 Apr 2025 19:03:42 +0000 Subject: [PATCH 083/120] Be sure that speedtest1 reports any errors that it encounters while running the speed tests. FossilOrigin-Name: 8c8b1a99bc888a5db637900aa3c8ef1b8c748c527580c825a25df1008afcf9e0 --- manifest | 14 +++++++------- manifest.uuid | 2 +- test/speedtest1.c | 18 +++++++++++++++--- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/manifest b/manifest index 959e6e479e..201e198549 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\scomment\sin\ssessionD.test. -D 2025-04-10T17:25:57.906 +C Be\ssure\sthat\sspeedtest1\sreports\sany\serrors\sthat\sit\sencounters\swhile\nrunning\sthe\sspeed\stests. +D 2025-04-10T19:03:42.977 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -1687,7 +1687,7 @@ F test/speed4p.explain 6b5f104ebeb34a038b2f714150f51d01143e59aa F test/speed4p.test 377a0c48e5a92e0b11c1c5ebb1bc9d83a7312c922bc0cb05970ef5d6a96d1f0c F test/speedtest.md ee958457ae1b729d9715ae33c0320600000bf1d9ddea1a88dcf79f56729d6fad F test/speedtest.tcl 926d1e168f4a14e6fb68c5dc174de743536b547f365264bd5bac533b3621a4a0 x -F test/speedtest1.c 132cd5ba064f48910bb4b68337442b0ef419218c8de9e9855f66d98015286ddb +F test/speedtest1.c 3064b76adc1b0f3715ce3d898e3e4a8f484c19c2b53115c46a50293bb04f4439 F test/spellfix.test 951a6405d49d1a23d6b78027d3877b4a33eeb8221dcab5704b499755bb4f552e F test/spellfix2.test dfc8f519a3fc204cb2dfa8b4f29821ae90f6f8c3 F test/spellfix3.test 0f9efaaa502a0e0a09848028518a6fb096c8ad33 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P a3217cdb75fd305705856f6504f8816c2b6b0a10907725cb74d025a5c4e369b8 -R e9c3c58b6aa871893824790c20bbd8a9 -U dan -Z 63c562955bebecfff475275cc957670d +P 3516354ee57b683c134de206f5321f064f9cb627aa12ba6fde98e59a9093c50c +R c138a52241458c8ca08673d2b100d73f +U drh +Z 070311e397246e4eea2ac545196ad07f # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 904480715f..f4cf356b68 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -3516354ee57b683c134de206f5321f064f9cb627aa12ba6fde98e59a9093c50c +8c8b1a99bc888a5db637900aa3c8ef1b8c748c527580c825a25df1008afcf9e0 diff --git a/test/speedtest1.c b/test/speedtest1.c index b49c70098f..3dce5942b8 100644 --- a/test/speedtest1.c +++ b/test/speedtest1.c @@ -542,6 +542,7 @@ char *speedtest1_once(const char *zFormat, ...){ char *zSql; sqlite3_stmt *pStmt; char *zResult = 0; + int rc; va_start(ap, zFormat); zSql = sqlite3_vmprintf(zFormat, ap); va_end(ap); @@ -557,9 +558,14 @@ char *speedtest1_once(const char *zFormat, ...){ fprintf(g.pScript,"%s\n",z); sqlite3_free(z); } - if( sqlite3_step(pStmt)==SQLITE_ROW ){ + if( (rc = sqlite3_step(pStmt))==SQLITE_ROW ){ const char *z = (const char*)sqlite3_column_text(pStmt, 0); if( z ) zResult = sqlite3_mprintf("%s", z); + }else if( rc==SQLITE_ERROR ){ + rc = sqlite3_reset(pStmt); + fprintf(stderr, "%s\nError code %d: %s\n", + sqlite3_sql(pStmt), rc, sqlite3_errmsg(g.db)); + exit(1); } sqlite3_finalize(pStmt); } @@ -590,7 +596,7 @@ void speedtest1_prepare(const char *zFormat, ...){ /* Run an SQL statement previously prepared */ void speedtest1_run(void){ - int i, n, len; + int i, n, len, rc; if( g.bSqlOnly ) return; assert( g.pStmt ); g.nResult = 0; @@ -599,7 +605,7 @@ void speedtest1_run(void){ fprintf(g.pScript,"%s\n",z); sqlite3_free(z); } - while( sqlite3_step(g.pStmt)==SQLITE_ROW ){ + while( (rc = sqlite3_step(g.pStmt))==SQLITE_ROW ){ n = sqlite3_column_count(g.pStmt); for(i=0; i=3006001 if( g.bReprepare ){ sqlite3_stmt *pNew; From f95e964b6b94a26f7ecc1a9fde947384107c4d2d Mon Sep 17 00:00:00 2001 From: drh <> Date: Thu, 10 Apr 2025 19:39:34 +0000 Subject: [PATCH 084/120] Provide new command-line options --hard-heap-limit and --soft-heap-limit for speedtest1. FossilOrigin-Name: 578e9fedeaaacd152ae1988920e6c9a0c43f664e2f9461c0994ba427ae1688e7 --- manifest | 12 ++++++------ manifest.uuid | 2 +- test/speedtest1.c | 21 +++++++++++++++++++++ 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/manifest b/manifest index 201e198549..a0ef6256a8 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Be\ssure\sthat\sspeedtest1\sreports\sany\serrors\sthat\sit\sencounters\swhile\nrunning\sthe\sspeed\stests. -D 2025-04-10T19:03:42.977 +C Provide\snew\scommand-line\soptions\s--hard-heap-limit\sand\s--soft-heap-limit\nfor\sspeedtest1. +D 2025-04-10T19:39:34.328 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -1687,7 +1687,7 @@ F test/speed4p.explain 6b5f104ebeb34a038b2f714150f51d01143e59aa F test/speed4p.test 377a0c48e5a92e0b11c1c5ebb1bc9d83a7312c922bc0cb05970ef5d6a96d1f0c F test/speedtest.md ee958457ae1b729d9715ae33c0320600000bf1d9ddea1a88dcf79f56729d6fad F test/speedtest.tcl 926d1e168f4a14e6fb68c5dc174de743536b547f365264bd5bac533b3621a4a0 x -F test/speedtest1.c 3064b76adc1b0f3715ce3d898e3e4a8f484c19c2b53115c46a50293bb04f4439 +F test/speedtest1.c b6823a37a46d742a087f68495d63fc28d3b1a4fc6416a3366e0c67d01f19d105 F test/spellfix.test 951a6405d49d1a23d6b78027d3877b4a33eeb8221dcab5704b499755bb4f552e F test/spellfix2.test dfc8f519a3fc204cb2dfa8b4f29821ae90f6f8c3 F test/spellfix3.test 0f9efaaa502a0e0a09848028518a6fb096c8ad33 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 3516354ee57b683c134de206f5321f064f9cb627aa12ba6fde98e59a9093c50c -R c138a52241458c8ca08673d2b100d73f +P 8c8b1a99bc888a5db637900aa3c8ef1b8c748c527580c825a25df1008afcf9e0 +R 6387413ea82c4eeeabb5cf2294064ac0 U drh -Z 070311e397246e4eea2ac545196ad07f +Z b94f061884cf2cdb326ad331d6bc2c81 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index f4cf356b68..9f0a2c48af 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -8c8b1a99bc888a5db637900aa3c8ef1b8c748c527580c825a25df1008afcf9e0 +578e9fedeaaacd152ae1988920e6c9a0c43f664e2f9461c0994ba427ae1688e7 diff --git a/test/speedtest1.c b/test/speedtest1.c index 3dce5942b8..4a383e2e6a 100644 --- a/test/speedtest1.c +++ b/test/speedtest1.c @@ -35,6 +35,7 @@ static const char zHelp[] = " --exclusive Enable locking_mode=EXCLUSIVE\n" " --explain Like --sqlonly but with added EXPLAIN keywords\n" " --fullfsync Enable fullfsync=TRUE\n" + " --hard-heap-limit N The hard limit on the maximum heap size\n" " --heap SZ MIN Memory allocator uses SZ bytes & min allocation MIN\n" " --incrvacuum Enable incremenatal vacuum mode\n" " --journal M Set the journal_mode to M\n" @@ -60,6 +61,7 @@ static const char zHelp[] = " --sqlonly No-op. Only show the SQL that would have been run.\n" " --shrink-memory Invoke sqlite3_db_release_memory() frequently.\n" " --size N Relative test size. Default=100\n" + " --soft-heap-limit N The soft limit on the maximum heap size\n" " --strict Use STRICT table where appropriate\n" " --stats Show statistics at the end\n" " --stmtscanstatus Activate SQLITE_DBCONFIG_STMT_SCANSTATUS\n" @@ -2961,6 +2963,8 @@ int main(int argc, char **argv){ int doIncrvac = 0; /* True for --incrvacuum */ const char *zJMode = 0; /* Journal mode */ const char *zKey = 0; /* Encryption key */ + int nHardHeapLmt = 0; /* The hard heap limit */ + int nSoftHeapLmt = 0; /* The soft heap limit */ int nLook = -1, szLook = 0; /* --lookaside configuration */ int noSync = 0; /* True for --nosync */ int pageSize = 0; /* Desired page size. 0 means default */ @@ -3033,6 +3037,10 @@ int main(int argc, char **argv){ }else if( strcmp(z,"explain")==0 ){ g.bSqlOnly = 1; g.bExplain = 1; + }else if( strcmp(z,"hard-heap-limit")==0 ){ + ARGC_VALUE_CHECK(1); + nHardHeapLmt = integerValue(argv[i+1]); + i += 1; }else if( strcmp(z,"heap")==0 ){ ARGC_VALUE_CHECK(2); nHeap = integerValue(argv[i+1]); @@ -3122,6 +3130,10 @@ int main(int argc, char **argv){ }else if( strcmp(z,"size")==0 ){ ARGC_VALUE_CHECK(1); g.szTest = g.szBase = integerValue(argv[++i]); + }else if( strcmp(z,"soft-heap-limit")==0 ){ + ARGC_VALUE_CHECK(1); + nSoftHeapLmt = integerValue(argv[i+1]); + i += 1; }else if( strcmp(z,"stats")==0 ){ showStats = 1; }else if( strcmp(z,"temp")==0 ){ @@ -3283,6 +3295,15 @@ int main(int argc, char **argv){ if( zJMode ){ speedtest1_exec("PRAGMA journal_mode=%s", zJMode); } + if( nHardHeapLmt>0 ){ + speedtest1_exec("PRAGMA hard_heap_limit=%d", nHardHeapLmt); + } + if( nSoftHeapLmt>0 ){ + speedtest1_exec("PRAGMA soft_heap_limit=%d", nSoftHeapLmt); + } + if( zJMode ){ + speedtest1_exec("PRAGMA journal_mode=%s", zJMode); + } if( g.bExplain ) printf(".explain\n.echo on\n"); if( strcmp(zTSet,"mix1")==0 ) zTSet = zMix1Tests; From a863bafba7d6835f065c9f3c10aba84e8f9a061a Mon Sep 17 00:00:00 2001 From: drh <> Date: Thu, 10 Apr 2025 19:54:56 +0000 Subject: [PATCH 085/120] Improved detection of run-time errors (ex: OOM errors) in speedtest1. FossilOrigin-Name: 0e5e0e2f558a417d57c01a2d62cb2117d2adf6ddbc62e6a0208ae23f19b05347 --- manifest | 12 ++++++------ manifest.uuid | 2 +- test/speedtest1.c | 29 +++++++++++++++++------------ 3 files changed, 24 insertions(+), 19 deletions(-) diff --git a/manifest b/manifest index a0ef6256a8..2befe0ebac 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Provide\snew\scommand-line\soptions\s--hard-heap-limit\sand\s--soft-heap-limit\nfor\sspeedtest1. -D 2025-04-10T19:39:34.328 +C Improved\sdetection\sof\srun-time\serrors\s(ex:\sOOM\serrors)\sin\sspeedtest1. +D 2025-04-10T19:54:56.037 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -1687,7 +1687,7 @@ F test/speed4p.explain 6b5f104ebeb34a038b2f714150f51d01143e59aa F test/speed4p.test 377a0c48e5a92e0b11c1c5ebb1bc9d83a7312c922bc0cb05970ef5d6a96d1f0c F test/speedtest.md ee958457ae1b729d9715ae33c0320600000bf1d9ddea1a88dcf79f56729d6fad F test/speedtest.tcl 926d1e168f4a14e6fb68c5dc174de743536b547f365264bd5bac533b3621a4a0 x -F test/speedtest1.c b6823a37a46d742a087f68495d63fc28d3b1a4fc6416a3366e0c67d01f19d105 +F test/speedtest1.c 64b8804b053a796eab22f8b23fb181000f05d7b3e2aa44f022117ea543bc5a2a F test/spellfix.test 951a6405d49d1a23d6b78027d3877b4a33eeb8221dcab5704b499755bb4f552e F test/spellfix2.test dfc8f519a3fc204cb2dfa8b4f29821ae90f6f8c3 F test/spellfix3.test 0f9efaaa502a0e0a09848028518a6fb096c8ad33 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 8c8b1a99bc888a5db637900aa3c8ef1b8c748c527580c825a25df1008afcf9e0 -R 6387413ea82c4eeeabb5cf2294064ac0 +P 578e9fedeaaacd152ae1988920e6c9a0c43f664e2f9461c0994ba427ae1688e7 +R ba4a44d30114309e9b2a1e00908db202 U drh -Z b94f061884cf2cdb326ad331d6bc2c81 +Z 4f5762aa26eeee7e23b8bf7e772aabcd # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 9f0a2c48af..08470faabe 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -578e9fedeaaacd152ae1988920e6c9a0c43f664e2f9461c0994ba427ae1688e7 +0e5e0e2f558a417d57c01a2d62cb2117d2adf6ddbc62e6a0208ae23f19b05347 diff --git a/test/speedtest1.c b/test/speedtest1.c index 4a383e2e6a..10cd30f1c7 100644 --- a/test/speedtest1.c +++ b/test/speedtest1.c @@ -560,11 +560,12 @@ char *speedtest1_once(const char *zFormat, ...){ fprintf(g.pScript,"%s\n",z); sqlite3_free(z); } - if( (rc = sqlite3_step(pStmt))==SQLITE_ROW ){ + if( sqlite3_step(pStmt)==SQLITE_ROW ){ const char *z = (const char*)sqlite3_column_text(pStmt, 0); if( z ) zResult = sqlite3_mprintf("%s", z); - }else if( rc==SQLITE_ERROR ){ - rc = sqlite3_reset(pStmt); + } + rc = sqlite3_reset(pStmt); + if( rc!=SQLITE_OK ){ fprintf(stderr, "%s\nError code %d: %s\n", sqlite3_sql(pStmt), rc, sqlite3_errmsg(g.db)); exit(1); @@ -607,7 +608,7 @@ void speedtest1_run(void){ fprintf(g.pScript,"%s\n",z); sqlite3_free(z); } - while( (rc = sqlite3_step(g.pStmt))==SQLITE_ROW ){ + while( sqlite3_step(g.pStmt)==SQLITE_ROW ){ n = sqlite3_column_count(g.pStmt); for(i=0; i=3006001 if( g.bReprepare ){ sqlite3_stmt *pNew; sqlite3_prepare_v2(g.db, sqlite3_sql(g.pStmt), -1, &pNew, 0); - sqlite3_finalize(g.pStmt); + rc = sqlite3_finalize(g.pStmt); + if( rc!=SQLITE_OK ){ + fprintf(stderr, "%s\nError code %d: %s\n", + sqlite3_sql(pNew), rc, sqlite3_errmsg(g.db)); + exit(1); + } g.pStmt = pNew; }else #endif { - sqlite3_reset(g.pStmt); + rc = sqlite3_reset(g.pStmt); + if( rc!=SQLITE_OK ){ + fprintf(stderr, "%s\nError code %d: %s\n", + sqlite3_sql(g.pStmt), rc, sqlite3_errmsg(g.db)); + exit(1); + } } speedtest1_shrink_memory(); } From 0aa95099f5003dc99f599ab77ac0004950b281ef Mon Sep 17 00:00:00 2001 From: dan Date: Thu, 10 Apr 2025 20:52:47 +0000 Subject: [PATCH 086/120] Fix a memory leak in sqlite3session_diff(). FossilOrigin-Name: a6cbc5db1c4973ea236874bd9c24cd86dc48fbc7a10e424896c0407c7c32ce6a --- ext/session/sessionD.test | 10 +++++++++- ext/session/sqlite3session.c | 2 ++ manifest | 16 ++++++++-------- manifest.uuid | 2 +- 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/ext/session/sessionD.test b/ext/session/sessionD.test index 17cb13d4ea..43ec03b447 100644 --- a/ext/session/sessionD.test +++ b/ext/session/sessionD.test @@ -282,7 +282,6 @@ proc do_sessions_diff_error {tn db tbl err} { } # Test that it is an error if the named db is missing. -breakpoint do_sessions_diff_error 5.1 nosuchdb t1 { 1 {SQLITE_SCHEMA - no such table: nosuchdb.t1} } @@ -297,4 +296,13 @@ do_sessions_diff_error 5.3 two t1 { 1 {SQLITE_SCHEMA - table schemas do not match} } +do_test 5.4 { + sqlite3session S db main + + catch {S diff two blue} + catch {S diff two blue} + + S delete +} {} + finish_test diff --git a/ext/session/sqlite3session.c b/ext/session/sqlite3session.c index d049f69862..a8dd1d9be2 100644 --- a/ext/session/sqlite3session.c +++ b/ext/session/sqlite3session.c @@ -1209,6 +1209,8 @@ static int sessionInitTable( if( pTab->nCol==0 ){ u8 *abPK; assert( pTab->azCol==0 || pTab->abPK==0 ); + sqlite3_free(pTab->azCol); + pTab->abPK = 0; rc = sessionTableInfo(pSession, db, zDb, pTab->zName, &pTab->nCol, &pTab->nTotalCol, 0, &pTab->azCol, &pTab->azDflt, &pTab->aiIdx, &abPK, diff --git a/manifest b/manifest index 2befe0ebac..580bc0184f 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Improved\sdetection\sof\srun-time\serrors\s(ex:\sOOM\serrors)\sin\sspeedtest1. -D 2025-04-10T19:54:56.037 +C Fix\sa\smemory\sleak\sin\ssqlite3session_diff(). +D 2025-04-10T20:52:47.688 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -589,7 +589,7 @@ F ext/session/session9.test 4e3aff62d6b4294498ddbe309076de06f4fddffad4fe5f5a6c03 F ext/session/sessionA.test 1feeab0b8e03527f08f2f1defb442da25480138f F ext/session/sessionB.test c4fb7f8a688787111606e123a555f18ee04f65bb9f2a4bb2aa71d55ce4e6d02c F ext/session/sessionC.test f8a5508bc059ae646e5ec9bdbca66ad24bc92fe99fda5790ac57e1f59fce2fdf -F ext/session/sessionD.test 9e38ee4efd80722b7e9b73fa0019775ff1d9ccb98f22d878f44ad389582bbdc4 +F ext/session/sessionD.test 470ff917dc849e2eb78142ade63aaabd729d773833cff0ff01bca0eda68a21ce F ext/session/sessionE.test b2010949c9d7415306f64e3c2072ddabc4b8250c98478d3c0c4d064bce83111d F ext/session/sessionF.test d37ed800881e742c208df443537bf29aa49fd56eac520d0f0c6df3e6320f3401 F ext/session/sessionG.test 3efe388282d641b65485b5462e67851002cd91a282dc95b685d085eb8efdad0a @@ -617,7 +617,7 @@ F ext/session/sessionrowid.test 85187c2f1b38861a5844868126f69f9ec62223a03449a98a F ext/session/sessionsize.test 8fcf4685993c3dbaa46a24183940ab9f5aa9ed0d23e5fb63bfffbdb56134b795 F ext/session/sessionstat1.test 5e718d5888c0c49bbb33a7a4f816366db85f59f6a4f97544a806421b85dc2dec F ext/session/sessionwor.test 6fd9a2256442cebde5b2284936ae9e0d54bde692d0f5fd009ecef8511f4cf3fc -F ext/session/sqlite3session.c 1a28245b9814542c1b9c8f3064fc63a91b341833879b27246a0ea8cf10257069 +F ext/session/sqlite3session.c 7a8816d56940c464c74706dfb02f18129b290655df1ccb8648228a7d436141f2 F ext/session/sqlite3session.h 532561f5b181bc623c25bfa0ecfd1f115bc9a2b42ec96fee8a67b1a10f3cc42c F ext/session/test_session.c af162108e8dc40cb9fe0e876e0155cecabcb49e82e5939677d21451e36160283 F ext/wasm/EXPORTED_FUNCTIONS.fiddle.in 27450c8b8c70875a260aca55435ec927068b34cef801a96205adb81bdcefc65c @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 578e9fedeaaacd152ae1988920e6c9a0c43f664e2f9461c0994ba427ae1688e7 -R ba4a44d30114309e9b2a1e00908db202 -U drh -Z 4f5762aa26eeee7e23b8bf7e772aabcd +P 0e5e0e2f558a417d57c01a2d62cb2117d2adf6ddbc62e6a0208ae23f19b05347 +R ea8e02173c6f4e7238e9e39c21ec2d22 +U dan +Z fad13ff67cc688b0b5e83e82f9779719 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 08470faabe..97db019baa 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -0e5e0e2f558a417d57c01a2d62cb2117d2adf6ddbc62e6a0208ae23f19b05347 +a6cbc5db1c4973ea236874bd9c24cd86dc48fbc7a10e424896c0407c7c32ce6a From 19b070108749bb548e03c0b3aef850bd51486cb1 Mon Sep 17 00:00:00 2001 From: stephan Date: Sat, 12 Apr 2025 02:30:04 +0000 Subject: [PATCH 087/120] Initial port of the TEA build (autoconf/tea) from autotools to autosetup. FossilOrigin-Name: 95227341cf290ca6f20b5ff7e707a28b59f87784947425c3fd1d8e5e7eb878a4 --- autoconf/Makefile.in | 1 - autoconf/tea/Makefile.in | 814 ++-- autoconf/tea/README.txt | 29 +- autoconf/tea/aclocal.m4 | 9 - autoconf/tea/auto.def | 7 + autoconf/tea/autosetup/README.txt | 4 + autoconf/tea/autosetup/teaish-core.tcl | 964 ++++ .../tea/autosetup/teaish-feature-tests.tcl | 279 ++ autoconf/tea/autosetup/teaish-tester.tcl | 103 + autoconf/tea/configure | 4 + autoconf/tea/configure.ac.in | 227 - autoconf/tea/pkgIndex.tcl.in | 32 +- autoconf/tea/tclconfig/install-sh | 541 --- autoconf/tea/tclconfig/tcl.m4 | 4119 ----------------- autoconf/tea/teaish.tcl | 536 +++ autoconf/tea/teaish.tester.tcl.in | 13 + autoconf/tea/win/makefile.vc | 61 - autoconf/tea/win/nmakehlp.c | 815 ---- autoconf/tea/win/rules-ext.vc | 123 - autoconf/tea/win/rules.vc | 1913 -------- autoconf/tea/win/targets.vc | 98 - autosetup/proj.tcl | 2 +- manifest | 41 +- manifest.uuid | 2 +- tool/mkautoconfamal.sh | 24 +- 25 files changed, 2357 insertions(+), 8404 deletions(-) delete mode 100644 autoconf/tea/aclocal.m4 create mode 100644 autoconf/tea/auto.def create mode 100644 autoconf/tea/autosetup/README.txt create mode 100644 autoconf/tea/autosetup/teaish-core.tcl create mode 100644 autoconf/tea/autosetup/teaish-feature-tests.tcl create mode 100644 autoconf/tea/autosetup/teaish-tester.tcl create mode 100755 autoconf/tea/configure delete mode 100644 autoconf/tea/configure.ac.in delete mode 100644 autoconf/tea/tclconfig/install-sh delete mode 100644 autoconf/tea/tclconfig/tcl.m4 create mode 100644 autoconf/tea/teaish.tcl create mode 100644 autoconf/tea/teaish.tester.tcl.in delete mode 100644 autoconf/tea/win/makefile.vc delete mode 100644 autoconf/tea/win/nmakehlp.c delete mode 100644 autoconf/tea/win/rules-ext.vc delete mode 100644 autoconf/tea/win/rules.vc delete mode 100644 autoconf/tea/win/targets.vc diff --git a/autoconf/Makefile.in b/autoconf/Makefile.in index 633bfd41e1..aaa23b7def 100644 --- a/autoconf/Makefile.in +++ b/autoconf/Makefile.in @@ -293,7 +293,6 @@ dist: rm -fr $(dist_name) mkdir -p $(dist_name) cp -rp $(DIST_FILES) $(dist_name)/. - rm -f $(dist_name)/tea/configure.ac.in tar czf $(dist_tarball) $(dist_name) rm -fr $(dist_name) ls -l $(dist_tarball) diff --git a/autoconf/tea/Makefile.in b/autoconf/tea/Makefile.in index cc98ab1825..cb16c54473 100644 --- a/autoconf/tea/Makefile.in +++ b/autoconf/tea/Makefile.in @@ -1,463 +1,389 @@ -# Makefile.in -- +all: # -# This file is a Makefile for Sample TEA Extension. If it has the name -# "Makefile.in" then it is a template for a Makefile; to generate the -# actual Makefile, run "./configure", which is a configuration script -# generated by the "autoconf" program (constructs like "@foo@" will get -# replaced in the actual Makefile. +# This makefile is part of the teaish framework, a tool for building +# Tcl extensions, conceptually related to TEA/tclconfig but using the +# Autosetup configuration system instead of the GNU Autotools. # -# Copyright (c) 1999 Scriptics Corporation. -# Copyright (c) 2002-2005 ActiveState Corporation. +# A copy of this makefile gets processed for each extension separately +# and populated with info about how to build, test, and install the +# extension. # -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. - -#======================================================================== -# Add additional lines to handle any additional AC_SUBST cases that -# have been added in a customized configure script. -#======================================================================== - -#SAMPLE_NEW_VAR = @SAMPLE_NEW_VAR@ - -#======================================================================== -# Nothing of the variables below this line should need to be changed. -# Please check the TARGETS section below to make sure the make targets -# are correct. -#======================================================================== - -#======================================================================== -# The names of the source files is defined in the configure script. -# The object files are used for linking into the final library. -# This will be used when a dist target is added to the Makefile. -# It is not important to specify the directory, as long as it is the -# $(srcdir) or in the generic, win or unix subdirectory. -#======================================================================== - -PKG_SOURCES = @PKG_SOURCES@ -PKG_OBJECTS = @PKG_OBJECTS@ - -PKG_STUB_SOURCES = @PKG_STUB_SOURCES@ -PKG_STUB_OBJECTS = @PKG_STUB_OBJECTS@ - -#======================================================================== -# PKG_TCL_SOURCES identifies Tcl runtime files that are associated with -# this package that need to be installed, if any. -#======================================================================== - -PKG_TCL_SOURCES = @PKG_TCL_SOURCES@ - -#======================================================================== -# This is a list of public header files to be installed, if any. -#======================================================================== - -PKG_HEADERS = @PKG_HEADERS@ - -#======================================================================== -# "PKG_LIB_FILE" refers to the library (dynamic or static as per -# configuration options) composed of the named objects. -#======================================================================== - -PKG_LIB_FILE = @PKG_LIB_FILE@ -PKG_LIB_FILE8 = @PKG_LIB_FILE8@ -PKG_LIB_FILE9 = @PKG_LIB_FILE9@ -PKG_STUB_LIB_FILE = @PKG_STUB_LIB_FILE@ - -lib_BINARIES = $(PKG_LIB_FILE) -BINARIES = $(lib_BINARIES) - -SHELL = @SHELL@ - -srcdir = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -libdir = @libdir@ -includedir = @includedir@ -datarootdir = @datarootdir@ -runstatedir = @runstatedir@ -datadir = @datadir@ -mandir = @mandir@ - -DESTDIR = - -PKG_DIR = $(PACKAGE_NAME)$(PACKAGE_VERSION) -pkgdatadir = $(datadir)/$(PKG_DIR) -pkglibdir = $(libdir)/$(PKG_DIR) -pkgincludedir = $(includedir)/$(PKG_DIR) - -top_builddir = @abs_top_builddir@ - -INSTALL_OPTIONS = -INSTALL = @INSTALL@ $(INSTALL_OPTIONS) -INSTALL_DATA_DIR = @INSTALL_DATA_DIR@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_LIBRARY = @INSTALL_LIBRARY@ - -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -CC = @CC@ -CFLAGS_DEFAULT = @CFLAGS_DEFAULT@ -CFLAGS_WARNING = @CFLAGS_WARNING@ -EXEEXT = @EXEEXT@ -LDFLAGS_DEFAULT = @LDFLAGS_DEFAULT@ -MAKE_LIB = @MAKE_LIB@ -MAKE_STUB_LIB = @MAKE_STUB_LIB@ -OBJEXT = @OBJEXT@ -RANLIB = @RANLIB@ -RANLIB_STUB = @RANLIB_STUB@ -SHLIB_CFLAGS = @SHLIB_CFLAGS@ -SHLIB_LD = @SHLIB_LD@ -SHLIB_LD_LIBS = @SHLIB_LD_LIBS@ -STLIB_LD = @STLIB_LD@ -#TCL_DEFS = @TCL_DEFS@ -TCL_BIN_DIR = @TCL_BIN_DIR@ -TCL_SRC_DIR = @TCL_SRC_DIR@ -#TK_BIN_DIR = @TK_BIN_DIR@ -#TK_SRC_DIR = @TK_SRC_DIR@ - -# Not used, but retained for reference of what libs Tcl required -#TCL_LIBS = @TCL_LIBS@ - -#======================================================================== -# TCLLIBPATH seeds the auto_path in Tcl's init.tcl so we can test our -# package without installing. The other environment variables allow us -# to test against an uninstalled Tcl. Add special env vars that you -# require for testing here (like TCLX_LIBRARY). -#======================================================================== - -EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR) -#EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR):$(TK_BIN_DIR) -TCLLIBPATH = $(top_builddir) -TCLSH_ENV = TCL_LIBRARY=`@CYGPATH@ $(TCL_SRC_DIR)/library` -PKG_ENV = @LD_LIBRARY_PATH_VAR@="$(EXTRA_PATH):$(@LD_LIBRARY_PATH_VAR@)" \ - PATH="$(EXTRA_PATH):$(PATH)" \ - TCLLIBPATH="$(TCLLIBPATH)" - -TCLSH_PROG = @TCLSH_PROG@ -TCLSH = $(TCLSH_ENV) $(PKG_ENV) $(TCLSH_PROG) - -#WISH_ENV = TK_LIBRARY=`@CYGPATH@ $(TK_SRC_DIR)/library` -#WISH_PROG = @WISH_PROG@ -#WISH = $(TCLSH_ENV) $(WISH_ENV) $(PKG_ENV) $(WISH_PROG) - -SHARED_BUILD = @SHARED_BUILD@ - -INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ -I. -I$(srcdir)/.. -#INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ @TK_INCLUDES@ @TK_XINCLUDES@ - -PKG_CFLAGS = @PKG_CFLAGS@ - -# TCL_DEFS is not strictly need here, but if you remove it, then you -# must make sure that configure.ac checks for the necessary components -# that your library may use. TCL_DEFS can actually be a problem if -# you do not compile with a similar machine setup as the Tcl core was -# compiled with. -#DEFS = $(TCL_DEFS) @DEFS@ $(PKG_CFLAGS) -DEFS = @DEFS@ $(PKG_CFLAGS) - -# Move pkgIndex.tcl to 'BINARIES' var if it is generated in the Makefile -CONFIG_CLEAN_FILES = Makefile pkgIndex.tcl -CLEANFILES = @CLEANFILES@ - -CPPFLAGS = @CPPFLAGS@ -LIBS = @PKG_LIBS@ @LIBS@ -AR = @AR@ -CFLAGS = @CFLAGS@ -LDFLAGS = @LDFLAGS@ -LDFLAGS_DEFAULT = @LDFLAGS_DEFAULT@ -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) \ - $(CFLAGS_DEFAULT) $(CFLAGS_WARNING) $(SHLIB_CFLAGS) $(CFLAGS) - -GDB = gdb -VALGRIND = valgrind -VALGRINDARGS = --tool=memcheck --num-callers=8 --leak-resolution=high \ - --leak-check=yes --show-reachable=yes -v - -.SUFFIXES: .c .$(OBJEXT) - -#======================================================================== -# Start of user-definable TARGETS section -#======================================================================== - -#======================================================================== -# TEA TARGETS. Please note that the "libraries:" target refers to platform -# independent files, and the "binaries:" target includes executable programs and -# platform-dependent libraries. Modify these targets so that they install -# the various pieces of your package. The make and install rules -# for the BINARIES that you specified above have already been done. -#======================================================================== - -all: binaries libraries doc - -#======================================================================== -# The binaries target builds executable programs, Windows .dll's, unix -# shared/static libraries, and any other platform-dependent files. -# The list of targets to build for "binaries:" is specified at the top -# of the Makefile, in the "BINARIES" variable. -#======================================================================== - -binaries: $(BINARIES) - -libraries: - -#======================================================================== -# Your doc target should differentiate from doc builds (by the developer) -# and doc installs (see install-doc), which just install the docs on the -# end user machine when building from source. -#======================================================================== - -doc: - @echo "If you have documentation to create, place the commands to" - @echo "build the docs in the 'doc:' target. For example:" - @echo " xml2nroff sample.xml > sample.n" - @echo " xml2html sample.xml > sample.html" - -install: all install-binaries install-libraries install-doc - -install-binaries: binaries install-lib-binaries install-bin-binaries - -#======================================================================== -# This rule installs platform-independent files, such as header files. -# The list=...; for p in $$list handles the empty list case x-platform. -#======================================================================== - -install-libraries: libraries - @$(INSTALL_DATA_DIR) "$(DESTDIR)$(includedir)" - @echo "Installing header files in $(DESTDIR)$(includedir)" - @list='$(PKG_HEADERS)'; for i in $$list; do \ - echo "Installing $(srcdir)/$$i" ; \ - $(INSTALL_DATA) $(srcdir)/$$i "$(DESTDIR)$(includedir)" ; \ - done; - -#======================================================================== -# Install documentation. Unix manpages should go in the $(mandir) -# directory. -#======================================================================== - -install-doc: doc - @$(INSTALL_DATA_DIR) "$(DESTDIR)$(mandir)/mann" - @echo "Installing documentation in $(DESTDIR)$(mandir)" - @list='$(srcdir)/doc/*.n'; for i in $$list; do \ - echo "Installing $$i"; \ - $(INSTALL_DATA) $$i "$(DESTDIR)$(mandir)/mann" ; \ - done - -test: binaries libraries - @echo "SQLite TEA distribution does not include tests" - -shell: binaries libraries - @$(TCLSH) $(SCRIPT) - -gdb: - $(TCLSH_ENV) $(PKG_ENV) $(GDB) $(TCLSH_PROG) $(SCRIPT) - -gdb-test: binaries libraries - $(TCLSH_ENV) $(PKG_ENV) $(GDB) \ - --args $(TCLSH_PROG) `@CYGPATH@ $(srcdir)/tests/all.tcl` \ - $(TESTFLAGS) -singleproc 1 \ - -load "package ifneeded $(PACKAGE_NAME) $(PACKAGE_VERSION) \ - [list load `@CYGPATH@ $(PKG_LIB_FILE)` [string totitle $(PACKAGE_NAME)]]" - -valgrind: binaries libraries - $(TCLSH_ENV) $(PKG_ENV) $(VALGRIND) $(VALGRINDARGS) $(TCLSH_PROG) \ - `@CYGPATH@ $(srcdir)/tests/all.tcl` $(TESTFLAGS) - -valgrindshell: binaries libraries - $(TCLSH_ENV) $(PKG_ENV) $(VALGRIND) $(VALGRINDARGS) $(TCLSH_PROG) $(SCRIPT) - -depend: - -#======================================================================== -# $(PKG_LIB_FILE) should be listed as part of the BINARIES variable -# mentioned above. That will ensure that this target is built when you -# run "make binaries". +# Maintenance reminder: this file needs to stay portable with POSIX +# Make, not just GNU Make. Yes, that's unfortunate because it makes +# some things impossible (like skipping over swathes of rules when +# 'make distclean' is invoked). # -# The $(PKG_OBJECTS) objects are created and linked into the final -# library. In most cases these object files will correspond to the -# source files above. -#======================================================================== -$(PKG_LIB_FILE): $(PKG_OBJECTS) - -rm -f $(PKG_LIB_FILE) - ${MAKE_LIB} - $(RANLIB) $(PKG_LIB_FILE) +CC = @CC@ +INSTALL = @BIN_INSTALL@ +INSTALL.noexec = $(INSTALL) -m 0644 -$(PKG_STUB_LIB_FILE): $(PKG_STUB_OBJECTS) - -rm -f $(PKG_STUB_LIB_FILE) - ${MAKE_STUB_LIB} - $(RANLIB_STUB) $(PKG_STUB_LIB_FILE) - -#======================================================================== -# We need to enumerate the list of .c to .o lines here. # -# In the following lines, $(srcdir) refers to the toplevel directory -# containing your extension. If your sources are in a subdirectory, -# you will have to modify the paths to reflect this: +# Var name prefixes: # -# sample.$(OBJEXT): $(srcdir)/generic/sample.c -# $(COMPILE) -c `@CYGPATH@ $(srcdir)/generic/sample.c` -o $@ +# teaish. => teaish core +# tx. => teaish extension # -# Setting the VPATH variable to a list of paths will cause the makefile -# to look into these paths when resolving .c to .obj dependencies. -# As necessary, add $(srcdir):$(srcdir)/compat:.... -#======================================================================== - -VPATH = $(srcdir):$(srcdir)/generic:$(srcdir)/unix:$(srcdir)/win:$(srcdir)/macosx - -.c.@OBJEXT@: - $(COMPILE) -c `@CYGPATH@ $<` -o $@ - - -#======================================================================== -# Distribution creation -# You may need to tweak this target to make it work correctly. -#======================================================================== - -#COMPRESS = tar cvf $(PKG_DIR).tar $(PKG_DIR); compress $(PKG_DIR).tar -COMPRESS = tar zcvf $(PKG_DIR).tar.gz $(PKG_DIR) -DIST_ROOT = /tmp/dist -DIST_DIR = $(DIST_ROOT)/$(PKG_DIR) - -DIST_INSTALL_DATA = CPPROG='cp -p' $(INSTALL) -m 644 -DIST_INSTALL_SCRIPT = CPPROG='cp -p' $(INSTALL) -m 755 - -dist-clean: - rm -rf $(DIST_DIR) $(DIST_ROOT)/$(PKG_DIR).tar.* - -dist: dist-clean $(srcdir)/manifest.uuid - $(INSTALL_DATA_DIR) $(DIST_DIR) - - # TEA files - $(DIST_INSTALL_DATA) $(srcdir)/Makefile.in \ - $(srcdir)/aclocal.m4 $(srcdir)/configure.ac \ - $(DIST_DIR)/ - $(DIST_INSTALL_SCRIPT) $(srcdir)/configure $(DIST_DIR)/ - - $(INSTALL_DATA_DIR) $(DIST_DIR)/tclconfig - $(DIST_INSTALL_DATA) $(srcdir)/tclconfig/README.txt \ - $(srcdir)/manifest.uuid \ - $(srcdir)/tclconfig/tcl.m4 $(srcdir)/tclconfig/install-sh \ - $(DIST_DIR)/tclconfig/ - - # Extension files - $(DIST_INSTALL_DATA) \ - $(srcdir)/ChangeLog \ - $(srcdir)/README.sha \ - $(srcdir)/license.terms \ - $(srcdir)/README \ - $(srcdir)/pkgIndex.tcl.in \ - $(DIST_DIR)/ - - list='demos doc generic library macosx tests unix win'; \ - for p in $$list; do \ - if test -d $(srcdir)/$$p ; then \ - $(INSTALL_DATA_DIR) $(DIST_DIR)/$$p; \ - $(DIST_INSTALL_DATA) $(srcdir)/$$p/* $(DIST_DIR)/$$p/; \ - fi; \ - done - - (cd $(DIST_ROOT); $(COMPRESS);) - -#======================================================================== -# End of user-definable section -#======================================================================== - -#======================================================================== -# Don't modify the file to clean here. Instead, set the "CLEANFILES" -# variable in configure.ac -#======================================================================== - -clean: - -test -z "$(BINARIES)" || rm -f $(BINARIES) - -rm -f *.$(OBJEXT) core *.core - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - -distclean: clean - -rm -f *.tab.c - -rm -f $(CONFIG_CLEAN_FILES) - -rm -f config.cache config.log config.status - -#======================================================================== -# Install binary object libraries. On Windows this includes both .dll and -# .lib files. Because the .lib files are not explicitly listed anywhere, -# we need to deduce their existence from the .dll file of the same name. -# Library files go into the lib directory. -# In addition, this will generate the pkgIndex.tcl -# file in the install location (assuming it can find a usable tclsh shell) +# Vars with a "tx." or "teaish." prefix are all "public" for purposes +# of the extension makefile, but the extension must not any "teaish." +# vars and must only modify "tx." vars where that allowance is +# specifically noted. # -# You should not have to modify this target. -#======================================================================== +# Vars with a "teaish__" prefix are "private" and must not be used by +# the extension makefile. They may change semantics or be removed in +# any given teaish build. +# +tx.name = @TEAISH_NAME@ +tx.pkgName = @TEAISH_PKGNAME@ +tx.version = @TEAISH_VERSION@ +tx.libdir = @TEAISH_LIBDIR_NAME@ +tx.loadPrefix = @TEAISH_LOAD_PREFIX@ +#tx.testScript = @TEAISH_TEST_TCL@ +tx.tcl = @TEAISH_TCL@ +tx.makefile = @TEAISH_MAKEFILE@ +tx.makefile.in = @TEAISH_MAKEFILE_IN@ +tx.dll8.basename = @TEAISH_DLL8_BASENAME@ +tx.dll9.basename = @TEAISH_DLL9_BASENAME@ +tx.dll8 = @TEAISH_DLL8@ +tx.dll9 = @TEAISH_DLL9@ +tx.dll = $(tx.dll$(TCL_MAJOR_VERSION)) +tx.dir = @TEAISH_DIR@ -install-lib-binaries: binaries - @$(INSTALL_DATA_DIR) "$(DESTDIR)$(pkglibdir)" - @list='$(lib_BINARIES)'; for p in $$list; do \ - if test -f $$p; then \ - echo " $(INSTALL_LIBRARY) $$p $(DESTDIR)$(pkglibdir)/$$p"; \ - $(INSTALL_LIBRARY) $$p "$(DESTDIR)$(pkglibdir)/$$p"; \ - ext=`echo $$p|sed -e "s/.*\.//"`; \ - if test "x$$ext" = "xdll"; then \ - lib=`basename $$p|sed -e 's/.[^.]*$$//'`.lib; \ - if test -f $$lib; then \ - echo " $(INSTALL_DATA) $$lib $(DESTDIR)$(pkglibdir)/$$lib"; \ - $(INSTALL_DATA) $$lib "$(DESTDIR)$(pkglibdir)/$$lib"; \ - fi; \ - fi; \ - fi; \ - done - @list='$(PKG_TCL_SOURCES)'; for p in $$list; do \ - if test -f $(srcdir)/$$p; then \ - destp=`basename $$p`; \ - echo " Install $$destp $(DESTDIR)$(pkglibdir)/$$destp"; \ - $(INSTALL_DATA) $(srcdir)/$$p "$(DESTDIR)$(pkglibdir)/$$destp"; \ - fi; \ - done - @if test "x$(SHARED_BUILD)" = "x1"; then \ - echo " Install pkgIndex.tcl $(DESTDIR)$(pkglibdir)"; \ - $(INSTALL_DATA) pkgIndex.tcl "$(DESTDIR)$(pkglibdir)"; \ +teaish.dir = @abs_top_srcdir@ +teaish.dir.autosetup = @TEAISH_AUTOSETUP_DIR@ +teaish.makefile = Makefile +teaish.makefile.in = $(teaish.dir)/Makefile.in +teaish__auto.def = $(teaish.dir)/auto.def + +# +# Autotools-conventional vars. We don't actually use these in this +# makefile but some may be referenced by vars imported via +# tclConfig.sh. They are part of the public API and may be reliably +# depended on from teaish.make.in. +# +bindir = @bindir@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +includedir = @includedir@ +infodir = @infodir@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ + + +# +# Vars derived (mostly) from tclConfig.sh. These may be reliably +# used from the extension makefile. +# +TCLSH = @TCLSH_CMD@ +TCL_CONFIG_SH = @TCL_CONFIG_SH@ +TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ +TCL_LIB_SPEC = @TCL_LIB_SPEC@ +TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ +TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ +TCL_VERSION = @TCL_VERSION@ +TCL_MAJOR_VERSION = @TCL_MAJOR_VERSION@ +TCL_MINOR_VERSION = @TCL_MINOR_VERSION@ +TCL_PATCH_LEVEL = @TCL_PATCH_LEVEL@ +TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ +TCL_LIBS = @TCL_LIBS@ +TCLLIBDIR = @TCLLIBDIR@ + +# +# CFLAGS.configure = CFLAGS as known at configure-time. +# +# This ordering is deliberate: flags populated via tcl's +# [teaish-add-cflags] should preceed CFLAGS and CPPFLAGS (which +# typically come from the ./configure command-line invocation). +# +CFLAGS.configure = @SH_CFLAGS@ @TEAISH_CFLAGS@ @CFLAGS@ @CPPFLAGS@ $(TCL_INCLUDE_SPEC) +#CFLAGS.configure += -DUSE_TCL_STUBS=1 + +# +# LDFLAGS.configure = LDFLAGS as known at configure-time. +# +# This ordering is deliberate: flags populated via tcl's +# [teaish-add-ldflags] should preceed LDFLAGS (which typically +# comes from the ./configure command-line invocation). +# +LDFLAGS.configure = @SH_LDFLAGS@ @TEAISH_LDFLAGS@ @LDFLAGS@ $(TCL_STUB_LIB_SPEC) + +# +# The following tx.XYZ vars may be populated/modified by teaish.tcl +# and/or teaish.make. +# + +# +# tx.src is the list of source or object files to include in the +# (single) compiler invocation. This will initially contain any +# sources passed to [teaish-add-src], but may also be appended to +# by teaish.make. +# +tx.src =@TEAISH_SRC@ + +# +# tx.CFLAGS is typically set by teaish.make, whereas TEAISH_CFLAGS +# gets set up via the configure script. +# +tx.CFLAGS = + +# +# tx.LDFLAGS is typically set by teaish.make, whereas TEAISH_LDFLAGS +# gets set up via the configure script. +# +tx.LDFLAGS = + +# +# The list of 'dist' files may be appended to from teaish.make.in. +# It can also be set up from teaish.tcl using [teaish-add-dist] +# and/or [teaish-add-src -dist ...]. +# +tx.dist.files = @TEAISH_DIST_FILES@ + +# +# May get amended with generated file names. They are cleaned up by +# the 'clean' rules. Client code which wants to clean up extra stuff +# should do so by adding their cleanup target (e.g. clean-extension) +# as a dependency to the 'clean' target, like so: +# +# clean: distclean-extension +# distclean: distclean-extension +# +teaish__cleanExtra = + +# +# List of deps which may trigger an auto-reconfigure. +# +teaish__autogen.deps = \ + $(tx.makefile.in) $(teaish.makefile.in) \ + $(tx.tcl) $(teaish.dir)/pkgIndex.tcl.in \ + @AUTODEPS@ +# +# Problem: when more than one target can invoke TEAISH_AUTORECONFIG, +# we can get parallel reconfigures running. Thus, targets which +# may require reconfigure should depend on... +# +config.log: $(teaish__autogen.deps) + @TEAISH_AUTORECONFIG@ +# ^^^ We would love to skip this when running [dist]clean, but there's +# no POSIX Make-portable way to do that. GNU Make can. +.PHONY: reconfigure +reconfigure: + @TEAISH_AUTORECONFIG@ + +$(teaish.makefile): $(teaish__auto.def) $(teaish.makefile.in) \ + @AUTODEPS@ + +# +# The rest of this makefile exists solely to support this brief +# target: the extension shared lib. +# +$(tx.dll): $(tx.src) config.log + $(CC) -o $@ $(CFLAGS.configure) $(CFLAGS) $(tx.CFLAGS) \ + $(tx.src) $(LDFLAGS.configure) $(LDFLAGS) $(tx.LDFLAGS) + +all: $(tx.dll) + +tclsh: $(teaish.makefile) config.log + @{ echo "#!/bin/sh"; echo "exec $(TCLSH) \"\$$@\""; } > $@ + @chmod +x $@ + @echo "Created $@" + +# +# If the extension includes teaish.test.tcl then provide a "test" +# target which which runs that script, passing it (1) the full path to +# extension's DLL (which also provides the script with a way to get +# the test directory) and (2) a script of test utility code intended for +# sourcing by the client. +# +# If the extension has no test script, add a small one which +# simply loads the DLL and success if it can. +# +# +tx.tester.args = $(tx.dll) $(tx.loadPrefix) @TEAISH_TESTER_TCL@ +.PHONY: test-pre test-core test test-post test-extension +test-extension: # this name is reserved for use by teaish.make +test-prepre: $(tx.dll) +test-pre: test-prepre +test-core: test-pre + $(TCLSH) teaish.tester.tcl $(tx.tester.args) +test-post: test-core +test: test-post + +# +# Cleanup rules... +# +.PHONY: clean-pre clean-core clean-post clean-extension +clean-extension: # this name is reserved for use by teaish.make +clean-pre: +clean-core: clean-pre + rm -f $(tx.dll8) $(tx.dll9) tclsh $(teaish__cleanExtra) +clean-post: clean-core +clean: clean-post + +.PHONY: distclean-pre distclean-core distclean-post clean-extension +distclean-extension: # this name is reserved for use by teaish.make +distclean-pre: clean +distclean-core: distclean-pre + rm -f Makefile pkgIndex.tcl teaish.make teaish.tester.tcl + rm -f config.log config.defines.txt +distclean-post: distclean-core +distclean: distclean-post + +# +# Installation rules... +# +.PHONY: install-pre install-core install-post install-test install-prepre install-extension +install-extension: # this name is reserved for use by teaish.make +install-prepre: $(tx.dll) +install-pre: install-prepre +install-core: install-pre + @if [ ! -d "$(DESTDIR)$(TCLLIBDIR)" ]; then \ + set -x; $(INSTALL) -d "$(DESTDIR)$(TCLLIBDIR)"; \ fi +# ^^^^ on some platforms, install -d fails if the target already exists. + $(INSTALL) $(tx.dll) "$(DESTDIR)$(TCLLIBDIR)" + $(INSTALL.noexec) pkgIndex.tcl "$(DESTDIR)$(TCLLIBDIR)" +@if TEAISH_PKGINIT_TCL + $(INSTALL.noexec) @TEAISH_PKGINIT_TCL@ "$(DESTDIR)$(TCLLIBDIR)" +@endif +install-test: install-core + @echo 'package require $(tx.pkgName) $(tx.version)' > $@.tcl + @echo "Post-install test of [package require $(tx.pkgName) $(tx.version)]..." + @if $(TCLSH) $@.tcl ; then \ + echo "test passed"; \ + rm -f $@.tcl; \ + else \ + echo "TEST FAILED"; \ + rm -f $@.tcl; \ + exit 1; \ + fi +install-post: install-test +install: install-post -#======================================================================== -# Install binary executables (e.g. .exe files and dependent .dll files) -# This is for files that must go in the bin directory (located next to -# wish and tclsh), like dependent .dll files on Windows. # -# You should not have to modify this target, except to define bin_BINARIES -# above if necessary. -#======================================================================== +# Uninstall rules... +# +.PHONY: uninstall uninstall-pre uninstall-core uninstall-post uninstall-extension +uninstall-extension: # this name is reserved for use by teaish.make +uninstall-pre: +uninstall-core: uninstall-pre + rm -fr "$(DESTDIR)$(TCLLIBDIR)" +uninstall-post: uninstall-core + @echo "Uninstalled Tcl extension $(tx.name) $(tx.version)" +uninstall: uninstall-post -install-bin-binaries: binaries - @$(INSTALL_DATA_DIR) "$(DESTDIR)$(bindir)" - @list='$(bin_BINARIES)'; for p in $$list; do \ - if test -f $$p; then \ - echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p"; \ - $(INSTALL_PROGRAM) $$p "$(DESTDIR)$(bindir)/$$p"; \ - fi; \ - done +Makefile: config.log $(teaish.makefile.in) +@if TEAISH_MAKEFILE +$(tx.makefile): config.log +@endif -.SUFFIXES: .c .$(OBJEXT) +# +# Package archive generation ("dist") rules... +# +@if THEAISH_OUT_OF_EXT_TREE +dist: + @echo "'dist' can only be used from an extension's home dir" 1>&2; \ + echo "In this case: @TEAISH_DIR@" 1>&2; exit 1 +undist: +@else +@if BIN_ZIP +# Temp dir for dist.zip. Must be different than dist.tgz or else +# parallel builds may hose the dist. +teaish__dist.tmp.zip = teaish__dist_zip +# +# Make a distribution zip file... +# +dist.zip.dir = $(tx.name)-$(tx.version) +dist.zip = $(dist.zip.dir).zip +.PHONY: dist.zip dist.zip-core dist.zip-post +#dist.zip-pre: +# We apparently can't add a pre-hook here, even if dist.zip-pre is +# .PHONY, else "make dist" rebuilds the archive each time it's run. +$(dist.zip): $(tx.dist.files) + @rm -fr $(teaish__dist.tmp.zip) + @mkdir -p $(teaish__dist.tmp.zip)/$(dist.zip.dir) + @tar cf $(teaish__dist.tmp.zip)/tmp.tar $(tx.dist.files) + @tar xf $(teaish__dist.tmp.zip)/tmp.tar -C $(teaish__dist.tmp.zip)/$(dist.zip.dir) + @rm -f $(dist.zip.dir)/tmp.tar $(dist.zip) + @cd $(teaish__dist.tmp.zip) && zip -q -r ../$(dist.zip) $(dist.zip.dir) + @rm -fr $(teaish__dist.tmp.zip) + @ls -la $(dist.zip) +dist.zip-core: $(dist.zip) +dist.zip-post: dist.zip-core +dist.zip: dist.zip-post +dist: dist.zip +undist-zip: + rm -f $(dist.zip) +undist: undist-zip +@endif #BIN_ZIP -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) \ - && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status +@if BIN_TAR +# +# Make a distribution tarball... +# +teaish__dist.tmp.tgz = teaish__dist_tgz +dist.tgz.dir = $(tx.name)-$(tx.version) +dist.tgz = $(dist.tgz.dir).tar.gz +.PHONY: dist.tgz dist.tgz-core dist.tgz-post +# dist.tgz-pre: +# see notes in dist.zip +$(dist.tgz): $(tx.dist.files) + @rm -fr $(teaish__dist.tmp.tgz) + @mkdir -p $(teaish__dist.tmp.tgz)/$(dist.tgz.dir) + @tar cf $(teaish__dist.tmp.tgz)/tmp.tar $(tx.dist.files) + @tar xf $(teaish__dist.tmp.tgz)/tmp.tar -C $(teaish__dist.tmp.tgz)/$(dist.tgz.dir) + @rm -f $(dist.tgz.dir)/tmp.tar $(dist.tgz) + @cd $(teaish__dist.tmp.tgz) && tar czf ../$(dist.tgz) $(dist.tgz.dir) + @rm -fr $(teaish__dist.tmp.tgz) + @ls -la $(dist.tgz) +dist.tgz-core: $(dist.tgz) +dist.tgz-post: dist.tgz-core +dist.tgz: dist.tgz-post +dist: dist.tgz +undist-tgz: + rm -f $(dist.tgz) +undist: undist-tgz +@endif #BIN_TAR +@endif #THEAISH_OUT_OF_EXT_TREE -uninstall-binaries: - list='$(lib_BINARIES)'; for p in $$list; do \ - rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \ - done - list='$(PKG_TCL_SOURCES)'; for p in $$list; do \ - p=`basename $$p`; \ - rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \ - done - list='$(bin_BINARIES)'; for p in $$list; do \ - rm -f "$(DESTDIR)$(bindir)/$$p"; \ - done +@if TEAISH_MAKEFILE +# +# tx.makefile defines any extension-specific state this file +# needs. +# +# It must set the following vars if they're not already accounted for +# via teaish.tcl. +# +# - tx.src = list of the extension's source files, being sure to +# prefix each with $(tx.dir) (if it's in the same dir as the +# extension) so that out-of-tree builds can find them. Optionally, +# [define] TEAISH_SRC or pass them to [teaish-add-src]. +# +# It may optionally set the following vars: +# +# - tx.CFLAGS = CFLAGS/CPPFLAGS. Optionally, [define] TEAISH_CFLAGS +# or pass them to [teaish-add-cflags]. +# +# - tx.LDFLAGS = LDFLAGS. Optionally, [define] TEAISH_LDFLAGS or +# pass them to [teaish-add-ldflags]. +# +# It may optionally hook into various targets as documented in +# /doc/extensions.md in the canonical teaish source tree. +@include @TEAISH_MAKEFILE@ +@endif #TEAISH_MAKEFILE -.PHONY: all binaries clean depend distclean doc install libraries test -.PHONY: gdb gdb-test valgrind valgrindshell - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: +@if TEAISH_MAKEFILE_CODE +# +# TEAISH_MAKEFILE_CODE may contain literal makefile code, which +# gets pasted verbatim here. Either [define TEAISH_MAKEFILE_CODE +# ...] or use [teaish-add-make] to incrementally build up this +# content. +# +@TEAISH_MAKEFILE_CODE@ +@endif #TEAISH_MAKEFILE_CODE diff --git a/autoconf/tea/README.txt b/autoconf/tea/README.txt index 05044173f5..28f23a88dd 100644 --- a/autoconf/tea/README.txt +++ b/autoconf/tea/README.txt @@ -1,9 +1,30 @@ -This is the SQLite extension for Tcl using the Tcl Extension -Architecture (TEA). +This is the SQLite extension for Tcl using something akin to +the Tcl Extension Architecture (TEA). To build it: ------------------------ A BETTER WAY --------------------------- + ./configure ...flags... -A better way to build the TCL extension for SQLite is to use the +e.g.: + + ./configure --with-tcl=/path/to/tcl/install/root + +or: + + ./configure --with-tclsh=/path/to/tcl/install/root + +Run ./configure --help for the full list of flags. + +The configuration process will fail if tclConfig.sh cannot be found. + +The makefile will only honor CFLAGS and CPPFLAGS passed to the +configure script, not those directly passed to the makefile. + +Then: + + make test install + +----------------------- THE PREFERRED WAY --------------------------- + +The preferred way to build the TCL extension for SQLite is to use the canonical source code tarball. For Unix: ./configure --with-tclsh=$(TCLSH) diff --git a/autoconf/tea/aclocal.m4 b/autoconf/tea/aclocal.m4 deleted file mode 100644 index 0b057391d2..0000000000 --- a/autoconf/tea/aclocal.m4 +++ /dev/null @@ -1,9 +0,0 @@ -# -# Include the TEA standard macro set -# - -builtin(include,tclconfig/tcl.m4) - -# -# Add here whatever m4 macros you want to define for your package -# diff --git a/autoconf/tea/auto.def b/autoconf/tea/auto.def new file mode 100644 index 0000000000..98b53382b6 --- /dev/null +++ b/autoconf/tea/auto.def @@ -0,0 +1,7 @@ +#/do/not/tclsh +# ^^^ help out editors which guess this file's content type. +# +# Main configure script entry point for the "TEA-via-autosetup" +# framework. +use teaish-core +teaish-configure-core diff --git a/autoconf/tea/autosetup/README.txt b/autoconf/tea/autosetup/README.txt new file mode 100644 index 0000000000..bc0e0b2b3a --- /dev/null +++ b/autoconf/tea/autosetup/README.txt @@ -0,0 +1,4 @@ +The *.tcl files in this directory are part of the SQLite's "autoconf" +bundle which are specific to the TEA(-ish) build. During the tarball +generation process, they are copied into /autoconf/autosetup +(which itself is created earlier in that process). diff --git a/autoconf/tea/autosetup/teaish-core.tcl b/autoconf/tea/autosetup/teaish-core.tcl new file mode 100644 index 0000000000..ecc614e4c0 --- /dev/null +++ b/autoconf/tea/autosetup/teaish-core.tcl @@ -0,0 +1,964 @@ +######################################################################## +# 2025 April 5 +# +# 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. +# +######################################################################## +# ----- @module teaish.tcl ----- +# @section TEA-ish ((TCL Extension Architecture)-ish) +# +# Functions in this file with a prefix of teaish__ are +# private/internal APIs. Those with a prefix of teaish- are +# public APIs. +# +# Teaish has a hard dependency on proj.tcl, and any public API members +# of that module are considered legal for use by teaish extensions. +# +# Project home page: https://fossil.wanderinghorse.net/r/teaish + +use proj + +define TEAISH_VERSION 0.1-beta +use system ; # Will output "Host System" and "Build System" lines +if {"--help" ni $::argv} { + proj-tweak-default-env-dirs + msg-result "Source dir = $::autosetup(srcdir)" + msg-result "Build dir = $::autosetup(builddir)" + msg-result "TEA-ish Version = [get-define TEAISH_VERSION]" +} + +array set teaishConfig [proj-strip-hash-comments { + # set to 1 to enable some internal debugging output + debug-enabled 0 +}] + +# +# Returns true if any arg in $::argv matches the given glob, else +# returns false. +# +proc teaish__argv-has {glob} { + foreach arg $::argv { + if {[string match $glob $arg]} { + return 1 + } + } + return 0 +} + +# +# Main entry point for the TEA-ish configure process. auto.def's primary +# (ideally only) job should be to call this. +# +proc teaish-configure-core {} { + # + # "Declare" some defines for potential later use. + # + foreach f { + TEAISH_MAKEFILE + TEAISH_MAKEFILE_IN + TEAISH_TCL + TEAISH_CFLAGS + TEAISH_LDFLAGS + TEAISH_SRC + TEAISH_DIST_FILES + TEAISH_PKGINIT_TCL + EXTRA_CFLAGS + } { + define $f {} + } + + set gotExt 0; # True if an extension config is found + if {![teaish__argv-has --teaish-create-extension*]} { + set gotExt [teaish__find-extension] + } + + if {$gotExt} { + proj-assert {[file exists [get-define TEAISH_TCL]]} + uplevel 1 { + source [get-define TEAISH_TCL] + } + + if {"" eq [get-define TEAISH_NAME ""]} { + proj-fatal "[get-define TEAISH_TCL] did not define TEAISH_NAME" + } elseif {"" eq [get-define TEAISH_VERSION ""]} { + proj-fatal "[get-define TEAISH_TCL] did not define TEAISH_VERSION" + } + } + + set opts [proj-strip-hash-comments { + with-tcl:DIR + => {Directory containing tclConfig.sh or a directory one level up from + that, from which we can derive a directory containing tclConfig.sh.} + + with-tclsh:PATH + => {Full pathname of tclsh to use. It is used for trying to find + tclConfig.sh. Warning: if its containing dir has multiple tclsh + versions, it may select the wrong tclConfig.sh!} + + # TEA has --with-tclinclude but it appears to only be useful for + # building an extension against an uninstalled copy of TCL's own + # source tree. Either we get that info from tclConfig.sh or we + # give up. + # + # with-tclinclude:DIR + # => {Specify the directory which contains the tcl.h. This should not + # normally be required, as that information comes from tclConfig.sh.} + + # We _generally_ want to reduce the possibility of flag collisions with + # extensions, and thus use a teaish-... prefix on most flags. However, + # --teaish-extension-dir is frequently needed, so... + # + # As of this spontaneous moment, we'll formalize using using + # --t-X-Y to abbreviate teaish flags when doing so is + # unambiguous... + t-e-d: + teaish-extension-dir:DIR + => {Looks for an extension in the given directory instead of the current dir.} + + t-c-e: + teaish-create-extension:TARGET_DIRECTORY + => {Writes stub files for creating an extension. Will refuse to overwrite + existing files without --force.} + + t-f + teaish-force + => {Has a context-dependent meaning (autosetup defines --force for its own use)} + + t-d-d + teaish-dump-defines => {Dump all configure-defined vars to config.defines.txt} + + t-d + teaish-debug => {Enable teaish-specific debug output} + }]; # $opts + + if {[llength [info proc teaish-options]] > 0} { + # teaish-options is assumed to be imported via + # TEAISH_TCL + set o [teaish-options] + if {"" ne $o} { + lappend opts {*}$o + } + } + + #lappend opts "soname:=duplicateEntry => {x}"; #just testing + if {[catch {options $opts} msg xopts]} { + # Workaround for + # where [options] behaves oddly on _some_ TCL builds when it's + # called from deeper than the global scope. + dict incr xopts -level + return {*}$xopts $msg + } + + proj-xfer-options-aliases { + t-c-e => teaish-create-extension + t-d => teaish-debug + t-d-d => teaish-dump-defines + ted => teaish-extension-dir + t-e-d => teaish-extension-dir + t-f => teaish-force + } + + set ::teaishConfig(debug-enabled) [opt-bool teaish-debug] + + if {[proj-opt-was-provided teaish-create-extension]} { + teaish__create-extension [opt-val teaish-create-extension] + return + } + proj-assert {1==$gotExt} "Else we cannot have gotten this far" + + teaish__configure-phase1 +} + + +######################################################################## +# Internal config-time debugging output routine. It is not legal to +# call this from the global scope. +proc teaish-debug {msg} { + if {$::teaishConfig(debug-enabled)} { + puts stderr [proj-bold "** DEBUG: \[[proj-current-scope 1]\]: $msg"] + } +} + +proc teaish__configure-phase1 {} { + + msg-result \ + "Configuring extension [proj-bold [get-define TEAISH_NAME] [get-define TEAISH_VERSION]]..." + + uplevel 1 { + use cc cc-db cc-shared cc-lib; # pkg-config + } + teaish__check-common-bins + + if {"" eq [get-define TEAISH_LIBDIR_NAME]} { + define TEAISH_LIBDIR_NAME [get-define TEAISH_NAME] + } + + teaish__check-tcl + apply {{} { + # + # If --prefix or --exec-prefix are _not_ provided, use their + # TCL_... counterpart from tclConfig.sh. Caveat: by the time we can + # reach this point, autosetup's system.tcl will have already done + # some non-trivial amount of work with these to create various + # derived values from them, so we temporarily end up with a mishmash + # of autotools-compatibility var values. That will be straightened + # out in the final stage of the configure script via + # [proj-remap-autoconf-dir-vars]. + # + foreach {flag uflag tclVar} { + prefix prefix TCL_PREFIX + exec-prefix exec_prefix TCL_EXEC_PREFIX + } { + if {![proj-opt-was-provided $flag]} { + set v [get-define $tclVar "???"] + proj-assert {"???" ne $v} "Expecting teach-check-tcl to have defined $tclVar" + proj-opt-set $flag $v + define $uflag $v + # ^^^ As of here, all autotools-compatibility vars which derive + # from --$flag, e.g. --libdir, still derive from the default + # --$flag value which was active when system.tcl was + # included. So long as those flags are not explicitly passed to + # the configure script, those will be straightened out via + # [proj-remap-autoconf-dir-vars]. + msg-result "Using \$$tclVar for --$flag=$v" + } + } + }}; # --[exec-]prefix defaults + + proj-file-extensions + apply {{} { + set pkgname [get-define TEAISH_NAME] + set pkgver [get-define TEAISH_VERSION] + set libname "lib" + if {[string match *-cygwin [get-define host]]} { + set libname cyg + } + define TEAISH_DLL8_BASENAME $libname$pkgname$pkgver + define TEAISH_DLL9_BASENAME ${libname}tcl9$pkgname$pkgver + set ext [get-define TARGET_DLLEXT] + define TEAISH_DLL8 [get-define TEAISH_DLL8_BASENAME]$ext + define TEAISH_DLL9 [get-define TEAISH_DLL9_BASENAME]$ext + }} + + if {[llength [info proc teaish-configure]] > 0} { + # teaish-options is assumed to be imported via + # TEAISH_TCL + teaish-configure + } + if {[proj-looks-like-windows]} { + # Without this, linking of an extension will not work on Cygwin or + # Msys2. + msg-result "Using USE_TCL_STUBS for Unix(ish)-on-Windows environment" + teaish-add-cflags -DUSE_TCL_STUBS=1 + } + + # + # Ensure we don't have a stale pkgIndex.tcl when rebuilding for different + # --with-tcl=... values. + # + file delete -force pkgIndex.tcl + + define TEAISH_TEST_TCL \ + [join [glob -nocomplain [get-define TEAISH_DIR]/teaish.test.tcl]] + + #define AS_LIBDIR $::autosetup(libdir) + define TEAISH_TESTER_TCL $::autosetup(libdir)/teaish-tester.tcl + teaish__configure-finalize +} + +proc teaish__configure-finalize {} { + + apply {{} { + # Set up TEAISH_DIST_FILES + set df {} + foreach d { + TEAISH_TCL + TEAISH_MAKEFILE_IN + TEAISH_TEST_TCL + TEAISH_PKGINIT_TCL + } { + set x [get-define $d ""] + if {"" ne $x} { + lappend df [file tail $x] + } + } + teaish-add-dist {*}$df + }} + + foreach f { + TEAISH_CFLAGS + TEAISH_LDFLAGS + TEAISH_SRC + TEAISH_DIST_FILES + } { + define $f [join [get-define $f]] + } + + define TEAISH_AUTOSETUP_DIR $::autosetup(libdir) + proj-setup-autoreconfig TEAISH_AUTORECONFIG + proj-dot-ins-append $::autosetup(srcdir)/Makefile.in + proj-dot-ins-append $::autosetup(srcdir)/pkgIndex.tcl.in + proj-dot-ins-append $::autosetup(srcdir)/teaish.tester.tcl.in + + set dotIns [proj-dot-ins-list] + #puts "*** dotIns = $dotIns" + proj-dot-ins-process; # do not [define] after this point + foreach e $dotIns { + proj-validate-no-unresolved-ats [lindex $e 1] + } + + proj-if-opt-truthy teaish-dump-defines { + make-config-header config.defines.txt \ + -str {BIN_* CC LD AR INSTALL LDFLAG*} \ + -bare {HAVE_*} \ + -str {TEAISH_DIST_FILES} \ + -auto {*} + } + + # + # If these are set up before call [options], it triggers an + # "option already defined" error. + # + #proj-opt-set teaish.tcl [get-define ] + #proj-opt-set teaish.make.in [get-define ] + + # + # $::autosetup(builddir)/.configured is a workaround to prevent + # concurrent executions of TEAISH_AUTORECONFIG. MUST come last in + # the configure process. + # + #proj-file-write $::autosetup(builddir)/.configured "" +} + + +######################################################################## +# Run checks for required binaries. +proc teaish__check-common-bins {} { + if {"" eq [proj-bin-define install]} { + proj-warn "Cannot find install binary, so 'make install' will not work." + define BIN_INSTALL false + } + if {"" eq [proj-bin-define zip]} { + proj-warn "Cannot find zip, so 'make dist.zip' will not work." + } + if {"" eq [proj-bin-define tar]} { + proj-warn "Cannot find tar, so 'make dist.tgz' will not work." + } +} + +######################################################################## +# TCL... +# +# teaish__check-tcl performs most of the --with-tcl and --with-tclsh +# handling. Some related bits and pieces are performed before and +# after that function is called. +# +# Important [define]'d vars: +# +# - TCLSH_CMD is the path to the canonical tclsh or "". +# +# - TCL_CONFIG_SH is the path to tclConfig.sh or "". +# +# - TCLLIBDIR is the dir to which the extension library gets +# - installed. +# +proc teaish__check-tcl {} { + define TCLSH_CMD false ; # Significant is that it exits with non-0 + define TCLLIBDIR "" ; # Installation dir for TCL extension lib + define TCL_CONFIG_SH ""; # full path to tclConfig.sh + + # Clear out all vars which would harvest from tclConfig.sh so that + # the late-config validation of @VARS@ works even if --disable-tcl + # is used. + proj-tclConfig-sh-to-autosetup "" + + # TODO: better document the steps this is taking. + set srcdir $::autosetup(srcdir) + msg-result "Checking for a suitable tcl... " + set use_tcl 1 + set with_tclsh [opt-val with-tclsh] + set with_tcl [opt-val with-tcl] + if {0} { + # This misinteracts with the $TCL_PREFIX default: it will use the + # autosetup-defined --prefix default + if {"prefix" eq $with_tcl} { + set with_tcl [get-define prefix] + } + } + teaish-debug "use_tcl ${use_tcl}" + teaish-debug "with_tclsh=${with_tclsh}" + teaish-debug "with_tcl=$with_tcl" + if {"" eq $with_tclsh && "" eq $with_tcl} { + # If neither --with-tclsh nor --with-tcl are provided, try to find + # a workable tclsh. + set with_tclsh [proj-first-bin-of tclsh9.1 tclsh9.0 tclsh8.6 tclsh] + teaish-debug "with_tclsh=${with_tclsh}" + } + + set doConfigLookup 1 ; # set to 0 to test the tclConfig.sh-not-found cases + if {"" ne $with_tclsh} { + # --with-tclsh was provided or found above. Validate it and use it + # to trump any value passed via --with-tcl=DIR. + if {![file-isexec $with_tclsh]} { + proj-fatal "TCL shell $with_tclsh is not executable" + } else { + define TCLSH_CMD $with_tclsh + #msg-result "Using tclsh: $with_tclsh" + } + if {$doConfigLookup && + [catch {exec $with_tclsh $::autosetup(libdir)/find_tclconfig.tcl} result] == 0} { + set with_tcl $result + } + if {"" ne $with_tcl && [file isdir $with_tcl]} { + msg-result "$with_tclsh recommends the tclConfig.sh from $with_tcl" + } else { + proj-warn "$with_tclsh is unable to recommend a tclConfig.sh" + set use_tcl 0 + } + } + set cfg "" + set tclSubdirs {tcl9.1 tcl9.0 tcl8.6 lib} + while {$use_tcl} { + if {"" ne $with_tcl} { + # Ensure that we can find tclConfig.sh under ${with_tcl}/... + if {$doConfigLookup} { + if {[file readable "${with_tcl}/tclConfig.sh"]} { + set cfg "${with_tcl}/tclConfig.sh" + } else { + foreach i $tclSubdirs { + if {[file readable "${with_tcl}/$i/tclConfig.sh"]} { + set cfg "${with_tcl}/$i/tclConfig.sh" + break + } + } + } + } + if {"" eq $cfg} { + proj-fatal "No tclConfig.sh found under ${with_tcl}" + } + } else { + # If we have not yet found a tclConfig.sh file, look in $libdir + # which is set automatically by autosetup or via the --prefix + # command-line option. See + # https://sqlite.org/forum/forumpost/e04e693439a22457 + set libdir [get-define libdir] + if {[file readable "${libdir}/tclConfig.sh"]} { + set cfg "${libdir}/tclConfig.sh" + } else { + foreach i $tclSubdirs { + if {[file readable "${libdir}/$i/tclConfig.sh"]} { + set cfg "${libdir}/$i/tclConfig.sh" + break + } + } + } + if {![file readable $cfg]} { + break + } + } + msg-result "Using tclConfig.sh: $cfg" + break + } + define TCL_CONFIG_SH $cfg + # Export a subset of tclConfig.sh to the current TCL-space. If $cfg + # is an empty string, this emits empty-string entries for the + # various options we're interested in. + proj-tclConfig-sh-to-autosetup $cfg + + if {"" eq $with_tclsh && $cfg ne ""} { + # We have tclConfig.sh but no tclsh. Attempt to locate a tclsh + # based on info from tclConfig.sh. + set tclExecPrefix [get-define TCL_EXEC_PREFIX] + proj-assert {"" ne $tclExecPrefix} + set tryThese [list \ + $tclExecPrefix/bin/tclsh[get-define TCL_VERSION] \ + $tclExecPrefix/bin/tclsh ] + foreach trySh $tryThese { + if {[file-isexec $trySh]} { + set with_tclsh $trySh + break + } + } + if {![file-isexec $with_tclsh]} { + proj-warn "Cannot find a usable tclsh (tried: $tryThese)" + } + } + define TCLSH_CMD $with_tclsh + if {$use_tcl} { + # Set up the TCLLIBDIR + # + # 2024-10-28: calculation of TCLLIBDIR is now done via the shell + # in main.mk (search it for T.tcl.env.sh) so that + # static/hand-written makefiles which import main.mk do not have + # to define that before importing main.mk. Even so, we export + # TCLLIBDIR from here, which will cause the canonical makefile to + # use this one rather than to re-calculate it at make-time. + set tcllibdir [get-env TCLLIBDIR ""] + set extDirName [get-define TEAISH_LIBDIR_NAME] + if {"" eq $tcllibdir} { + # Attempt to extract TCLLIBDIR from TCL's $auto_path + if {"" ne $with_tclsh && + [catch {exec echo "puts stdout \$auto_path" | "$with_tclsh"} result] == 0} { + foreach i $result { + if {[file isdir $i]} { + set tcllibdir $i/$extDirName + break + } + } + } else { + proj-fatal "Cannot determine TCLLIBDIR." + } + } + define TCLLIBDIR $tcllibdir + }; # find TCLLIBDIR + + if {[file-isexec $with_tclsh]} { + msg-result "Using tclsh: $with_tclsh" + if {$cfg ne ""} { + define HAVE_TCL 1 + } else { + proj-warn "Found tclsh but no tclConfig.sh." + } + } + show-notices + # If TCL is not found: if it was explicitly requested then fail + # fatally, else just emit a warning. If we can find the APIs needed + # to generate a working JimTCL then that will suffice for build-time + # TCL purposes (see: proc sqlite-determine-codegen-tcl). + if {![file-isexec $with_tclsh]} { + proj-fatal "Did not find tclsh" + } elseif {"" eq $cfg} { + proj-indented-notice -error { + Cannot find a usable tclConfig.sh file. Use + --with-tcl=DIR to specify a directory where tclConfig.sh can be + found. + } + } +}; # teaish-check-tcl + +# +# Searches $::argv and/or the build dir and/or the source dir for +# teaish.make and teaish.tcl. Fails if it cannot find one of +# them. If it returns 0 then it did not find an extension but the +# --help flag was seen, in which case that's not an error. +# +proc teaish__find-extension {} { + + msg-result "Looking for teaish extension..." + # + # We have to handle some flags manually because the extension must + # be loaded before [options] is run (so that the extension can + # inject its own options). + # + set largv {}; # rewritten $::argv + set extM ""; # teaish.make.in + set extT ""; # teaish.tcl + set lambdaM {{f} { + if {[file isdir $f]} { + set f [file join $f teaish.make.in] + } + if {[file readable $f]} { + return [file normalize $f] + } + return "" + }} + set lambdaT {{f} { + if {[file isdir $f]} { + set f [file join $f teaish.tcl] + } + if {![file readable $f]} { + proj-fatal "extension tcl file is not readable: $f" + } + return [file normalize $f] + }} +# set gotNonFlag 0 + foreach arg $::argv { + #puts "*** arg=$arg" + switch -glob -- $arg { + --ted=* - + --t-e-d=* - + --teaish-extension-dir=* { + regexp -- {--[^=]+=(.+)} $arg - extD + set extD [file normalize $extD] + if {![file isdir $extD]} { + proj-fatal "--teaish-extension-dir value is not a directory: $extD" + } + set extM [apply $lambdaM [file join $extD teaish.make.in]] + set extT [apply $lambdaT [file join $extD teaish.tcl]] + define TEAISH_DIR $extD + } + default { + # We'd like to treat the first non-flag argument as + # --teaish-extension-dir, but autosetup does not accept args + # except in the form --flag or X=Y + lappend largv $arg +# +# --* { +# lappend largv $arg +# } +# default { +# if {$gotNonFlag || "" ne $extT} { +# lappend largv $arg +# } else { +# incr gotNonFlag +# msg-checking "Treating fist non-flag argument as --teaish-extension-dir ... " +# if {[catch [set extD [file normalize $arg]]]} { +# msg-result "dir name not normalizable: $arg" +# lappend largv $arg +# } else { +# set extM [apply $lambdaM [file join $arg teaish.make.in]] +# set extT [apply $lambdaT [file join $arg teaish.tcl]] +# define TEAISH_DIR $extD +# msg-result "$arg" +# } +# } +# } + } + } + } + set ::argv $largv + set dbld $::autosetup(builddir) + set dsrc $::autosetup(srcdir) + set dext [get-define TEAISH_DIR $::autosetup(builddir)] + + # + # teaish.tcl is a TCL script which implements various + # interfaces described by this framework. + # + # We use the first one we find in the builddir or srcdir. + # + if {"" eq $extT} { + set flist [list $dext/teaish.tcl];# $dsrc/teaish.tcl] + if {![proj-first-file-found $flist extT]} { + if {"--help" in $::argv} { + return 0 + } + proj-indented-notice -error " +Did not find any of: $flist + +If you are attempting an out-of-tree build, be sure to +use --teaish-extension-dir=/path/to/extension" + } + } + if {![file readable $extT]} { + proj-fatal "extension tcl file is not readable: $extT" + } + msg-result "Extension config = $extT" + define TEAISH_TCL $extT + if {"" eq [get-define TEAISH_DIR ""]} { + # If this wasn't set via --teaish.dir then derive it from + # --teaish.tcl. + #puts "extT=$extT" + define TEAISH_DIR [file dirname $extT] + } + + # + # teaish.make provides some of the info for the main makefile, + # like which source(s) to build and their build flags. + # + # We use the first one of teaish.make.in we find in either + # the builddir or the srcdir. + # + if {"" eq $extM} { + set flist [list $dext/teaish.make.in];# $dsrc/teaish.make.in] + proj-first-file-found $flist extM + } + if {"" ne $extM && [file readable $extM]} { + define TEAISH_MAKEFILE_IN $extM + define TEAISH_MAKEFILE [file rootname [file tail $extM]] + proj-dot-ins-append $extM [get-define TEAISH_MAKEFILE] + msg-result "Extension makefile = $extM" + } else { + define TEAISH_MAKEFILE_IN "" + define TEAISH_MAKEFILE "" + #proj-warn "Did not find an teaish.make.in." + } + + set extI $dext/teaish.pkginit.tcl + if {[file exists $extI]} { + define TEAISH_PKGINIT_TCL $extI + msg-result "Extension post-load init = $extI" + #teaish-add-install $extI + } + + # + # Set some sane defaults... + # + define TEAISH_NAME [file tail [file dirname $extT]] + define TEAISH_PKGNAME [get-define TEAISH_NAME] + define TEAISH_LIBDIR_NAME [get-define TEAISH_PKGNAME] + define TEAISH_VERSION 0.0.0 + + # THEAISH_OUT_OF_EXT_TREE = 1 if we're building from a dir other + # than the extension's home dir. + define THEAISH_OUT_OF_EXT_TREE \ + [expr {[file normalize $::autosetup(builddir)] ne [file-normalize [get-define TEAISH_DIR]]}] + + # + # Defines which extensions may optionally make but are not required + # to. + # + foreach {optionalDef dflt} [subst { + TEAISH_LOAD_PREFIX "[string totitle [get-define TEAISH_PKGNAME]]" + TEAISH_MAKEFILE_CODE "" + }] { + define $optionalDef $dflt + } + return 1 +} + +# Internal helper to append $args to [define-append] $def +proc teaish__append_stuff {def args} { + foreach a $args { + if {"" ne $a} { + define-append $def {*}$a + } + } +} + +# @teaish-add-cflags cflags... +# Appends all non-empty $args to TEAISH_CFLAGS +proc teaish-add-cflags {args} { + teaish__append_stuff TEAISH_CFLAGS {*}$args +} + +# @teaish-add-cflags ?-p|-prepend? ldflags... +# +# Appends all non-empty $args to TEAISH_LDFLAGS unless the first +# argument is one of (-p | -prepend), in which case it prepends all +# arguments, in their given order, to TEAISH_LDFLAGS. +# +# Typically, -lXYZ flags need to be in "reverse" order, with each -lY +# resolving symbols for -lX's to its left. This order is largely +# historical, and not relevant on all environments, but it is +# technically correct and still relevant on some environments. +# +# See: teaish-prepend-ldflags +proc teaish-add-ldflags {args} { + if {[lindex $args 0] in {-p -prepend}} { + set args [lassign $args -] + lappend args {*}[get-define TEAISH_LDFLAGS ""] + define TEAISH_LDFLAGS [join $args]; # join to eliminate {} entries + } else { + teaish__append_stuff TEAISH_LDFLAGS {*}$args + } +} + +# @teaish-prepend-ldflags args... +# +# Functionally equivalent to [teaish-add-ldflags -p {*}$args] +proc teaish-prepend-ldflags {args} { + teaish-add-ldflags -p {*}$args +} + +# @teaish-add-cflags ?-dist? ?-dir? src-files... +# +# Appends all non-empty $args to TEAISH_SRC. +# +# If passed -dist then it also passes each filename, as-is, to +# [teaish-add-dist]. +# +# If passed -dir then each src-file has the TEAISH_DIR prepended to +# it for before they're added to TEAISH_SRC. As often as not, that +# will be the desired behavior so that out-of-tree builds can find the +# sources, but there are cases where it's not desired (e.g. when using +# a source file from outside of the extension's dir). +proc teaish-add-src {args} { + set dist 0 + set xdir 0 + set i 0 + foreach arg $args { + switch -exact -- $arg { + -dist { + set dist 1 + set args [lassign $args -] + } + -dir { + set xdir 1 + set args [lassign $args -] + } + default { + #lappend xargs $arg + break; + } + } + } + if {$dist} { + teaish-add-dist {*}$args + } + if {$xdir} { + set xargs {} + set d [get-define TEAISH_DIR] + foreach arg $args { + lappend xargs $d/$arg + } + set args $xargs + } + teaish__append_stuff TEAISH_SRC {*}$args +} + +# @teaish-add-dist files-or-dirs... +# Appends all non-empty $args to TEAISH_DIST_FILES +proc teaish-add-dist {args} { + teaish__append_stuff TEAISH_DIST_FILES {*}$args +} + +# teaish-add-install files... +# Appends all non-empty $args to TEAISH_INSTALL_FILES +#proc teaish-add-install {args} { +# teaish__append_stuff TEAISH_INSTALL_FILES {*}$args +#} + +# @teash-append-make args... +# +# Appends makefile code to the TEAISH_MAKEFILE_CODE define. Each +# arg may be any of: +# +# -tab: emit a literal tab +# -nl: emit a literal newline +# -nltab: short for -nl -tab +# -eol: emit a backslash-escaped end-of-line +# -eoltab: short for -eol -tab +# +# Anything else is appended verbatim. This function adds no additional +# spacing between each argument nor between subsequent invocations. +# +proc teaish-add-make {args} { + set out [get-define TEAISH_MAKEFILE_CODE ""] + foreach a $args { + switch -exact -- $a { + -eol { set a " \\\n" } + -eoltab { set a " \\\n\t" } + -tab { set a "\t" } + -nl { set a "\n" } + -nltab { set a "\n\t" } + } + append out $a + } + define TEAISH_MAKEFILE_CODE $out +} + +# @teaish-make-config-header filename +# +# Invokes autosetup's [make-config-header] and passes it $filename and +# a relatively generic list of options for controlling which defined +# symbols get exported. Clients which need more control over the +# exports can copy/paste/customize this. +# +# The exported file is then passed to [proj-touch] because, in +# practice, that's sometimes necessary to avoid build dependency +# issues. +proc teaish-make-config-header {filename} { + make-config-header $filename \ + -bare {} \ + -none {HAVE_CFLAG_* LDFLAGS_* SH_*} \ + -auto {SIZEOF_* HAVE_* TEAISH_* TCL_*} \ + -none * + proj-touch $filename; # help avoid frequent unnecessary auto-reconfig +} + +# internal cache for feature checks. +array set teaish__fCache {} + +# @teaish-feature-cache-set ?$depth? value +# +# Sets a feature-check cache entry with a key equal to +# [proj-current-scope [expr {$depth+1}]] and the given value. +proc teaish-feature-cache-set {{depth 0} val} { + array set ::teaish__fCache [list [proj-current-scope [expr {$depth + 1}]] $val] + return $val +} + +# @teaish-feature-cache-check ?$depth? tgtVarName +# +# If the feature-check cache has an entry named [proj-current-scope +# [expr {$depth+1}]] this function assigns its value to tgtVar and +# returns 1, else it assigns tgtVar to "" and returns 0. +# +proc teaish-feature-cache-check {{depth 0} tgtVar} { + upvar $tgtVar tgt + set scope [proj-current-scope [expr {$depth + 1}]] + if {[info exists ::teaish__fCache($scope)]} { + set tgt $::teaish__fCache($scope) + return 1 + } + set tgtVar "" + return 0 +} + + +# +# Handles --teaish-create-extension=TARGET-DIR +# +proc teaish__create-extension {dir} { + set force [opt-bool teaish-force] + file mkdir $dir + set cwd [pwd] + set dir [file normalize [file join $cwd $dir]] + msg-result "Created dir $dir" + cd $dir + set flist {teaish.tcl} + foreach f $flist { + if {!$force && [file exists $f]} { + error "Cowardly refusing to overwrite $dir/$f. Use --teaish-force to overwrite." + } + } + + set name [file tail $dir] + set pkgName $name + set version 0.0.1 + set loadPrefix [string totitle $pkgName] + set content "define TEAISH_NAME ${name} +define TEAISH_VERSION ${version} +# define TEAISH_PKGNAME ${pkgName} +# define TEAISH_LIBDIR_NAME ${name} +define TEAISH_LOAD_PREFIX ${loadPrefix} +proc teaish-options {} {} +proc teaish-configure {} { + set d \[get-define TEAISH_DIR] + teaish-add-src \$d/teaish.c + teaish-add-dist teaish.c +} +" + proj-file-write teaish.tcl $content + msg-result "Created teaish.tcl" + + set content [subst -nocommands -nobackslashes { +#include +static int +${loadPrefix}_Cmd(ClientData cdata, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]){ + Tcl_SetObjResult(interp, Tcl_NewStringObj("this is the ${name} extension", -1)); + return TCL_OK; +} + +extern int DLLEXPORT ${loadPrefix}_Init(Tcl_Interp *interp){ + if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) { + return TCL_ERROR; + } + if (Tcl_PkgProvide(interp, "${name}", "${version}") == TCL_ERROR) { + return TCL_ERROR; + } + Tcl_CreateObjCommand(interp, "${name}", ${loadPrefix}_Cmd, NULL, NULL); + return TCL_OK; +} +}] + proj-file-write teaish.c $content + msg-result "Created teaish.c" + + set content "# teaish makefile for the ${name} extension +# tx.src = \$(tx.dir)/teaish.c +# tx.LDFLAGS = +# tx.CFLAGS = +" + proj-file-write teaish.make.in $content + msg-result "Created teaish.make.in" + + msg-result "Created new extension $name in \[$dir]" + + cd $cwd +} diff --git a/autoconf/tea/autosetup/teaish-feature-tests.tcl b/autoconf/tea/autosetup/teaish-feature-tests.tcl new file mode 100644 index 0000000000..fe5464151f --- /dev/null +++ b/autoconf/tea/autosetup/teaish-feature-tests.tcl @@ -0,0 +1,279 @@ +######################################################################## +# 2025 April 7 +# +# 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. +# +######################################################################## +# ----- @module teaish-checks.tcl ----- +# @section TEA-ish collection of feature tests. +# +# Functions in this file with a prefix of teaish__ are +# private/internal APIs. Those with a prefix of teaish- are +# public APIs. + +use pkg-config + +# @teaish-check-cached@ ?-flags? msg script +# +# Under construction. +# +# A proxy for feature-test impls which handles chacheing of the +# feature flag check on a per-caller basis, using the calling scope's +# name as the cache key. +# +# The test is performed by $script. This function caches the result +# and checks for a chache hit before running $script. The value stored +# in the cache is the final value of $script (and this routine will +# intercept a 'return' from $script). +# +# Flags: +# +# -nostatus = do not emit "ok" or "no" at the end. This presumes +# that the caller will emit a newline before turning. +proc teaish-check-cached {args} { + set quiet 0 + set xargs {} + foreach arg $args { + switch -exact -- $arg { + -nostatus { + incr quiet + } + default { + lappend xargs $arg + } + } + } + lassign $xargs msg script + if {"" eq $msg} { + set msg [proj-current-scope 1] + } + if {[teaish-feature-cache-check 1 check]} { + msg-checking "${msg} ... (cached) " + if {$check} {msg-result "ok"} else {msg-result "no"} + return $check + } else { + msg-checking "${msg} ... " + set code [catch {uplevel 1 $script} rc xopt] + #puts "***** ::teaish__fCache ="; parray ::teaish__fCache + if {$code in {0 2}} { + teaish-feature-cache-set 1 $rc + if {!$quiet} { + if {$rc} { + msg-result "ok" + } else { + msg-result "no" + } + } + #puts "**** code=$code rc=$rc xopt=$xopt" + } else { + return -options $xopt $rc + } + } +} + + +# @teaish-check-libz +# +# Checks for zlib.h and the function deflate in libz. If found, +# prepends -lz to the extension's ldflags and returns 1, else returns +# 0. It also defines LDFLAGS_LIBZ to the libs flag. +# +proc teaish-check-libz {} { + teaish-check-cached "Checking for libz" { + set rc 0 + if {[msg-quiet cc-check-includes zlib.h] && [msg-quiet proj-check-function-in-lib deflate z]} { + teaish-prepend-ldflags [define LDFLAGS_LIBZ [get-define lib_deflate]] + undefine lib_deflate + incr rc + } + expr $rc + } +} + +# @teaish-check-librt ?funclist? +# +# Checks whether -lrt is needed for any of the given functions. If +# so, appends -lrt via [teaish-prepend-ldflags] and returns 1, else +# returns 0. It also defines LDFLAGS_LIBRT to the libs flag or an +# empty string. +# +# Some systems (ex: SunOS) require -lrt in order to use nanosleep. +# +proc teaish-check-librt {{funclist {fdatasync nanosleep}}} { + teaish-check-cached -nostatus "Checking whether ($funclist) need librt" { + define LDFLAGS_LIBRT "" + foreach func $funclist { + if {[msg-quiet proj-check-function-in-lib $func rt]} { + set ldrt [get-define lib_${func}] + undefine lib_${func} + if {"" ne $ldrt} { + teaish-prepend-ldflags -r [define LDFLAGS_LIBRT $ldrt] + msg-result $ldrt + return 1 + } else { + msg-result "no lib needed" + return 1 + } + } + } + msg-result "not found" + return 0 + } +} + +# @teaish-check-stdint +# +# A thin proxy for [cc-with] which checks for and the +# various fixed-size int types it declares. It defines HAVE_STDINT_T +# to 0 or 1 and (if it's 1) defines HAVE_XYZ_T for each XYZ int type +# to 0 or 1, depending on whether its available. +proc teaish-check-stdint {} { + teaish-check-cached "Checking for stdint.h" { + msg-quiet cc-with {-includes stdint.h} \ + {cc-check-types int8_t int16_t int32_t int64_t intptr_t \ + uint8_t uint16_t uint32_t uint64_t uintptr_t} + } +} + +# @teaish-is-mingw +# +# Returns 1 if building for mingw, else 0. +proc teaish-is-mingw {} { + return [expr { + [string match *mingw* [get-define host]] && + ![file exists /dev/null] + }] +} + +# @teaish-check-libdl +# +# Checks for whether dlopen() can be found and whether it requires -ldl +# for linking. If found, returns 1, defines LDFLAGS_DLOPEN to the linker flags +# (if any), and passes those flags to teaish-prepend-ldflags. +proc teaish-check-dlopen {} { + teaish-check-cached -nostatus "Checking for dlopen()" { + set rc 0 + set lfl "" + if {[cc-with {-includes dlfcn.h} { + cctest -link 1 -declare "extern char* dlerror(void);" -code "dlerror();"}]} { + msg-result "-ldl not needed" + incr rc + } elseif {[cc-check-includes dlfcn.h]} { + incr rc + if {[cc-check-function-in-lib dlopen dl]} { + set lfl [get-define lib_dlopen] + undefine lib_dlopen + msg-result " dlopen() needs $lfl" + } else { + msg-result " - dlopen() not found in libdl. Assuming dlopen() is built-in." + } + } else { + msg-result "not found" + } + teaish-prepend-ldflags [define LDFLAGS_DLOPEN $lfl] + define HAVE_DLOPEN $rc + } +} + +######################################################################## +# Handles the --enable-math flag. +proc teaish-check-libmath {} { + teaish-check-cached "Checking for libc math library" { + set lfl "" + set rc 0 + if {[msg-quiet proj-check-function-in-lib ceil m]} { + incr rc + set lfl [get-define lib_ceil] + undefine lib_ceil + teaish-prepend-ldflags $lfl + msg-checking "$lfl " + } + define LDFLAGS_LIBMATH $lfl + expr $rc + } +} + + +# @teaish-check-pkg-config-libssl +# +# Returns 1 if libssl is found via pkg-config, else 0. If found, +# passes its link flags to teaish-prepend-ldflags. Defines LDFLAGS_SSL +# to the linker flags, if found, else "". +# +# If it returns true, the underlying pkg-config test will set several +# defines named PKG_LIBSSL_... (see the docs for [pkg-config] for +# details). +proc teaish-check-pkg-config-libssl {} { + teaish-check-cached -nostatus "Checking for libssl via pkg-config" { + msg-result "Looking for libssl ..." + set lfl {} + set rc 0 + if {[msg-quiet pkg-config-init 0] && [msg-quiet pkg-config libssl]} { + lappend lfl [get-define PKG_LIBSSL_LDFLAGS] \ + [get-define PKG_LIBSSL_LIBS] + incr rc + } else { + # TODO: port over the more elaborate checks from fossil. + } + if {$rc} { + set lfl [string trim [join $lfl]] + define LDFLAGS_SSL $lfl + teaish-prepend-ldflags $lfl + } + define HAVE_LIBSSL $rc + return [teaish-feature-cache-set $rc] + } +} + +# Under construction +# +# Helper for OpenSSL checking +proc teaish__check-openssl {msg {cflags {}} {libs {-lssl -lcrypto -lpthread}}} { + msg-checking "Checking for $msg..." + set rc 0 + set isMinGw [teaish-is-mingw] + if {$isMinGw} { + lappend libs -lgdi32 -lwsock32 -lcrypt32 + } + if {[teaish-check-libz]} { + lappend libs [get-define LDFLAGS_LIBZ] + } + msg-quiet cc-with [list -cflags $cflags -libs $libs] { + if {[cc-check-includes openssl/ssl.h] && \ + [cc-check-functions SSL_new]} { + incr rc + } + } + # TODO + if {!$rc && !$isMinGw} { + # On some systems, OpenSSL appears to require -ldl to link. + if {[teaish-check-dlopen]} { + lappend libs [get-define LDFLAGS_DLOPEN ""] + msg-quiet cc-with [list -cflags $cflags -libs $libs] { + if {[cc-check-includes openssl/ssl.h] && \ + [cc-check-functions SSL_new]} { + incr rc + } + } + } + } + if {$rc} { + msg-result "ok" + } else { + msg-result "no" + } + return $rc +} + +# Under construction +proc teaish-check-libssl {} { + # Goal: port in fossil's handle-with-openssl. It's a bit of a beast. + if {![teaish-check-pkg-config-libssl]} { + #teaish__check-openssl + } +} diff --git a/autoconf/tea/autosetup/teaish-tester.tcl b/autoconf/tea/autosetup/teaish-tester.tcl new file mode 100644 index 0000000000..7e50394842 --- /dev/null +++ b/autoconf/tea/autosetup/teaish-tester.tcl @@ -0,0 +1,103 @@ +######################################################################## +# 2025 April 5 +# +# 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. +# +######################################################################## +# +# Helper routines for running automated tests on teaish extensions +# +######################################################################## +# ----- @module teaish-tester.tcl ----- +# @section TEA-ish Testing APIs + +######################################################################## +# @test-current-scope ?lvl? +# +# Returns the name of the _calling_ proc from ($lvl + 1) levels up the +# call stack (where the caller's level will be 1 up from _this_ +# call). If $lvl would resolve to global scope "global scope" is +# returned and if it would be negative then a string indicating such +# is returned (as opposed to throwing an error). +proc test-current-scope {{lvl 0}} { + #uplevel [expr {$lvl + 1}] {lindex [info level 0] 0} + set ilvl [info level] + set offset [expr {$ilvl - $lvl - 1}] + if { $offset < 0} { + return "invalid scope ($offset)" + } elseif { $offset == 0} { + return "global scope" + } else { + return [lindex [info level $offset] 0] + } +} + +proc test-msg {args} { + puts "{*}$args" +} + +######################################################################## +# @test-error msg +# +# Emits an error message to stderr and exits with non-0. +proc test-fail {msg} { + #puts stderr "ERROR: \[[test-current-scope 1]]: $msg" + #exit 1 + error "ERROR: \[[test-current-scope 1]]: $msg" +} + +######################################################################## +# @assert script ?message? +# +# Kind of like a C assert: if uplevel (eval) of [expr {$script}] is +# false, a fatal error is triggered. The error message, by default, +# includes the body of the failed assertion, but if $msg is set then +# that is used instead. +proc assert {script {msg ""}} { + set x "expr \{ $script \}" + if {![uplevel 1 $x]} { + if {"" eq $msg} { + set msg $script + } + test-fail "Assertion failed in \[[test-current-scope 1]]: $msg" + } +} + +######################################################################## +# @test-expect testId script result +# +# Runs $script in the calling scope and compares its result to +# $result. If they differ, it triggers an [assert]. +proc test-expect {testId script result} { + puts "test $testId" + set x [uplevel 1 $script] + assert {$x eq $result} "\nEXPECTED: <<$result>>\nGOT: <<$x>>" +} + +######################################################################## +# @test-assert testId script ?msg? +# +# Works like [assert] but emits $testId to stdout first. +proc test-assert {testId script {msg ""}} { + puts "test $testId" + assert $script $msg +} + +######################################################################## +# @test-catch cmd ?...args? +# +# Runs [cmd ...args], repressing any exception except to possibly log +# the failure. +proc test-catch {cmd args} { + if {[catch { + $cmd {*}$args + } rc xopts]} { + puts "[test-current-scope] ignoring failure of: $cmd [lindex $args 0]" + #how to extract just the message text from $xopts? + } +} diff --git a/autoconf/tea/configure b/autoconf/tea/configure new file mode 100755 index 0000000000..82751815f9 --- /dev/null +++ b/autoconf/tea/configure @@ -0,0 +1,4 @@ +#!/bin/sh +dir="`dirname "$0"`/../autosetup" +# This is the case ^^^^^^^^^^^^ in the SQLite "autoconf" bundle. +WRAPPER="$0"; export WRAPPER; exec "`"$dir/autosetup-find-tclsh"`" "$dir/autosetup" "$@" diff --git a/autoconf/tea/configure.ac.in b/autoconf/tea/configure.ac.in deleted file mode 100644 index 95688b7c99..0000000000 --- a/autoconf/tea/configure.ac.in +++ /dev/null @@ -1,227 +0,0 @@ -#!/bin/bash -norc -dnl This file is an input file used by the GNU "autoconf" program to -dnl generate the file "configure", which is run during Tcl installation -dnl to configure the system for the local environment. - -#----------------------------------------------------------------------- -# Sample configure.ac for Tcl Extensions. The only places you should -# need to modify this file are marked by the string __CHANGE__ -#----------------------------------------------------------------------- - -#----------------------------------------------------------------------- -# __CHANGE__ -# Set your package name and version numbers here. -# -# This initializes the environment with PACKAGE_NAME and PACKAGE_VERSION -# set as provided. These will also be added as -D defs in your Makefile -# so you can encode the package version directly into the source files. -# This will also define a special symbol for Windows (BUILD_ -# so that we create the export library with the dll. -#----------------------------------------------------------------------- - -AC_INIT([sqlite],[@VERSION@]) - -#-------------------------------------------------------------------- -# Call TEA_INIT as the first TEA_ macro to set up initial vars. -# This will define a ${TEA_PLATFORM} variable == "unix" or "windows" -# as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE. -#-------------------------------------------------------------------- - -TEA_INIT() - -AC_CONFIG_AUX_DIR(tclconfig) - -#-------------------------------------------------------------------- -# Load the tclConfig.sh file -#-------------------------------------------------------------------- - -TEA_PATH_TCLCONFIG -TEA_LOAD_TCLCONFIG - -#-------------------------------------------------------------------- -# Load the tkConfig.sh file if necessary (Tk extension) -#-------------------------------------------------------------------- - -#TEA_PATH_TKCONFIG -#TEA_LOAD_TKCONFIG - -#----------------------------------------------------------------------- -# Handle the --prefix=... option by defaulting to what Tcl gave. -# Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER. -#----------------------------------------------------------------------- - -TEA_PREFIX - -#----------------------------------------------------------------------- -# Standard compiler checks. -# This sets up CC by using the CC env var, or looks for gcc otherwise. -# This also calls AC_PROG_CC and a few others to create the basic setup -# necessary to compile executables. -#----------------------------------------------------------------------- - -TEA_SETUP_COMPILER - -#----------------------------------------------------------------------- -# __CHANGE__ -# Specify the C source files to compile in TEA_ADD_SOURCES, -# public headers that need to be installed in TEA_ADD_HEADERS, -# stub library C source files to compile in TEA_ADD_STUB_SOURCES, -# and runtime Tcl library files in TEA_ADD_TCL_SOURCES. -# This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS -# and PKG_TCL_SOURCES. -#----------------------------------------------------------------------- - -TEA_ADD_SOURCES([tclsqlite3.c]) -TEA_ADD_HEADERS([]) -TEA_ADD_INCLUDES([]) -TEA_ADD_LIBS([]) -TEA_ADD_CFLAGS([-DSQLITE_ENABLE_FTS3=1]) -TEA_ADD_CFLAGS([-DSQLITE_ENABLE_FTS4=1]) -TEA_ADD_CFLAGS([-DSQLITE_ENABLE_FTS5=1]) -TEA_ADD_CFLAGS([-DSQLITE_3_SUFFIX_ONLY=1]) -TEA_ADD_CFLAGS([-DSQLITE_ENABLE_RTREE=1]) -TEA_ADD_CFLAGS([-DSQLITE_ENABLE_GEOPOLY=1]) -TEA_ADD_CFLAGS([-DSQLITE_ENABLE_MATH_FUNCTIONS=1]) -TEA_ADD_CFLAGS([-DSQLITE_ENABLE_DESERIALIZE=1]) -TEA_ADD_CFLAGS([-DSQLITE_ENABLE_DBPAGE_VTAB=1]) -TEA_ADD_CFLAGS([-DSQLITE_ENABLE_BYTECODE_VTAB=1]) -TEA_ADD_CFLAGS([-DSQLITE_ENABLE_DBSTAT_VTAB=1]) -TEA_ADD_STUB_SOURCES([]) -TEA_ADD_TCL_SOURCES([]) - -#-------------------------------------------------------------------- -# The --with-system-sqlite causes the TCL bindings to SQLite to use -# the system shared library for SQLite rather than statically linking -# against its own private copy. This is dangerous and leads to -# undesirable dependences and is not recommended. -# Patchs from rmax. -#-------------------------------------------------------------------- -AC_ARG_WITH([system-sqlite], - [AS_HELP_STRING([--with-system-sqlite], - [use a system-supplied libsqlite3 instead of the bundled one])], - [], [with_system_sqlite=no]) -if test x$with_system_sqlite != xno; then - AC_CHECK_HEADER([sqlite3.h], - [AC_CHECK_LIB([sqlite3],[sqlite3_initialize], - [AC_DEFINE(USE_SYSTEM_SQLITE) - LIBS="$LIBS -lsqlite3"])]) -fi - -#-------------------------------------------------------------------- -# __CHANGE__ -# -# You can add more files to clean if your extension creates any extra -# files by extending CLEANFILES. -# Add pkgIndex.tcl if it is generated in the Makefile instead of ./configure -# and change Makefile.in to move it from CONFIG_CLEAN_FILES to BINARIES var. -# -# A few miscellaneous platform-specific items: -# TEA_ADD_* any platform specific compiler/build info here. -#-------------------------------------------------------------------- - -#CLEANFILES="$CLEANFILES pkgIndex.tcl" -if test "${TEA_PLATFORM}" = "windows" ; then - # Ensure no empty if clauses - : - #TEA_ADD_SOURCES([win/winFile.c]) - #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"]) -else - # Ensure no empty else clauses - : - #TEA_ADD_SOURCES([unix/unixFile.c]) - #TEA_ADD_LIBS([-lsuperfly]) -fi - -#-------------------------------------------------------------------- -# __CHANGE__ -# Choose which headers you need. Extension authors should try very -# hard to only rely on the Tcl public header files. Internal headers -# contain private data structures and are subject to change without -# notice. -# This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG -#-------------------------------------------------------------------- - -TEA_PUBLIC_TCL_HEADERS -#TEA_PRIVATE_TCL_HEADERS - -#TEA_PUBLIC_TK_HEADERS -#TEA_PRIVATE_TK_HEADERS -#TEA_PATH_X - -#-------------------------------------------------------------------- -# Check whether --enable-threads or --disable-threads was given. -# This auto-enables if Tcl was compiled threaded. -#-------------------------------------------------------------------- - -TEA_ENABLE_THREADS -if test "${TCL_THREADS}" = "1" ; then - AC_DEFINE(SQLITE_THREADSAFE, 1, [Trigger sqlite threadsafe build]) - # Not automatically added by Tcl because its assumed Tcl links to them, - # but it may not if it isn't really a threaded build. - TEA_ADD_LIBS([$THREADS_LIBS]) -else - AC_DEFINE(SQLITE_THREADSAFE, 0, [Trigger sqlite non-threadsafe build]) -fi - -#-------------------------------------------------------------------- -# The statement below defines a collection of symbols related to -# building as a shared library instead of a static library. -#-------------------------------------------------------------------- - -TEA_ENABLE_SHARED - -#-------------------------------------------------------------------- -# This macro figures out what flags to use with the compiler/linker -# when building shared/static debug/optimized objects. This information -# can be taken from the tclConfig.sh file, but this figures it all out. -#-------------------------------------------------------------------- - -TEA_CONFIG_CFLAGS - -#-------------------------------------------------------------------- -# Set the default compiler switches based on the --enable-symbols option. -#-------------------------------------------------------------------- - -TEA_ENABLE_SYMBOLS - -#-------------------------------------------------------------------- -# This macro generates a line to use when building a library. It -# depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS, -# and TEA_LOAD_TCLCONFIG macros above. -#-------------------------------------------------------------------- - -TEA_MAKE_LIB - -#-------------------------------------------------------------------- -# Determine the name of the tclsh and/or wish executables in the -# Tcl and Tk build directories or the location they were installed -# into. These paths are used to support running test cases only, -# the Makefile should not be making use of these paths to generate -# a pkgIndex.tcl file or anything else at extension build time. -#-------------------------------------------------------------------- - -TEA_PROG_TCLSH -#TEA_PROG_WISH - -#-------------------------------------------------------------------- -# Setup a *Config.sh.in configuration file. -#-------------------------------------------------------------------- - -#TEA_EXPORT_CONFIG([sample]) -#AC_SUBST(SAMPLE_VAR) - -#-------------------------------------------------------------------- -# Specify files to substitute AC variables in. You may alternatively -# have a special pkgIndex.tcl.in or other files which require -# substituting the AC variables in. Include these here. -#-------------------------------------------------------------------- - -AC_CONFIG_FILES([Makefile pkgIndex.tcl]) -#AC_CONFIG_FILES([sampleConfig.sh]) - -#-------------------------------------------------------------------- -# Finally, substitute all of the various values into the files -# specified with AC_CONFIG_FILES. -#-------------------------------------------------------------------- - -AC_OUTPUT diff --git a/autoconf/tea/pkgIndex.tcl.in b/autoconf/tea/pkgIndex.tcl.in index 666812dee7..7d6af1b8dd 100644 --- a/autoconf/tea/pkgIndex.tcl.in +++ b/autoconf/tea/pkgIndex.tcl.in @@ -1,10 +1,30 @@ # -*- tcl -*- -# Tcl package index file, version 1.1 -# +# Automatically generated - do not edit +# Tcl package index file +# Adapted from https://core.tcl-lang.org/tcltls if {[package vsatisfies [package provide Tcl] 9.0-]} { - package ifneeded sqlite3 @PACKAGE_VERSION@ \ - [list load [file join $dir @PKG_LIB_FILE9@] Sqlite3] + package ifneeded @TEAISH_PKGNAME@ @TEAISH_VERSION@ [list apply {{dir} { + load [file join $dir @TEAISH_DLL9@] @TEAISH_LOAD_PREFIX@ +@if TEAISH_PKGINIT_TCL + set initScript [file join $dir @TEAISH_PKGINIT_TCL@] +# if {[file exists $initScript]} { + source -encoding utf-8 $initScript +# } +@endif + }} $dir] } else { - package ifneeded sqlite3 @PACKAGE_VERSION@ \ - [list load [file join $dir @PKG_LIB_FILE8@] Sqlite3] + if {![package vsatisfies [package provide Tcl] 8.5]} {return} + package ifneeded @TEAISH_PKGNAME@ @TEAISH_VERSION@ [list apply {{dir} { + if {[string tolower [file extension @TEAISH_DLL8@]] in [list .dll .dylib .so]} { + load [file join $dir @TEAISH_DLL8@] @TEAISH_LOAD_PREFIX@ + } else { + load {} @TEAISH_LOAD_PREFIX@ + } +@if TEAISH_PKGINIT_TCL + set initScript [file join $dir @TEAISH_PKGINIT_TCL@] +# if {[file exists $initScript]} { + source -encoding utf-8 $initScript +# } +@endif + }} $dir] } diff --git a/autoconf/tea/tclconfig/install-sh b/autoconf/tea/tclconfig/install-sh deleted file mode 100644 index ec298b5374..0000000000 --- a/autoconf/tea/tclconfig/install-sh +++ /dev/null @@ -1,541 +0,0 @@ -#!/bin/sh -# install - install a program, script, or datafile - -scriptversion=2020-11-14.01; # UTC - -# This originates from X11R5 (mit/util/scripts/install.sh), which was -# later released in X11R6 (xc/config/util/install.sh) with the -# following copyright and license. -# -# Copyright (C) 1994 X Consortium -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- -# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Except as contained in this notice, the name of the X Consortium shall not -# be used in advertising or otherwise to promote the sale, use or other deal- -# ings in this Software without prior written authorization from the X Consor- -# tium. -# -# -# FSF changes to this file are in the public domain. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# 'make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. - -tab=' ' -nl=' -' -IFS=" $tab$nl" - -# Set DOITPROG to "echo" to test this script. - -doit=${DOITPROG-} -doit_exec=${doit:-exec} - -# Put in absolute file names if you don't have them in your path; -# or use environment vars. - -chgrpprog=${CHGRPPROG-chgrp} -chmodprog=${CHMODPROG-chmod} -chownprog=${CHOWNPROG-chown} -cmpprog=${CMPPROG-cmp} -cpprog=${CPPROG-cp} -mkdirprog=${MKDIRPROG-mkdir} -mvprog=${MVPROG-mv} -rmprog=${RMPROG-rm} -stripprog=${STRIPPROG-strip} - -posix_mkdir= - -# Desired mode of installed file. -mode=0755 - -# Create dirs (including intermediate dirs) using mode 755. -# This is like GNU 'install' as of coreutils 8.32 (2020). -mkdir_umask=22 - -backupsuffix= -chgrpcmd= -chmodcmd=$chmodprog -chowncmd= -mvcmd=$mvprog -rmcmd="$rmprog -f" -stripcmd= - -src= -dst= -dir_arg= -dst_arg= - -copy_on_change=false -is_target_a_directory=possibly - -usage="\ -Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE - or: $0 [OPTION]... SRCFILES... DIRECTORY - or: $0 [OPTION]... -t DIRECTORY SRCFILES... - or: $0 [OPTION]... -d DIRECTORIES... - -In the 1st form, copy SRCFILE to DSTFILE. -In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. -In the 4th, create DIRECTORIES. - -Options: - --help display this help and exit. - --version display version info and exit. - - -c (ignored) - -C install only if different (preserve data modification time) - -d create directories instead of installing files. - -g GROUP $chgrpprog installed files to GROUP. - -m MODE $chmodprog installed files to MODE. - -o USER $chownprog installed files to USER. - -p pass -p to $cpprog. - -s $stripprog installed files. - -S SUFFIX attempt to back up existing files, with suffix SUFFIX. - -t DIRECTORY install into DIRECTORY. - -T report an error if DSTFILE is a directory. - -Environment variables override the default commands: - CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG - RMPROG STRIPPROG - -By default, rm is invoked with -f; when overridden with RMPROG, -it's up to you to specify -f if you want it. - -If -S is not specified, no backups are attempted. - -Email bug reports to bug-automake@gnu.org. -Automake home page: https://www.gnu.org/software/automake/ -" - -while test $# -ne 0; do - case $1 in - -c) ;; - - -C) copy_on_change=true;; - - -d) dir_arg=true;; - - -g) chgrpcmd="$chgrpprog $2" - shift;; - - --help) echo "$usage"; exit $?;; - - -m) mode=$2 - case $mode in - *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - shift;; - - -o) chowncmd="$chownprog $2" - shift;; - - -p) cpprog="$cpprog -p";; - - -s) stripcmd=$stripprog;; - - -S) backupsuffix="$2" - shift;; - - -t) - is_target_a_directory=always - dst_arg=$2 - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac - shift;; - - -T) is_target_a_directory=never;; - - --version) echo "$0 $scriptversion"; exit $?;; - - --) shift - break;; - - -*) echo "$0: invalid option: $1" >&2 - exit 1;; - - *) break;; - esac - shift -done - -# We allow the use of options -d and -T together, by making -d -# take the precedence; this is for compatibility with GNU install. - -if test -n "$dir_arg"; then - if test -n "$dst_arg"; then - echo "$0: target directory not allowed when installing a directory." >&2 - exit 1 - fi -fi - -if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then - # When -d is used, all remaining arguments are directories to create. - # When -t is used, the destination is already specified. - # Otherwise, the last argument is the destination. Remove it from $@. - for arg - do - if test -n "$dst_arg"; then - # $@ is not empty: it contains at least $arg. - set fnord "$@" "$dst_arg" - shift # fnord - fi - shift # arg - dst_arg=$arg - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac - done -fi - -if test $# -eq 0; then - if test -z "$dir_arg"; then - echo "$0: no input file specified." >&2 - exit 1 - fi - # It's OK to call 'install-sh -d' without argument. - # This can happen when creating conditional directories. - exit 0 -fi - -if test -z "$dir_arg"; then - if test $# -gt 1 || test "$is_target_a_directory" = always; then - if test ! -d "$dst_arg"; then - echo "$0: $dst_arg: Is not a directory." >&2 - exit 1 - fi - fi -fi - -if test -z "$dir_arg"; then - do_exit='(exit $ret); exit $ret' - trap "ret=129; $do_exit" 1 - trap "ret=130; $do_exit" 2 - trap "ret=141; $do_exit" 13 - trap "ret=143; $do_exit" 15 - - # Set umask so as not to create temps with too-generous modes. - # However, 'strip' requires both read and write access to temps. - case $mode in - # Optimize common cases. - *644) cp_umask=133;; - *755) cp_umask=22;; - - *[0-7]) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw='% 200' - fi - cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; - *) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw=,u+rw - fi - cp_umask=$mode$u_plus_rw;; - esac -fi - -for src -do - # Protect names problematic for 'test' and other utilities. - case $src in - -* | [=\(\)!]) src=./$src;; - esac - - if test -n "$dir_arg"; then - dst=$src - dstdir=$dst - test -d "$dstdir" - dstdir_status=$? - # Don't chown directories that already exist. - if test $dstdir_status = 0; then - chowncmd="" - fi - else - - # Waiting for this to be detected by the "$cpprog $src $dsttmp" command - # might cause directories to be created, which would be especially bad - # if $src (and thus $dsttmp) contains '*'. - if test ! -f "$src" && test ! -d "$src"; then - echo "$0: $src does not exist." >&2 - exit 1 - fi - - if test -z "$dst_arg"; then - echo "$0: no destination specified." >&2 - exit 1 - fi - dst=$dst_arg - - # If destination is a directory, append the input filename. - if test -d "$dst"; then - if test "$is_target_a_directory" = never; then - echo "$0: $dst_arg: Is a directory" >&2 - exit 1 - fi - dstdir=$dst - dstbase=`basename "$src"` - case $dst in - */) dst=$dst$dstbase;; - *) dst=$dst/$dstbase;; - esac - dstdir_status=0 - else - dstdir=`dirname "$dst"` - test -d "$dstdir" - dstdir_status=$? - fi - fi - - case $dstdir in - */) dstdirslash=$dstdir;; - *) dstdirslash=$dstdir/;; - esac - - obsolete_mkdir_used=false - - if test $dstdir_status != 0; then - case $posix_mkdir in - '') - # With -d, create the new directory with the user-specified mode. - # Otherwise, rely on $mkdir_umask. - if test -n "$dir_arg"; then - mkdir_mode=-m$mode - else - mkdir_mode= - fi - - posix_mkdir=false - # The $RANDOM variable is not portable (e.g., dash). Use it - # here however when possible just to lower collision chance. - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - - trap ' - ret=$? - rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null - exit $ret - ' 0 - - # Because "mkdir -p" follows existing symlinks and we likely work - # directly in world-writeable /tmp, make sure that the '$tmpdir' - # directory is successfully created first before we actually test - # 'mkdir -p'. - if (umask $mkdir_umask && - $mkdirprog $mkdir_mode "$tmpdir" && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - test_tmpdir="$tmpdir/a" - ls_ld_tmpdir=`ls -ld "$test_tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null - fi - trap '' 0;; - esac - - if - $posix_mkdir && ( - umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" - ) - then : - else - - # mkdir does not conform to POSIX, - # or it failed possibly due to a race condition. Create the - # directory the slow way, step by step, checking for races as we go. - - case $dstdir in - /*) prefix='/';; - [-=\(\)!]*) prefix='./';; - *) prefix='';; - esac - - oIFS=$IFS - IFS=/ - set -f - set fnord $dstdir - shift - set +f - IFS=$oIFS - - prefixes= - - for d - do - test X"$d" = X && continue - - prefix=$prefix$d - if test -d "$prefix"; then - prefixes= - else - if $posix_mkdir; then - (umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break - # Don't fail if two instances are running concurrently. - test -d "$prefix" || exit 1 - else - case $prefix in - *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; - *) qprefix=$prefix;; - esac - prefixes="$prefixes '$qprefix'" - fi - fi - prefix=$prefix/ - done - - if test -n "$prefixes"; then - # Don't fail if two instances are running concurrently. - (umask $mkdir_umask && - eval "\$doit_exec \$mkdirprog $prefixes") || - test -d "$dstdir" || exit 1 - obsolete_mkdir_used=true - fi - fi - fi - - if test -n "$dir_arg"; then - { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && - { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || - test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 - else - - # Make a couple of temp file names in the proper directory. - dsttmp=${dstdirslash}_inst.$$_ - rmtmp=${dstdirslash}_rm.$$_ - - # Trap to clean up those temp files at exit. - trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 - - # Copy the file name to the temp name. - (umask $cp_umask && - { test -z "$stripcmd" || { - # Create $dsttmp read-write so that cp doesn't create it read-only, - # which would cause strip to fail. - if test -z "$doit"; then - : >"$dsttmp" # No need to fork-exec 'touch'. - else - $doit touch "$dsttmp" - fi - } - } && - $doit_exec $cpprog "$src" "$dsttmp") && - - # and set any options; do chmod last to preserve setuid bits. - # - # If any of these fail, we abort the whole thing. If we want to - # ignore errors from any of these, just make sure not to ignore - # errors from the above "$doit $cpprog $src $dsttmp" command. - # - { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && - { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && - { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && - - # If -C, don't bother to copy if it wouldn't change the file. - if $copy_on_change && - old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && - new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && - set -f && - set X $old && old=:$2:$4:$5:$6 && - set X $new && new=:$2:$4:$5:$6 && - set +f && - test "$old" = "$new" && - $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 - then - rm -f "$dsttmp" - else - # If $backupsuffix is set, and the file being installed - # already exists, attempt a backup. Don't worry if it fails, - # e.g., if mv doesn't support -f. - if test -n "$backupsuffix" && test -f "$dst"; then - $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null - fi - - # Rename the file to the real destination. - $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || - - # The rename failed, perhaps because mv can't rename something else - # to itself, or perhaps because mv is so ancient that it does not - # support -f. - { - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - test ! -f "$dst" || - $doit $rmcmd "$dst" 2>/dev/null || - { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd "$rmtmp" 2>/dev/null; :; } - } || - { echo "$0: cannot unlink or rename $dst" >&2 - (exit 1); exit 1 - } - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dst" - } - fi || exit 1 - - trap '' 0 - fi -done - -# Local variables: -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC0" -# time-stamp-end: "; # UTC" -# End: diff --git a/autoconf/tea/tclconfig/tcl.m4 b/autoconf/tea/tclconfig/tcl.m4 deleted file mode 100644 index 237d50a7bd..0000000000 --- a/autoconf/tea/tclconfig/tcl.m4 +++ /dev/null @@ -1,4119 +0,0 @@ -# tcl.m4 -- -# -# This file provides a set of autoconf macros to help TEA-enable -# a Tcl extension. -# -# Copyright (c) 1999-2000 Ajuba Solutions. -# Copyright (c) 2002-2005 ActiveState Corporation. -# -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. - -AC_PREREQ([2.69]) - -# Possible values for key variables defined: -# -# TEA_WINDOWINGSYSTEM - win32 aqua x11 (mirrors 'tk windowingsystem') -# TEA_PLATFORM - windows unix -# TEA_TK_EXTENSION - True if this is a Tk extension -# - -#------------------------------------------------------------------------ -# TEA_PATH_TCLCONFIG -- -# -# Locate the tclConfig.sh file and perform a sanity check on -# the Tcl compile flags -# -# Arguments: -# none -# -# Results: -# -# Adds the following arguments to configure: -# --with-tcl=... -# -# Defines the following vars: -# TCL_BIN_DIR Full path to the directory containing -# the tclConfig.sh file -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PATH_TCLCONFIG], [ - dnl TEA specific: Make sure we are initialized - AC_REQUIRE([TEA_INIT]) - # - # Ok, lets find the tcl configuration - # First, look for one uninstalled. - # the alternative search directory is invoked by --with-tcl - # - - if test x"${no_tcl}" = x ; then - # we reset no_tcl in case something fails here - no_tcl=true - AC_ARG_WITH(tcl, - AS_HELP_STRING([--with-tcl], - [directory containing tcl configuration (tclConfig.sh)]), - [with_tclconfig="${withval}"]) - AC_ARG_WITH(tcl8, - AS_HELP_STRING([--with-tcl8], - [Compile for Tcl8 in Tcl9 environment]), - [with_tcl8="${withval}"]) - AC_MSG_CHECKING([for Tcl configuration]) - AC_CACHE_VAL(ac_cv_c_tclconfig,[ - - # First check to see if --with-tcl was specified. - if test x"${with_tclconfig}" != x ; then - case "${with_tclconfig}" in - */tclConfig.sh ) - if test -f "${with_tclconfig}"; then - AC_MSG_WARN([--with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself]) - with_tclconfig="`echo "${with_tclconfig}" | sed 's!/tclConfig\.sh$!!'`" - fi ;; - esac - if test -f "${with_tclconfig}/tclConfig.sh" ; then - ac_cv_c_tclconfig="`(cd "${with_tclconfig}"; pwd)`" - else - AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh]) - fi - fi - - # then check for a private Tcl installation - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in \ - ../tcl \ - `ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ - ../../tcl \ - `ls -dr ../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ - ../../../tcl \ - `ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do - if test "${TEA_PLATFORM}" = "windows" \ - -a -f "$i/win/tclConfig.sh" ; then - ac_cv_c_tclconfig="`(cd $i/win; pwd)`" - break - fi - if test -f "$i/unix/tclConfig.sh" ; then - ac_cv_c_tclconfig="`(cd $i/unix; pwd)`" - break - fi - done - fi - - # on Darwin, check in Framework installation locations - if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then - for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ - `ls -d /Library/Frameworks 2>/dev/null` \ - `ls -d /Network/Library/Frameworks 2>/dev/null` \ - `ls -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Library/Frameworks/Tcl.framework 2>/dev/null` \ - `ls -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Network/Library/Frameworks/Tcl.framework 2>/dev/null` \ - `ls -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Tcl.framework 2>/dev/null` \ - ; do - if test -f "$i/Tcl.framework/tclConfig.sh" ; then - ac_cv_c_tclconfig="`(cd $i/Tcl.framework; pwd)`" - break - fi - done - fi - - # TEA specific: on Windows, check in common installation locations - if test "${TEA_PLATFORM}" = "windows" \ - -a x"${ac_cv_c_tclconfig}" = x ; then - for i in `ls -d C:/Tcl/lib 2>/dev/null` \ - `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ - ; do - if test -f "$i/tclConfig.sh" ; then - ac_cv_c_tclconfig="`(cd $i; pwd)`" - break - fi - done - fi - - # check in a few common install locations - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in `ls -d ${libdir} 2>/dev/null` \ - `ls -d ${exec_prefix}/lib 2>/dev/null` \ - `ls -d ${prefix}/lib 2>/dev/null` \ - `ls -d /usr/local/lib 2>/dev/null` \ - `ls -d /usr/contrib/lib 2>/dev/null` \ - `ls -d /usr/pkg/lib 2>/dev/null` \ - `ls -d /usr/lib 2>/dev/null` \ - `ls -d /usr/lib64 2>/dev/null` \ - `ls -d /usr/lib/tcl9.0 2>/dev/null` \ - `ls -d /usr/lib/tcl8.7 2>/dev/null` \ - `ls -d /usr/lib/tcl8.6 2>/dev/null` \ - `ls -d /usr/lib/tcl8.5 2>/dev/null` \ - `ls -d /usr/local/lib/tcl9.0 2>/dev/null` \ - `ls -d /usr/local/lib/tcl8.7 2>/dev/null` \ - `ls -d /usr/local/lib/tcl8.6 2>/dev/null` \ - `ls -d /usr/local/lib/tcl8.5 2>/dev/null` \ - `ls -d /usr/local/lib/tcl/tcl9.0 2>/dev/null` \ - `ls -d /usr/local/lib/tcl/tcl8.7 2>/dev/null` \ - `ls -d /usr/local/lib/tcl/tcl8.6 2>/dev/null` \ - `ls -d /usr/local/lib/tcl/tcl8.5 2>/dev/null` \ - ; do - if test -f "$i/tclConfig.sh" ; then - ac_cv_c_tclconfig="`(cd $i; pwd)`" - break - fi - done - fi - - # check in a few other private locations - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in \ - ${srcdir}/../tcl \ - `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do - if test "${TEA_PLATFORM}" = "windows" \ - -a -f "$i/win/tclConfig.sh" ; then - ac_cv_c_tclconfig="`(cd $i/win; pwd)`" - break - fi - if test -f "$i/unix/tclConfig.sh" ; then - ac_cv_c_tclconfig="`(cd $i/unix; pwd)`" - break - fi - done - fi - ]) - - if test x"${ac_cv_c_tclconfig}" = x ; then - TCL_BIN_DIR="# no Tcl configs found" - AC_MSG_ERROR([Can't find Tcl configuration definitions. Use --with-tcl to specify a directory containing tclConfig.sh]) - else - no_tcl= - TCL_BIN_DIR="${ac_cv_c_tclconfig}" - AC_MSG_RESULT([found ${TCL_BIN_DIR}/tclConfig.sh]) - fi - fi -]) - -#------------------------------------------------------------------------ -# TEA_PATH_TKCONFIG -- -# -# Locate the tkConfig.sh file -# -# Arguments: -# none -# -# Results: -# -# Adds the following arguments to configure: -# --with-tk=... -# -# Defines the following vars: -# TK_BIN_DIR Full path to the directory containing -# the tkConfig.sh file -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PATH_TKCONFIG], [ - # - # Ok, lets find the tk configuration - # First, look for one uninstalled. - # the alternative search directory is invoked by --with-tk - # - - if test x"${no_tk}" = x ; then - # we reset no_tk in case something fails here - no_tk=true - AC_ARG_WITH(tk, - AS_HELP_STRING([--with-tk], - [directory containing tk configuration (tkConfig.sh)]), - [with_tkconfig="${withval}"]) - AC_MSG_CHECKING([for Tk configuration]) - AC_CACHE_VAL(ac_cv_c_tkconfig,[ - - # First check to see if --with-tkconfig was specified. - if test x"${with_tkconfig}" != x ; then - case "${with_tkconfig}" in - */tkConfig.sh ) - if test -f "${with_tkconfig}"; then - AC_MSG_WARN([--with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself]) - with_tkconfig="`echo "${with_tkconfig}" | sed 's!/tkConfig\.sh$!!'`" - fi ;; - esac - if test -f "${with_tkconfig}/tkConfig.sh" ; then - ac_cv_c_tkconfig="`(cd "${with_tkconfig}"; pwd)`" - else - AC_MSG_ERROR([${with_tkconfig} directory doesn't contain tkConfig.sh]) - fi - fi - - # then check for a private Tk library - if test x"${ac_cv_c_tkconfig}" = x ; then - for i in \ - ../tk \ - `ls -dr ../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ../tk[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../tk[[8-9]].[[0-9]]* 2>/dev/null` \ - ../../tk \ - `ls -dr ../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ../../tk[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../../tk[[8-9]].[[0-9]]* 2>/dev/null` \ - ../../../tk \ - `ls -dr ../../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ../../../tk[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../../../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do - if test "${TEA_PLATFORM}" = "windows" \ - -a -f "$i/win/tkConfig.sh" ; then - ac_cv_c_tkconfig="`(cd $i/win; pwd)`" - break - fi - if test -f "$i/unix/tkConfig.sh" ; then - ac_cv_c_tkconfig="`(cd $i/unix; pwd)`" - break - fi - done - fi - - # on Darwin, check in Framework installation locations - if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tkconfig}" = x ; then - for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ - `ls -d /Library/Frameworks 2>/dev/null` \ - `ls -d /Network/Library/Frameworks 2>/dev/null` \ - ; do - if test -f "$i/Tk.framework/tkConfig.sh" ; then - ac_cv_c_tkconfig="`(cd $i/Tk.framework; pwd)`" - break - fi - done - fi - - # check in a few common install locations - if test x"${ac_cv_c_tkconfig}" = x ; then - for i in `ls -d ${libdir} 2>/dev/null` \ - `ls -d ${exec_prefix}/lib 2>/dev/null` \ - `ls -d ${prefix}/lib 2>/dev/null` \ - `ls -d /usr/local/lib 2>/dev/null` \ - `ls -d /usr/contrib/lib 2>/dev/null` \ - `ls -d /usr/pkg/lib 2>/dev/null` \ - `ls -d /usr/lib/tk9.0 2>/dev/null` \ - `ls -d /usr/lib/tk8.7 2>/dev/null` \ - `ls -d /usr/lib/tk8.6 2>/dev/null` \ - `ls -d /usr/lib/tk8.5 2>/dev/null` \ - `ls -d /usr/lib 2>/dev/null` \ - `ls -d /usr/lib64 2>/dev/null` \ - `ls -d /usr/local/lib/tk9.0 2>/dev/null` \ - `ls -d /usr/local/lib/tk8.7 2>/dev/null` \ - `ls -d /usr/local/lib/tk8.6 2>/dev/null` \ - `ls -d /usr/local/lib/tk8.5 2>/dev/null` \ - `ls -d /usr/local/lib/tcl/tk9.0 2>/dev/null` \ - `ls -d /usr/local/lib/tcl/tk8.7 2>/dev/null` \ - `ls -d /usr/local/lib/tcl/tk8.6 2>/dev/null` \ - `ls -d /usr/local/lib/tcl/tk8.5 2>/dev/null` \ - ; do - if test -f "$i/tkConfig.sh" ; then - ac_cv_c_tkconfig="`(cd $i; pwd)`" - break - fi - done - fi - - # TEA specific: on Windows, check in common installation locations - if test "${TEA_PLATFORM}" = "windows" \ - -a x"${ac_cv_c_tkconfig}" = x ; then - for i in `ls -d C:/Tcl/lib 2>/dev/null` \ - `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ - ; do - if test -f "$i/tkConfig.sh" ; then - ac_cv_c_tkconfig="`(cd $i; pwd)`" - break - fi - done - fi - - # check in a few other private locations - if test x"${ac_cv_c_tkconfig}" = x ; then - for i in \ - ${srcdir}/../tk \ - `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do - if test "${TEA_PLATFORM}" = "windows" \ - -a -f "$i/win/tkConfig.sh" ; then - ac_cv_c_tkconfig="`(cd $i/win; pwd)`" - break - fi - if test -f "$i/unix/tkConfig.sh" ; then - ac_cv_c_tkconfig="`(cd $i/unix; pwd)`" - break - fi - done - fi - ]) - - if test x"${ac_cv_c_tkconfig}" = x ; then - TK_BIN_DIR="# no Tk configs found" - AC_MSG_ERROR([Can't find Tk configuration definitions. Use --with-tk to specify a directory containing tkConfig.sh]) - else - no_tk= - TK_BIN_DIR="${ac_cv_c_tkconfig}" - AC_MSG_RESULT([found ${TK_BIN_DIR}/tkConfig.sh]) - fi - fi -]) - -#------------------------------------------------------------------------ -# TEA_LOAD_TCLCONFIG -- -# -# Load the tclConfig.sh file -# -# Arguments: -# -# Requires the following vars to be set: -# TCL_BIN_DIR -# -# Results: -# -# Substitutes the following vars: -# TCL_BIN_DIR -# TCL_SRC_DIR -# TCL_LIB_FILE -# TCL_ZIP_FILE -# TCL_ZIPFS_SUPPORT -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_LOAD_TCLCONFIG], [ - AC_MSG_CHECKING([for existence of ${TCL_BIN_DIR}/tclConfig.sh]) - - if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then - AC_MSG_RESULT([loading]) - . "${TCL_BIN_DIR}/tclConfig.sh" - else - AC_MSG_RESULT([could not find ${TCL_BIN_DIR}/tclConfig.sh]) - fi - - # If the TCL_BIN_DIR is the build directory (not the install directory), - # then set the common variable name to the value of the build variables. - # For example, the variable TCL_LIB_SPEC will be set to the value - # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC - # instead of TCL_BUILD_LIB_SPEC since it will work with both an - # installed and uninstalled version of Tcl. - if test -f "${TCL_BIN_DIR}/Makefile" ; then - TCL_LIB_SPEC="${TCL_BUILD_LIB_SPEC}" - TCL_STUB_LIB_SPEC="${TCL_BUILD_STUB_LIB_SPEC}" - TCL_STUB_LIB_PATH="${TCL_BUILD_STUB_LIB_PATH}" - elif test "`uname -s`" = "Darwin"; then - # If Tcl was built as a framework, attempt to use the libraries - # from the framework at the given location so that linking works - # against Tcl.framework installed in an arbitrary location. - case ${TCL_DEFS} in - *TCL_FRAMEWORK*) - if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then - for i in "`cd "${TCL_BIN_DIR}"; pwd`" \ - "`cd "${TCL_BIN_DIR}"/../..; pwd`"; do - if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then - TCL_LIB_SPEC="-F`dirname "$i" | sed -e 's/ /\\\\ /g'` -framework ${TCL_LIB_FILE}" - break - fi - done - fi - if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then - TCL_STUB_LIB_SPEC="-L`echo "${TCL_BIN_DIR}" | sed -e 's/ /\\\\ /g'` ${TCL_STUB_LIB_FLAG}" - TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}" - fi - ;; - esac - fi - - AC_SUBST(TCL_VERSION) - AC_SUBST(TCL_PATCH_LEVEL) - AC_SUBST(TCL_BIN_DIR) - AC_SUBST(TCL_SRC_DIR) - - AC_SUBST(TCL_LIB_FILE) - AC_SUBST(TCL_LIB_FLAG) - AC_SUBST(TCL_LIB_SPEC) - - AC_SUBST(TCL_STUB_LIB_FILE) - AC_SUBST(TCL_STUB_LIB_FLAG) - AC_SUBST(TCL_STUB_LIB_SPEC) - - AC_MSG_CHECKING([platform]) - hold_cc=$CC; CC="$TCL_CC" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ - #ifdef _WIN32 - #error win32 - #endif - ]])],[ - # first test we've already retrieved platform (cross-compile), fallback to unix otherwise: - TEA_PLATFORM="${TEA_PLATFORM-unix}" - CYGPATH=echo - ],[ - TEA_PLATFORM="windows" - AC_CHECK_PROG(CYGPATH, cygpath, cygpath -m, echo) - ]) - CC=$hold_cc - AC_MSG_RESULT($TEA_PLATFORM) - - # The BUILD_$pkg is to define the correct extern storage class - # handling when making this package - AC_DEFINE_UNQUOTED(BUILD_${PACKAGE_NAME}, [], - [Building extension source?]) - # Do this here as we have fully defined TEA_PLATFORM now - if test "${TEA_PLATFORM}" = "windows" ; then - EXEEXT=".exe" - CLEANFILES="$CLEANFILES *.lib *.dll *.pdb *.exp" - fi - - # TEA specific: - AC_SUBST(CLEANFILES) - AC_SUBST(TCL_LIBS) - AC_SUBST(TCL_DEFS) - AC_SUBST(TCL_EXTRA_CFLAGS) - AC_SUBST(TCL_LD_FLAGS) - AC_SUBST(TCL_SHLIB_LD_LIBS) -]) - -#------------------------------------------------------------------------ -# TEA_LOAD_TKCONFIG -- -# -# Load the tkConfig.sh file -# -# Arguments: -# -# Requires the following vars to be set: -# TK_BIN_DIR -# -# Results: -# -# Sets the following vars that should be in tkConfig.sh: -# TK_BIN_DIR -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_LOAD_TKCONFIG], [ - AC_MSG_CHECKING([for existence of ${TK_BIN_DIR}/tkConfig.sh]) - - if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then - AC_MSG_RESULT([loading]) - . "${TK_BIN_DIR}/tkConfig.sh" - else - AC_MSG_RESULT([could not find ${TK_BIN_DIR}/tkConfig.sh]) - fi - - # If the TK_BIN_DIR is the build directory (not the install directory), - # then set the common variable name to the value of the build variables. - # For example, the variable TK_LIB_SPEC will be set to the value - # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC - # instead of TK_BUILD_LIB_SPEC since it will work with both an - # installed and uninstalled version of Tcl. - if test -f "${TK_BIN_DIR}/Makefile" ; then - TK_LIB_SPEC="${TK_BUILD_LIB_SPEC}" - TK_STUB_LIB_SPEC="${TK_BUILD_STUB_LIB_SPEC}" - TK_STUB_LIB_PATH="${TK_BUILD_STUB_LIB_PATH}" - elif test "`uname -s`" = "Darwin"; then - # If Tk was built as a framework, attempt to use the libraries - # from the framework at the given location so that linking works - # against Tk.framework installed in an arbitrary location. - case ${TK_DEFS} in - *TK_FRAMEWORK*) - if test -f "${TK_BIN_DIR}/${TK_LIB_FILE}"; then - for i in "`cd "${TK_BIN_DIR}"; pwd`" \ - "`cd "${TK_BIN_DIR}"/../..; pwd`"; do - if test "`basename "$i"`" = "${TK_LIB_FILE}.framework"; then - TK_LIB_SPEC="-F`dirname "$i" | sed -e 's/ /\\\\ /g'` -framework ${TK_LIB_FILE}" - break - fi - done - fi - if test -f "${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"; then - TK_STUB_LIB_SPEC="-L` echo "${TK_BIN_DIR}" | sed -e 's/ /\\\\ /g'` ${TK_STUB_LIB_FLAG}" - TK_STUB_LIB_PATH="${TK_BIN_DIR}/${TK_STUB_LIB_FILE}" - fi - ;; - esac - fi - - # TEA specific: Ensure windowingsystem is defined - if test "${TEA_PLATFORM}" = "unix" ; then - case ${TK_DEFS} in - *MAC_OSX_TK*) - AC_DEFINE(MAC_OSX_TK, 1, [Are we building against Mac OS X TkAqua?]) - TEA_WINDOWINGSYSTEM="aqua" - ;; - *) - TEA_WINDOWINGSYSTEM="x11" - ;; - esac - elif test "${TEA_PLATFORM}" = "windows" ; then - TEA_WINDOWINGSYSTEM="win32" - fi - - AC_SUBST(TK_VERSION) - AC_SUBST(TK_BIN_DIR) - AC_SUBST(TK_SRC_DIR) - - AC_SUBST(TK_LIB_FILE) - AC_SUBST(TK_LIB_FLAG) - AC_SUBST(TK_LIB_SPEC) - - AC_SUBST(TK_STUB_LIB_FILE) - AC_SUBST(TK_STUB_LIB_FLAG) - AC_SUBST(TK_STUB_LIB_SPEC) - - # TEA specific: - AC_SUBST(TK_LIBS) - AC_SUBST(TK_XINCLUDES) -]) - -#------------------------------------------------------------------------ -# TEA_PROG_TCLSH -# Determine the fully qualified path name of the tclsh executable -# in the Tcl build directory or the tclsh installed in a bin -# directory. This macro will correctly determine the name -# of the tclsh executable even if tclsh has not yet been -# built in the build directory. The tclsh found is always -# associated with a tclConfig.sh file. This tclsh should be used -# only for running extension test cases. It should never be -# or generation of files (like pkgIndex.tcl) at build time. -# -# Arguments: -# none -# -# Results: -# Substitutes the following vars: -# TCLSH_PROG -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PROG_TCLSH], [ - AC_MSG_CHECKING([for tclsh]) - if test -f "${TCL_BIN_DIR}/Makefile" ; then - # tclConfig.sh is in Tcl build directory - if test "${TEA_PLATFORM}" = "windows"; then - if test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${EXEEXT}" ; then - TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${EXEEXT}" - elif test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}s${EXEEXT}" ; then - TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}s${EXEEXT}" - elif test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}t${EXEEXT}" ; then - TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}t${EXEEXT}" - elif test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}st${EXEEXT}" ; then - TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}st${EXEEXT}" - fi - else - TCLSH_PROG="${TCL_BIN_DIR}/tclsh" - fi - else - # tclConfig.sh is in install location - if test "${TEA_PLATFORM}" = "windows"; then - TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${EXEEXT}" - else - TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}" - fi - list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \ - `ls -d ${TCL_BIN_DIR}/.. 2>/dev/null` \ - `ls -d ${TCL_PREFIX}/bin 2>/dev/null`" - for i in $list ; do - if test -f "$i/${TCLSH_PROG}" ; then - REAL_TCL_BIN_DIR="`cd "$i"; pwd`/" - break - fi - done - TCLSH_PROG="${REAL_TCL_BIN_DIR}${TCLSH_PROG}" - fi - AC_MSG_RESULT([${TCLSH_PROG}]) - AC_SUBST(TCLSH_PROG) -]) - -#------------------------------------------------------------------------ -# TEA_PROG_WISH -# Determine the fully qualified path name of the wish executable -# in the Tk build directory or the wish installed in a bin -# directory. This macro will correctly determine the name -# of the wish executable even if wish has not yet been -# built in the build directory. The wish found is always -# associated with a tkConfig.sh file. This wish should be used -# only for running extension test cases. It should never be -# or generation of files (like pkgIndex.tcl) at build time. -# -# Arguments: -# none -# -# Results: -# Substitutes the following vars: -# WISH_PROG -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PROG_WISH], [ - AC_MSG_CHECKING([for wish]) - if test -f "${TK_BIN_DIR}/Makefile" ; then - # tkConfig.sh is in Tk build directory - if test "${TEA_PLATFORM}" = "windows"; then - if test -f "${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${EXEEXT}" ; then - WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${EXEEXT}" - elif test -f "${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}s${EXEEXT}" ; then - WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}$s{EXEEXT}" - elif test -f "${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}t${EXEEXT}" ; then - WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}t${EXEEXT}" - elif test -f "${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}st${EXEEXT}" ; then - WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}st${EXEEXT}" - fi - else - WISH_PROG="${TK_BIN_DIR}/wish" - fi - else - # tkConfig.sh is in install location - if test "${TEA_PLATFORM}" = "windows"; then - WISH_PROG="wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${EXEEXT}" - else - WISH_PROG="wish${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}" - fi - list="`ls -d ${TK_BIN_DIR}/../bin 2>/dev/null` \ - `ls -d ${TK_BIN_DIR}/.. 2>/dev/null` \ - `ls -d ${TK_PREFIX}/bin 2>/dev/null`" - for i in $list ; do - if test -f "$i/${WISH_PROG}" ; then - REAL_TK_BIN_DIR="`cd "$i"; pwd`/" - break - fi - done - WISH_PROG="${REAL_TK_BIN_DIR}${WISH_PROG}" - fi - AC_MSG_RESULT([${WISH_PROG}]) - AC_SUBST(WISH_PROG) -]) - -#------------------------------------------------------------------------ -# TEA_ENABLE_SHARED -- -# -# Allows the building of shared libraries -# -# Arguments: -# none -# -# Results: -# -# Adds the following arguments to configure: -# --enable-shared=yes|no -# --enable-stubs=yes|no -# -# Defines the following vars: -# STATIC_BUILD Used for building import/export libraries -# on Windows. -# -# Sets the following vars: -# SHARED_BUILD Value of 1 or 0 -# STUBS_BUILD Value if 1 or 0 -# USE_TCL_STUBS Value true: if SHARED_BUILD or --enable-stubs -# USE_TCLOO_STUBS Value true: if SHARED_BUILD or --enable-stubs -# USE_TK_STUBS Value true: if SHARED_BUILD or --enable-stubs -# AND TEA_WINDOWING_SYSTEM != "" -#------------------------------------------------------------------------ -AC_DEFUN([TEA_ENABLE_SHARED], [ - AC_MSG_CHECKING([how to build libraries]) - AC_ARG_ENABLE(shared, - AS_HELP_STRING([--enable-shared], - [build and link with shared libraries (default: on)]), - [shared_ok=$enableval], [shared_ok=yes]) - - if test "${enable_shared+set}" = set; then - enableval="$enable_shared" - shared_ok=$enableval - else - shared_ok=yes - fi - - AC_ARG_ENABLE(stubs, - AS_HELP_STRING([--enable-stubs], - [build and link with stub libraries. Always true for shared builds (default: on)]), - [stubs_ok=$enableval], [stubs_ok=yes]) - - if test "${enable_stubs+set}" = set; then - enableval="$enable_stubs" - stubs_ok=$enableval - else - stubs_ok=yes - fi - - # Stubs are always enabled for shared builds - if test "$shared_ok" = "yes" ; then - AC_MSG_RESULT([shared]) - SHARED_BUILD=1 - STUBS_BUILD=1 - else - AC_MSG_RESULT([static]) - SHARED_BUILD=0 - AC_DEFINE(STATIC_BUILD, 1, [This a static build]) - if test "$stubs_ok" = "yes" ; then - STUBS_BUILD=1 - else - STUBS_BUILD=0 - fi - fi - if test "${STUBS_BUILD}" = "1" ; then - AC_DEFINE(USE_TCL_STUBS, 1, [Use Tcl stubs]) - AC_DEFINE(USE_TCLOO_STUBS, 1, [Use TclOO stubs]) - if test "${TEA_WINDOWINGSYSTEM}" != ""; then - AC_DEFINE(USE_TK_STUBS, 1, [Use Tk stubs]) - fi - fi - - AC_SUBST(SHARED_BUILD) - AC_SUBST(STUBS_BUILD) -]) - -#------------------------------------------------------------------------ -# TEA_ENABLE_THREADS -- -# -# Specify if thread support should be enabled. If "yes" is specified -# as an arg (optional), threads are enabled by default, "no" means -# threads are disabled. "yes" is the default. -# -# TCL_THREADS is checked so that if you are compiling an extension -# against a threaded core, your extension must be compiled threaded -# as well. -# -# Note that it is legal to have a thread enabled extension run in a -# threaded or non-threaded Tcl core, but a non-threaded extension may -# only run in a non-threaded Tcl core. -# -# Arguments: -# none -# -# Results: -# -# Adds the following arguments to configure: -# --enable-threads -# -# Sets the following vars: -# THREADS_LIBS Thread library(s) -# -# Defines the following vars: -# TCL_THREADS -# _REENTRANT -# _THREAD_SAFE -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_ENABLE_THREADS], [ - AC_ARG_ENABLE(threads, - AS_HELP_STRING([--enable-threads], - [build with threads (default: on)]), - [tcl_ok=$enableval], [tcl_ok=yes]) - - if test "${enable_threads+set}" = set; then - enableval="$enable_threads" - tcl_ok=$enableval - else - tcl_ok=yes - fi - - if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then - TCL_THREADS=1 - - if test "${TEA_PLATFORM}" != "windows" ; then - # We are always OK on Windows, so check what this platform wants: - - # USE_THREAD_ALLOC tells us to try the special thread-based - # allocator that significantly reduces lock contention - AC_DEFINE(USE_THREAD_ALLOC, 1, - [Do we want to use the threaded memory allocator?]) - AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) - if test "`uname -s`" = "SunOS" ; then - AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, - [Do we really want to follow the standard? Yes we do!]) - fi - AC_DEFINE(_THREAD_SAFE, 1, [Do we want the thread-safe OS API?]) - AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no) - if test "$tcl_ok" = "no"; then - # Check a little harder for __pthread_mutex_init in the same - # library, as some systems hide it there until pthread.h is - # defined. We could alternatively do an AC_TRY_COMPILE with - # pthread.h, but that will work with libpthread really doesn't - # exist, like AIX 4.2. [Bug: 4359] - AC_CHECK_LIB(pthread, __pthread_mutex_init, - tcl_ok=yes, tcl_ok=no) - fi - - if test "$tcl_ok" = "yes"; then - # The space is needed - THREADS_LIBS=" -lpthread" - else - AC_CHECK_LIB(pthreads, pthread_mutex_init, - tcl_ok=yes, tcl_ok=no) - if test "$tcl_ok" = "yes"; then - # The space is needed - THREADS_LIBS=" -lpthreads" - else - AC_CHECK_LIB(c, pthread_mutex_init, - tcl_ok=yes, tcl_ok=no) - if test "$tcl_ok" = "no"; then - AC_CHECK_LIB(c_r, pthread_mutex_init, - tcl_ok=yes, tcl_ok=no) - if test "$tcl_ok" = "yes"; then - # The space is needed - THREADS_LIBS=" -pthread" - else - TCL_THREADS=0 - AC_MSG_WARN([Do not know how to find pthread lib on your system - thread support disabled]) - fi - fi - fi - fi - fi - else - TCL_THREADS=0 - fi - # Do checking message here to not mess up interleaved configure output - AC_MSG_CHECKING([for building with threads]) - if test "${TCL_THREADS}" = 1; then - AC_DEFINE(TCL_THREADS, 1, [Are we building with threads enabled?]) - AC_MSG_RESULT([yes (default)]) - else - AC_MSG_RESULT([no]) - fi - # TCL_THREADS sanity checking. See if our request for building with - # threads is the same as the way Tcl was built. If not, warn the user. - case ${TCL_DEFS} in - *THREADS=1*) - if test "${TCL_THREADS}" = "0"; then - AC_MSG_WARN([ - Building ${PACKAGE_NAME} without threads enabled, but building against Tcl - that IS thread-enabled. It is recommended to use --enable-threads.]) - fi - ;; - esac - AC_SUBST(TCL_THREADS) -]) - -#------------------------------------------------------------------------ -# TEA_ENABLE_SYMBOLS -- -# -# Specify if debugging symbols should be used. -# Memory (TCL_MEM_DEBUG) debugging can also be enabled. -# -# Arguments: -# none -# -# TEA varies from core Tcl in that C|LDFLAGS_DEFAULT receives -# the value of C|LDFLAGS_OPTIMIZE|DEBUG already substituted. -# Requires the following vars to be set in the Makefile: -# CFLAGS_DEFAULT -# LDFLAGS_DEFAULT -# -# Results: -# -# Adds the following arguments to configure: -# --enable-symbols -# -# Defines the following vars: -# CFLAGS_DEFAULT Sets to $(CFLAGS_DEBUG) if true -# Sets to "$(CFLAGS_OPTIMIZE) -DNDEBUG" if false -# LDFLAGS_DEFAULT Sets to $(LDFLAGS_DEBUG) if true -# Sets to $(LDFLAGS_OPTIMIZE) if false -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_ENABLE_SYMBOLS], [ - dnl TEA specific: Make sure we are initialized - AC_REQUIRE([TEA_CONFIG_CFLAGS]) - AC_MSG_CHECKING([for build with symbols]) - AC_ARG_ENABLE(symbols, - AS_HELP_STRING([--enable-symbols], - [build with debugging symbols (default: off)]), - [tcl_ok=$enableval], [tcl_ok=no]) - if test "$tcl_ok" = "no"; then - CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE} -DNDEBUG" - LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}" - AC_MSG_RESULT([no]) - AC_DEFINE(TCL_CFG_OPTIMIZED, 1, [Is this an optimized build?]) - else - CFLAGS_DEFAULT="${CFLAGS_DEBUG}" - LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}" - if test "$tcl_ok" = "yes"; then - AC_MSG_RESULT([yes (standard debugging)]) - fi - fi - AC_SUBST(CFLAGS_DEFAULT) - AC_SUBST(LDFLAGS_DEFAULT) - - if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then - AC_DEFINE(TCL_MEM_DEBUG, 1, [Is memory debugging enabled?]) - fi - - if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then - if test "$tcl_ok" = "all"; then - AC_MSG_RESULT([enabled symbols mem debugging]) - else - AC_MSG_RESULT([enabled $tcl_ok debugging]) - fi - fi -]) - -#------------------------------------------------------------------------ -# TEA_ENABLE_LANGINFO -- -# -# Allows use of modern nl_langinfo check for better l10n. -# This is only relevant for Unix. -# -# Arguments: -# none -# -# Results: -# -# Adds the following arguments to configure: -# --enable-langinfo=yes|no (default is yes) -# -# Defines the following vars: -# HAVE_LANGINFO Triggers use of nl_langinfo if defined. -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_ENABLE_LANGINFO], [ - AC_ARG_ENABLE(langinfo, - AS_HELP_STRING([--enable-langinfo], - [use nl_langinfo if possible to determine encoding at startup, otherwise use old heuristic (default: on)]), - [langinfo_ok=$enableval], [langinfo_ok=yes]) - - HAVE_LANGINFO=0 - if test "$langinfo_ok" = "yes"; then - AC_CHECK_HEADER(langinfo.h,[langinfo_ok=yes],[langinfo_ok=no]) - fi - AC_MSG_CHECKING([whether to use nl_langinfo]) - if test "$langinfo_ok" = "yes"; then - AC_CACHE_VAL(tcl_cv_langinfo_h, [ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[nl_langinfo(CODESET);]])], - [tcl_cv_langinfo_h=yes],[tcl_cv_langinfo_h=no])]) - AC_MSG_RESULT([$tcl_cv_langinfo_h]) - if test $tcl_cv_langinfo_h = yes; then - AC_DEFINE(HAVE_LANGINFO, 1, [Do we have nl_langinfo()?]) - fi - else - AC_MSG_RESULT([$langinfo_ok]) - fi -]) - -#-------------------------------------------------------------------- -# TEA_CONFIG_SYSTEM -# -# Determine what the system is (some things cannot be easily checked -# on a feature-driven basis, alas). This can usually be done via the -# "uname" command. -# -# Arguments: -# none -# -# Results: -# Defines the following var: -# -# system - System/platform/version identification code. -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_CONFIG_SYSTEM], [ - AC_CACHE_CHECK([system version], tcl_cv_sys_version, [ - # TEA specific: - if test "${TEA_PLATFORM}" = "windows" ; then - tcl_cv_sys_version=windows - else - tcl_cv_sys_version=`uname -s`-`uname -r` - if test "$?" -ne 0 ; then - AC_MSG_WARN([can't find uname command]) - tcl_cv_sys_version=unknown - else - if test "`uname -s`" = "AIX" ; then - tcl_cv_sys_version=AIX-`uname -v`.`uname -r` - fi - if test "`uname -s`" = "NetBSD" -a -f /etc/debian_version ; then - tcl_cv_sys_version=NetBSD-Debian - fi - fi - fi - ]) - system=$tcl_cv_sys_version -]) - -#-------------------------------------------------------------------- -# TEA_CONFIG_CFLAGS -# -# Try to determine the proper flags to pass to the compiler -# for building shared libraries and other such nonsense. -# -# Arguments: -# none -# -# Results: -# -# Defines and substitutes the following vars: -# -# DL_OBJS, DL_LIBS - removed for TEA, only needed by core. -# LDFLAGS - Flags to pass to the compiler when linking object -# files into an executable application binary such -# as tclsh. -# LD_SEARCH_FLAGS-Flags to pass to ld, such as "-R /usr/local/tcl/lib", -# that tell the run-time dynamic linker where to look -# for shared libraries such as libtcl.so. Depends on -# the variable LIB_RUNTIME_DIR in the Makefile. Could -# be the same as CC_SEARCH_FLAGS if ${CC} is used to link. -# CC_SEARCH_FLAGS-Flags to pass to ${CC}, such as "-Wl,-rpath,/usr/local/tcl/lib", -# that tell the run-time dynamic linker where to look -# for shared libraries such as libtcl.so. Depends on -# the variable LIB_RUNTIME_DIR in the Makefile. -# SHLIB_CFLAGS - Flags to pass to cc when compiling the components -# of a shared library (may request position-independent -# code, among other things). -# SHLIB_LD - Base command to use for combining object files -# into a shared library. -# SHLIB_LD_LIBS - Dependent libraries for the linker to scan when -# creating shared libraries. This symbol typically -# goes at the end of the "ld" commands that build -# shared libraries. The value of the symbol defaults to -# "${LIBS}" if all of the dependent libraries should -# be specified when creating a shared library. If -# dependent libraries should not be specified (as on -# SunOS 4.x, where they cause the link to fail, or in -# general if Tcl and Tk aren't themselves shared -# libraries), then this symbol has an empty string -# as its value. -# SHLIB_SUFFIX - Suffix to use for the names of dynamically loadable -# extensions. An empty string means we don't know how -# to use shared libraries on this platform. -# LIB_SUFFIX - Specifies everything that comes after the "libfoo" -# in a static or shared library name, using the $PACKAGE_VERSION variable -# to put the version in the right place. This is used -# by platforms that need non-standard library names. -# Examples: ${PACKAGE_VERSION}.so.1.1 on NetBSD, since it needs -# to have a version after the .so, and ${PACKAGE_VERSION}.a -# on AIX, since a shared library needs to have -# a .a extension whereas shared objects for loadable -# extensions have a .so extension. Defaults to -# ${PACKAGE_VERSION}${SHLIB_SUFFIX}. -# CFLAGS_DEBUG - -# Flags used when running the compiler in debug mode -# CFLAGS_OPTIMIZE - -# Flags used when running the compiler in optimize mode -# CFLAGS - Additional CFLAGS added as necessary (usually 64-bit) -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_CONFIG_CFLAGS], [ - dnl TEA specific: Make sure we are initialized - AC_REQUIRE([TEA_INIT]) - - # Step 0.a: Enable 64 bit support? - - AC_MSG_CHECKING([if 64bit support is requested]) - AC_ARG_ENABLE(64bit, - AS_HELP_STRING([--enable-64bit], - [enable 64bit support (default: off)]), - [do64bit=$enableval], [do64bit=no]) - AC_MSG_RESULT([$do64bit]) - - # Step 0.b: Enable Solaris 64 bit VIS support? - - AC_MSG_CHECKING([if 64bit Sparc VIS support is requested]) - AC_ARG_ENABLE(64bit-vis, - AS_HELP_STRING([--enable-64bit-vis], - [enable 64bit Sparc VIS support (default: off)]), - [do64bitVIS=$enableval], [do64bitVIS=no]) - AC_MSG_RESULT([$do64bitVIS]) - # Force 64bit on with VIS - AS_IF([test "$do64bitVIS" = "yes"], [do64bit=yes]) - - # Step 0.c: Check if visibility support is available. Do this here so - # that platform specific alternatives can be used below if this fails. - - AC_CACHE_CHECK([if compiler supports visibility "hidden"], - tcl_cv_cc_visibility_hidden, [ - hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" - AC_LINK_IFELSE([AC_LANG_PROGRAM([[ - extern __attribute__((__visibility__("hidden"))) void f(void); - void f(void) {}]], [[f();]])],[tcl_cv_cc_visibility_hidden=yes], - [tcl_cv_cc_visibility_hidden=no]) - CFLAGS=$hold_cflags]) - AS_IF([test $tcl_cv_cc_visibility_hidden = yes], [ - AC_DEFINE(MODULE_SCOPE, - [extern __attribute__((__visibility__("hidden")))], - [Compiler support for module scope symbols]) - AC_DEFINE(HAVE_HIDDEN, [1], [Compiler support for module scope symbols]) - ]) - - # Step 0.d: Disable -rpath support? - - AC_MSG_CHECKING([if rpath support is requested]) - AC_ARG_ENABLE(rpath, - AS_HELP_STRING([--disable-rpath], - [disable rpath support (default: on)]), - [doRpath=$enableval], [doRpath=yes]) - AC_MSG_RESULT([$doRpath]) - - # Set the variable "system" to hold the name and version number - # for the system. - - TEA_CONFIG_SYSTEM - - # Require ranlib early so we can override it in special cases below. - - AC_REQUIRE([AC_PROG_RANLIB]) - - # Set configuration options based on system name and version. - # This is similar to Tcl's unix/tcl.m4 except that we've added a - # "windows" case and removed some core-only vars. - - do64bit_ok=no - # default to '{$LIBS}' and set to "" on per-platform necessary basis - SHLIB_LD_LIBS='${LIBS}' - # When ld needs options to work in 64-bit mode, put them in - # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load] - # is disabled by the user. [Bug 1016796] - LDFLAGS_ARCH="" - UNSHARED_LIB_SUFFIX="" - # TEA specific: use PACKAGE_VERSION instead of VERSION - TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`' - ECHO_VERSION='`echo ${PACKAGE_VERSION}`' - TCL_LIB_VERSIONS_OK=ok - CFLAGS_DEBUG=-g - AS_IF([test "$GCC" = yes], [ - CFLAGS_OPTIMIZE=-O2 - CFLAGS_WARNING="-Wall" - ], [ - CFLAGS_OPTIMIZE=-O - CFLAGS_WARNING="" - ]) - AC_CHECK_TOOL(AR, ar) - STLIB_LD='${AR} cr' - LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" - AS_IF([test "x$SHLIB_VERSION" = x],[SHLIB_VERSION=""],[SHLIB_VERSION=".$SHLIB_VERSION"]) - case $system in - # TEA specific: - windows) - MACHINE="X86" - if test "$do64bit" != "no" ; then - case "$do64bit" in - amd64|x64|yes) - MACHINE="AMD64" ; # default to AMD64 64-bit build - ;; - arm64|aarch64) - MACHINE="ARM64" - ;; - ia64) - MACHINE="IA64" - ;; - esac - fi - - if test "$GCC" != "yes" ; then - if test "${SHARED_BUILD}" = "0" ; then - runtime=-MT - else - runtime=-MD - fi - case "x`echo \${VisualStudioVersion}`" in - x1[[4-9]]*) - lflags="${lflags} -nodefaultlib:libucrt.lib" - TEA_ADD_LIBS([ucrt.lib]) - ;; - *) - ;; - esac - - if test "$do64bit" != "no" ; then - CC="cl.exe" - RC="rc.exe" - lflags="${lflags} -nologo -MACHINE:${MACHINE} " - LINKBIN="link.exe" - CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d" - CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" - # Avoid 'unresolved external symbol __security_cookie' - # errors, c.f. http://support.microsoft.com/?id=894573 - TEA_ADD_LIBS([bufferoverflowU.lib]) - else - RC="rc" - lflags="${lflags} -nologo" - LINKBIN="link" - CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d" - CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" - fi - fi - - if test "$GCC" = "yes"; then - # mingw gcc mode - AC_CHECK_TOOL(RC, windres) - CFLAGS_DEBUG="-g" - CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" - SHLIB_LD='${CC} -shared' - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' - LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}" - LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}" - - AC_CACHE_CHECK(for cross-compile version of gcc, - ac_cv_cross, - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #ifdef _WIN32 - #error cross-compiler - #endif - ]], [[]])], - [ac_cv_cross=yes], - [ac_cv_cross=no]) - ) - if test "$ac_cv_cross" = "yes"; then - case "$do64bit" in - amd64|x64|yes) - CC="x86_64-w64-mingw32-${CC}" - LD="x86_64-w64-mingw32-ld" - AR="x86_64-w64-mingw32-ar" - RANLIB="x86_64-w64-mingw32-ranlib" - RC="x86_64-w64-mingw32-windres" - ;; - arm64|aarch64) - CC="aarch64-w64-mingw32-clang" - LD="aarch64-w64-mingw32-ld" - AR="aarch64-w64-mingw32-ar" - RANLIB="aarch64-w64-mingw32-ranlib" - RC="aarch64-w64-mingw32-windres" - ;; - *) - CC="i686-w64-mingw32-${CC}" - LD="i686-w64-mingw32-ld" - AR="i686-w64-mingw32-ar" - RANLIB="i686-w64-mingw32-ranlib" - RC="i686-w64-mingw32-windres" - ;; - esac - fi - - else - SHLIB_LD="${LINKBIN} -dll ${lflags}" - # link -lib only works when -lib is the first arg - STLIB_LD="${LINKBIN} -lib ${lflags}" - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib' - PATHTYPE=-w - # For information on what debugtype is most useful, see: - # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp - # and also - # http://msdn2.microsoft.com/en-us/library/y0zzbyt4%28VS.80%29.aspx - # This essentially turns it all on. - LDFLAGS_DEBUG="-debug -debugtype:cv" - LDFLAGS_OPTIMIZE="-release" - LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" - LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" - fi - - SHLIB_SUFFIX=".dll" - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll' - - TCL_LIB_VERSIONS_OK=nodots - ;; - AIX-*) - AS_IF([test "$GCC" != "yes"], [ - # AIX requires the _r compiler when gcc isn't being used - case "${CC}" in - *_r|*_r\ *) - # ok ... - ;; - *) - # Make sure only first arg gets _r - CC=`echo "$CC" | sed -e 's/^\([[^ ]]*\)/\1_r/'` - ;; - esac - AC_MSG_RESULT([Using $CC for compiling with threads]) - ]) - LIBS="$LIBS -lc" - SHLIB_CFLAGS="" - SHLIB_SUFFIX=".so" - - LD_LIBRARY_PATH_VAR="LIBPATH" - - # Check to enable 64-bit flags for compiler/linker - AS_IF([test "$do64bit" = yes], [ - AS_IF([test "$GCC" = yes], [ - AC_MSG_WARN([64bit mode not supported with GCC on $system]) - ], [ - do64bit_ok=yes - CFLAGS="$CFLAGS -q64" - LDFLAGS_ARCH="-q64" - RANLIB="${RANLIB} -X64" - AR="${AR} -X64" - SHLIB_LD_FLAGS="-b64" - ]) - ]) - - AS_IF([test "`uname -m`" = ia64], [ - # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC - SHLIB_LD="/usr/ccs/bin/ld -G -z text" - AS_IF([test "$GCC" = yes], [ - CC_SEARCH_FLAGS='"-Wl,-R,${LIB_RUNTIME_DIR}"' - ], [ - CC_SEARCH_FLAGS='"-R${LIB_RUNTIME_DIR}"' - ]) - LD_SEARCH_FLAGS='-R "${LIB_RUNTIME_DIR}"' - ], [ - AS_IF([test "$GCC" = yes], [ - SHLIB_LD='${CC} -shared -Wl,-bexpall' - ], [ - SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bexpall -H512 -T512 -bnoentry" - LDFLAGS="$LDFLAGS -brtl" - ]) - SHLIB_LD="${SHLIB_LD} ${SHLIB_LD_FLAGS}" - CC_SEARCH_FLAGS='"-L${LIB_RUNTIME_DIR}"' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - ]) - ;; - BeOS*) - SHLIB_CFLAGS="-fPIC" - SHLIB_LD='${CC} -nostart' - SHLIB_SUFFIX=".so" - - #----------------------------------------------------------- - # Check for inet_ntoa in -lbind, for BeOS (which also needs - # -lsocket, even if the network functions are in -lnet which - # is always linked to, for compatibility. - #----------------------------------------------------------- - AC_CHECK_LIB(bind, inet_ntoa, [LIBS="$LIBS -lbind -lsocket"]) - ;; - BSD/OS-2.1*|BSD/OS-3*) - SHLIB_CFLAGS="" - SHLIB_LD="shlicc -r" - SHLIB_SUFFIX=".so" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - BSD/OS-4.*) - SHLIB_CFLAGS="-export-dynamic -fPIC" - SHLIB_LD='${CC} -shared' - SHLIB_SUFFIX=".so" - LDFLAGS="$LDFLAGS -export-dynamic" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - CYGWIN_*) - SHLIB_CFLAGS="" - SHLIB_LD='${CC} -shared' - SHLIB_SUFFIX=".dll" - SHLIB_LD_LIBS="${SHLIB_LD_LIBS} -Wl,--out-implib,\$[@].a" - EXEEXT=".exe" - do64bit_ok=yes - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - dgux*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD='${CC} -G' - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - Haiku*) - LDFLAGS="$LDFLAGS -Wl,--export-dynamic" - SHLIB_CFLAGS="-fPIC" - SHLIB_SUFFIX=".so" - SHLIB_LD='${CC} ${CFLAGS} ${LDFLAGS} -shared' - AC_CHECK_LIB(network, inet_ntoa, [LIBS="$LIBS -lnetwork"]) - ;; - HP-UX-*.11.*) - # Use updated header definitions where possible - AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, [Do we want to use the XOPEN network library?]) - # TEA specific: Needed by Tcl, but not most extensions - #AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?]) - #LIBS="$LIBS -lxnet" # Use the XOPEN network library - - AS_IF([test "`uname -m`" = ia64], [ - SHLIB_SUFFIX=".so" - ], [ - SHLIB_SUFFIX=".sl" - ]) - AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no) - AS_IF([test "$tcl_ok" = yes], [ - SHLIB_CFLAGS="+z" - SHLIB_LD="ld -b" - LDFLAGS="$LDFLAGS -Wl,-E" - CC_SEARCH_FLAGS='"-Wl,+s,+b,${LIB_RUNTIME_DIR}:."' - LD_SEARCH_FLAGS='+s +b "${LIB_RUNTIME_DIR}:."' - LD_LIBRARY_PATH_VAR="SHLIB_PATH" - ]) - AS_IF([test "$GCC" = yes], [ - SHLIB_LD='${CC} -shared' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - ], [ - CFLAGS="$CFLAGS -z" - ]) - - # Check to enable 64-bit flags for compiler/linker - AS_IF([test "$do64bit" = "yes"], [ - AS_IF([test "$GCC" = yes], [ - case `${CC} -dumpmachine` in - hppa64*) - # 64-bit gcc in use. Fix flags for GNU ld. - do64bit_ok=yes - SHLIB_LD='${CC} -shared' - AS_IF([test $doRpath = yes], [ - CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"']) - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - ;; - *) - AC_MSG_WARN([64bit mode not supported with GCC on $system]) - ;; - esac - ], [ - do64bit_ok=yes - CFLAGS="$CFLAGS +DD64" - LDFLAGS_ARCH="+DD64" - ]) - ]) ;; - HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) - SHLIB_SUFFIX=".sl" - AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no) - AS_IF([test "$tcl_ok" = yes], [ - SHLIB_CFLAGS="+z" - SHLIB_LD="ld -b" - SHLIB_LD_LIBS="" - LDFLAGS="$LDFLAGS -Wl,-E" - CC_SEARCH_FLAGS='"-Wl,+s,+b,${LIB_RUNTIME_DIR}:."' - LD_SEARCH_FLAGS='+s +b "${LIB_RUNTIME_DIR}:."' - LD_LIBRARY_PATH_VAR="SHLIB_PATH" - ]) ;; - IRIX-5.*) - SHLIB_CFLAGS="" - SHLIB_LD="ld -shared -rdata_shared" - SHLIB_SUFFIX=".so" - AC_LIBOBJ(mkstemp) - AS_IF([test $doRpath = yes], [ - CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' - LD_SEARCH_FLAGS='-rpath "${LIB_RUNTIME_DIR}"']) - ;; - IRIX-6.*) - SHLIB_CFLAGS="" - SHLIB_LD="ld -n32 -shared -rdata_shared" - SHLIB_SUFFIX=".so" - AS_IF([test $doRpath = yes], [ - CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' - LD_SEARCH_FLAGS='-rpath "${LIB_RUNTIME_DIR}"']) - AS_IF([test "$GCC" = yes], [ - CFLAGS="$CFLAGS -mabi=n32" - LDFLAGS="$LDFLAGS -mabi=n32" - ], [ - case $system in - IRIX-6.3) - # Use to build 6.2 compatible binaries on 6.3. - CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS" - ;; - *) - CFLAGS="$CFLAGS -n32" - ;; - esac - LDFLAGS="$LDFLAGS -n32" - ]) - ;; - IRIX64-6.*) - SHLIB_CFLAGS="" - SHLIB_LD="ld -n32 -shared -rdata_shared" - SHLIB_SUFFIX=".so" - AS_IF([test $doRpath = yes], [ - CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' - LD_SEARCH_FLAGS='-rpath "${LIB_RUNTIME_DIR}"']) - - # Check to enable 64-bit flags for compiler/linker - - AS_IF([test "$do64bit" = yes], [ - AS_IF([test "$GCC" = yes], [ - AC_MSG_WARN([64bit mode not supported by gcc]) - ], [ - do64bit_ok=yes - SHLIB_LD="ld -64 -shared -rdata_shared" - CFLAGS="$CFLAGS -64" - LDFLAGS_ARCH="-64" - ]) - ]) - ;; - Linux*|GNU*|NetBSD-Debian|DragonFly-*|FreeBSD-*) - SHLIB_CFLAGS="-fPIC" - SHLIB_SUFFIX=".so" - - # TEA specific: - CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" - - # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS - SHLIB_LD='${CC} ${CFLAGS} ${LDFLAGS_DEFAULT} -shared' - LDFLAGS="$LDFLAGS -Wl,--export-dynamic" - - case $system in - DragonFly-*|FreeBSD-*) - AS_IF([test "${TCL_THREADS}" = "1"], [ - # The -pthread needs to go in the LDFLAGS, not LIBS - LIBS=`echo $LIBS | sed s/-pthread//` - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - LDFLAGS="$LDFLAGS $PTHREAD_LIBS"]) - ;; - esac - - AS_IF([test $doRpath = yes], [ - CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"']) - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - AS_IF([test "`uname -m`" = "alpha"], [CFLAGS="$CFLAGS -mieee"]) - AS_IF([test $do64bit = yes], [ - AC_CACHE_CHECK([if compiler accepts -m64 flag], tcl_cv_cc_m64, [ - hold_cflags=$CFLAGS - CFLAGS="$CFLAGS -m64" - AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])], - [tcl_cv_cc_m64=yes],[tcl_cv_cc_m64=no]) - CFLAGS=$hold_cflags]) - AS_IF([test $tcl_cv_cc_m64 = yes], [ - CFLAGS="$CFLAGS -m64" - do64bit_ok=yes - ]) - ]) - - # The combo of gcc + glibc has a bug related to inlining of - # functions like strtod(). The -fno-builtin flag should address - # this problem but it does not work. The -fno-inline flag is kind - # of overkill but it works. Disable inlining only when one of the - # files in compat/*.c is being linked in. - - AS_IF([test x"${USE_COMPAT}" != x],[CFLAGS="$CFLAGS -fno-inline"]) - ;; - Lynx*) - SHLIB_CFLAGS="-fPIC" - SHLIB_SUFFIX=".so" - CFLAGS_OPTIMIZE=-02 - SHLIB_LD='${CC} -shared' - LD_FLAGS="-Wl,--export-dynamic" - AS_IF([test $doRpath = yes], [ - CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' - LD_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"']) - ;; - OpenBSD-*) - arch=`arch -s` - case "$arch" in - alpha|sparc64) - SHLIB_CFLAGS="-fPIC" - ;; - *) - SHLIB_CFLAGS="-fpic" - ;; - esac - SHLIB_LD='${CC} ${SHLIB_CFLAGS} -shared' - SHLIB_SUFFIX=".so" - AS_IF([test $doRpath = yes], [ - CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"']) - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so${SHLIB_VERSION}' - LDFLAGS="$LDFLAGS -Wl,-export-dynamic" - CFLAGS_OPTIMIZE="-O2" - # On OpenBSD: Compile with -pthread - # Don't link with -lpthread - LIBS=`echo $LIBS | sed s/-lpthread//` - CFLAGS="$CFLAGS -pthread" - # OpenBSD doesn't do version numbers with dots. - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' - TCL_LIB_VERSIONS_OK=nodots - ;; - NetBSD-*) - # NetBSD has ELF and can use 'cc -shared' to build shared libs - SHLIB_CFLAGS="-fPIC" - SHLIB_LD='${CC} ${SHLIB_CFLAGS} -shared' - SHLIB_SUFFIX=".so" - LDFLAGS="$LDFLAGS -export-dynamic" - AS_IF([test $doRpath = yes], [ - CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"']) - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - # The -pthread needs to go in the CFLAGS, not LIBS - LIBS=`echo $LIBS | sed s/-pthread//` - CFLAGS="$CFLAGS -pthread" - LDFLAGS="$LDFLAGS -pthread" - ;; - Darwin-*) - CFLAGS_OPTIMIZE="-Os" - SHLIB_CFLAGS="-fno-common" - # To avoid discrepancies between what headers configure sees during - # preprocessing tests and compiling tests, move any -isysroot and - # -mmacosx-version-min flags from CFLAGS to CPPFLAGS: - CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \ - awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ - if ([$]i~/^(isysroot|mmacosx-version-min)/) print "-"[$]i}'`" - CFLAGS="`echo " ${CFLAGS}" | \ - awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ - if (!([$]i~/^(isysroot|mmacosx-version-min)/)) print "-"[$]i}'`" - AS_IF([test $do64bit = yes], [ - case `arch` in - ppc) - AC_CACHE_CHECK([if compiler accepts -arch ppc64 flag], - tcl_cv_cc_arch_ppc64, [ - hold_cflags=$CFLAGS - CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" - AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])], - [tcl_cv_cc_arch_ppc64=yes],[tcl_cv_cc_arch_ppc64=no]) - CFLAGS=$hold_cflags]) - AS_IF([test $tcl_cv_cc_arch_ppc64 = yes], [ - CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" - do64bit_ok=yes - ]);; - i386) - AC_CACHE_CHECK([if compiler accepts -arch x86_64 flag], - tcl_cv_cc_arch_x86_64, [ - hold_cflags=$CFLAGS - CFLAGS="$CFLAGS -arch x86_64" - AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])], - [tcl_cv_cc_arch_x86_64=yes],[tcl_cv_cc_arch_x86_64=no]) - CFLAGS=$hold_cflags]) - AS_IF([test $tcl_cv_cc_arch_x86_64 = yes], [ - CFLAGS="$CFLAGS -arch x86_64" - do64bit_ok=yes - ]);; - *) - AC_MSG_WARN([Don't know how enable 64-bit on architecture `arch`]);; - esac - ], [ - # Check for combined 32-bit and 64-bit fat build - AS_IF([echo "$CFLAGS " |grep -E -q -- '-arch (ppc64|x86_64) ' \ - && echo "$CFLAGS " |grep -E -q -- '-arch (ppc|i386) '], [ - fat_32_64=yes]) - ]) - # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS - SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}' - AC_CACHE_CHECK([if ld accepts -single_module flag], tcl_cv_ld_single_module, [ - hold_ldflags=$LDFLAGS - LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" - AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[int i;]])], - [tcl_cv_ld_single_module=yes],[tcl_cv_ld_single_module=no]) - LDFLAGS=$hold_ldflags]) - AS_IF([test $tcl_cv_ld_single_module = yes], [ - SHLIB_LD="${SHLIB_LD} -Wl,-single_module" - ]) - # TEA specific: link shlib with current and compatibility version flags - vers=`echo ${PACKAGE_VERSION} | sed -e 's/^\([[0-9]]\{1,5\}\)\(\(\.[[0-9]]\{1,3\}\)\{0,2\}\).*$/\1\2/p' -e d` - SHLIB_LD="${SHLIB_LD} -current_version ${vers:-0} -compatibility_version ${vers:-0}" - SHLIB_SUFFIX=".dylib" - LDFLAGS="$LDFLAGS -headerpad_max_install_names" - AC_CACHE_CHECK([if ld accepts -search_paths_first flag], - tcl_cv_ld_search_paths_first, [ - hold_ldflags=$LDFLAGS - LDFLAGS="$LDFLAGS -Wl,-search_paths_first" - AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[int i;]])], - [tcl_cv_ld_search_paths_first=yes],[tcl_cv_ld_search_paths_first=no]) - LDFLAGS=$hold_ldflags]) - AS_IF([test $tcl_cv_ld_search_paths_first = yes], [ - LDFLAGS="$LDFLAGS -Wl,-search_paths_first" - ]) - AS_IF([test "$tcl_cv_cc_visibility_hidden" != yes], [ - AC_DEFINE(MODULE_SCOPE, [__private_extern__], - [Compiler support for module scope symbols]) - tcl_cv_cc_visibility_hidden=yes - ]) - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" - # TEA specific: for combined 32 & 64 bit fat builds of Tk - # extensions, verify that 64-bit build is possible. - AS_IF([test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}"], [ - AS_IF([test "${TEA_WINDOWINGSYSTEM}" = x11], [ - AC_CACHE_CHECK([for 64-bit X11], tcl_cv_lib_x11_64, [ - for v in CFLAGS CPPFLAGS LDFLAGS; do - eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"' - done - CPPFLAGS="$CPPFLAGS -I/usr/X11R6/include" - LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11" - AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[XrmInitialize();]])], - [tcl_cv_lib_x11_64=yes],[tcl_cv_lib_x11_64=no]) - for v in CFLAGS CPPFLAGS LDFLAGS; do - eval $v'="$hold_'$v'"' - done]) - ]) - AS_IF([test "${TEA_WINDOWINGSYSTEM}" = aqua], [ - AC_CACHE_CHECK([for 64-bit Tk], tcl_cv_lib_tk_64, [ - for v in CFLAGS CPPFLAGS LDFLAGS; do - eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"' - done - CPPFLAGS="$CPPFLAGS -DUSE_TCL_STUBS=1 -DUSE_TK_STUBS=1 ${TCL_INCLUDES} ${TK_INCLUDES}" - LDFLAGS="$LDFLAGS ${TCL_STUB_LIB_SPEC} ${TK_STUB_LIB_SPEC}" - AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[Tk_InitStubs(NULL, "", 0);]])], - [tcl_cv_lib_tk_64=yes],[tcl_cv_lib_tk_64=no]) - for v in CFLAGS CPPFLAGS LDFLAGS; do - eval $v'="$hold_'$v'"' - done]) - ]) - # remove 64-bit arch flags from CFLAGS et al. if configuration - # does not support 64-bit. - AS_IF([test "$tcl_cv_lib_tk_64" = no -o "$tcl_cv_lib_x11_64" = no], [ - AC_MSG_NOTICE([Removing 64-bit architectures from compiler & linker flags]) - for v in CFLAGS CPPFLAGS LDFLAGS; do - eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"' - done]) - ]) - ;; - OS/390-*) - CFLAGS_OPTIMIZE="" # Optimizer is buggy - AC_DEFINE(_OE_SOCKETS, 1, # needed in sys/socket.h - [Should OS/390 do the right thing with sockets?]) - ;; - OSF1-V*) - # Digital OSF/1 - SHLIB_CFLAGS="" - AS_IF([test "$SHARED_BUILD" = 1], [ - SHLIB_LD='ld -shared -expect_unresolved "*"' - ], [ - SHLIB_LD='ld -non_shared -expect_unresolved "*"' - ]) - SHLIB_SUFFIX=".so" - AS_IF([test $doRpath = yes], [ - CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}']) - AS_IF([test "$GCC" = yes], [CFLAGS="$CFLAGS -mieee"], [ - CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee"]) - # see pthread_intro(3) for pthread support on osf1, k.furukawa - CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" - CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" - LIBS=`echo $LIBS | sed s/-lpthreads//` - AS_IF([test "$GCC" = yes], [ - LIBS="$LIBS -lpthread -lmach -lexc" - ], [ - CFLAGS="$CFLAGS -pthread" - LDFLAGS="$LDFLAGS -pthread" - ]) - ;; - QNX-6*) - # QNX RTP - # This may work for all QNX, but it was only reported for v6. - SHLIB_CFLAGS="-fPIC" - SHLIB_LD="ld -Bshareable -x" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - SCO_SV-3.2*) - AS_IF([test "$GCC" = yes], [ - SHLIB_CFLAGS="-fPIC -melf" - LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" - ], [ - SHLIB_CFLAGS="-Kpic -belf" - LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" - ]) - SHLIB_LD="ld -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - SunOS-5.[[0-6]]) - # Careful to not let 5.10+ fall into this case - - # Note: If _REENTRANT isn't defined, then Solaris - # won't define thread-safe library routines. - - AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) - AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, - [Do we really want to follow the standard? Yes we do!]) - - SHLIB_CFLAGS="-KPIC" - SHLIB_SUFFIX=".so" - AS_IF([test "$GCC" = yes], [ - SHLIB_LD='${CC} -shared' - CC_SEARCH_FLAGS='"-Wl,-R,${LIB_RUNTIME_DIR}"' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - ], [ - SHLIB_LD="/usr/ccs/bin/ld -G -z text" - CC_SEARCH_FLAGS='-R "${LIB_RUNTIME_DIR}"' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - ]) - ;; - SunOS-5*) - # Note: If _REENTRANT isn't defined, then Solaris - # won't define thread-safe library routines. - - AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) - AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, - [Do we really want to follow the standard? Yes we do!]) - - SHLIB_CFLAGS="-KPIC" - - # Check to enable 64-bit flags for compiler/linker - AS_IF([test "$do64bit" = yes], [ - arch=`isainfo` - AS_IF([test "$arch" = "sparcv9 sparc"], [ - AS_IF([test "$GCC" = yes], [ - AS_IF([test "`${CC} -dumpversion | awk -F. '{print [$]1}'`" -lt 3], [ - AC_MSG_WARN([64bit mode not supported with GCC < 3.2 on $system]) - ], [ - do64bit_ok=yes - CFLAGS="$CFLAGS -m64 -mcpu=v9" - LDFLAGS="$LDFLAGS -m64 -mcpu=v9" - SHLIB_CFLAGS="-fPIC" - ]) - ], [ - do64bit_ok=yes - AS_IF([test "$do64bitVIS" = yes], [ - CFLAGS="$CFLAGS -xarch=v9a" - LDFLAGS_ARCH="-xarch=v9a" - ], [ - CFLAGS="$CFLAGS -xarch=v9" - LDFLAGS_ARCH="-xarch=v9" - ]) - # Solaris 64 uses this as well - #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64" - ]) - ], [AS_IF([test "$arch" = "amd64 i386"], [ - AS_IF([test "$GCC" = yes], [ - case $system in - SunOS-5.1[[1-9]]*|SunOS-5.[[2-9]][[0-9]]*) - do64bit_ok=yes - CFLAGS="$CFLAGS -m64" - LDFLAGS="$LDFLAGS -m64";; - *) - AC_MSG_WARN([64bit mode not supported with GCC on $system]);; - esac - ], [ - do64bit_ok=yes - case $system in - SunOS-5.1[[1-9]]*|SunOS-5.[[2-9]][[0-9]]*) - CFLAGS="$CFLAGS -m64" - LDFLAGS="$LDFLAGS -m64";; - *) - CFLAGS="$CFLAGS -xarch=amd64" - LDFLAGS="$LDFLAGS -xarch=amd64";; - esac - ]) - ], [AC_MSG_WARN([64bit mode not supported for $arch])])]) - ]) - - SHLIB_SUFFIX=".so" - AS_IF([test "$GCC" = yes], [ - SHLIB_LD='${CC} -shared' - CC_SEARCH_FLAGS='"-Wl,-R,${LIB_RUNTIME_DIR}"' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - AS_IF([test "$do64bit_ok" = yes], [ - AS_IF([test "$arch" = "sparcv9 sparc"], [ - # We need to specify -static-libgcc or we need to - # add the path to the sparv9 libgcc. - # JH: static-libgcc is necessary for core Tcl, but may - # not be necessary for extensions. - SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc" - # for finding sparcv9 libgcc, get the regular libgcc - # path, remove so name and append 'sparcv9' - #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." - #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" - ], [AS_IF([test "$arch" = "amd64 i386"], [ - # JH: static-libgcc is necessary for core Tcl, but may - # not be necessary for extensions. - SHLIB_LD="$SHLIB_LD -m64 -static-libgcc" - ])]) - ]) - ], [ - case $system in - SunOS-5.[[1-9]][[0-9]]*) - # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS - SHLIB_LD='${CC} -G -z text ${LDFLAGS_DEFAULT}';; - *) - SHLIB_LD='/usr/ccs/bin/ld -G -z text';; - esac - CC_SEARCH_FLAGS='"-Wl,-R,${LIB_RUNTIME_DIR}"' - LD_SEARCH_FLAGS='-R "${LIB_RUNTIME_DIR}"' - ]) - ;; - UNIX_SV* | UnixWare-5*) - SHLIB_CFLAGS="-KPIC" - SHLIB_LD='${CC} -G' - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers - # that don't grok the -Bexport option. Test that it does. - AC_CACHE_CHECK([for ld accepts -Bexport flag], tcl_cv_ld_Bexport, [ - hold_ldflags=$LDFLAGS - LDFLAGS="$LDFLAGS -Wl,-Bexport" - AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[int i;]])], - [tcl_cv_ld_Bexport=yes],[tcl_cv_ld_Bexport=no]) - LDFLAGS=$hold_ldflags]) - AS_IF([test $tcl_cv_ld_Bexport = yes], [ - LDFLAGS="$LDFLAGS -Wl,-Bexport" - ]) - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - esac - - AS_IF([test "$do64bit" = yes -a "$do64bit_ok" = no], [ - AC_MSG_WARN([64bit support being disabled -- don't know magic for this platform]) - ]) - -dnl # Add any CPPFLAGS set in the environment to our CFLAGS, but delay doing so -dnl # until the end of configure, as configure's compile and link tests use -dnl # both CPPFLAGS and CFLAGS (unlike our compile and link) but configure's -dnl # preprocessing tests use only CPPFLAGS. - AC_CONFIG_COMMANDS_PRE([CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS=""]) - - # Add in the arch flags late to ensure it wasn't removed. - # Not necessary in TEA, but this is aligned with core - LDFLAGS="$LDFLAGS $LDFLAGS_ARCH" - - # If we're running gcc, then change the C flags for compiling shared - # libraries to the right flags for gcc, instead of those for the - # standard manufacturer compiler. - - AS_IF([test "$GCC" = yes], [ - case $system in - AIX-*) ;; - BSD/OS*) ;; - CYGWIN_*|MINGW32_*|MINGW64_*|MSYS_*) ;; - IRIX*) ;; - NetBSD-*|DragonFly-*|FreeBSD-*|OpenBSD-*) ;; - Darwin-*) ;; - SCO_SV-3.2*) ;; - windows) ;; - *) SHLIB_CFLAGS="-fPIC" ;; - esac]) - - AS_IF([test "$tcl_cv_cc_visibility_hidden" != yes], [ - AC_DEFINE(MODULE_SCOPE, [extern], - [No Compiler support for module scope symbols]) - ]) - - AS_IF([test "$SHARED_LIB_SUFFIX" = ""], [ - # TEA specific: use PACKAGE_VERSION instead of VERSION - SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}']) - AS_IF([test "$UNSHARED_LIB_SUFFIX" = ""], [ - # TEA specific: use PACKAGE_VERSION instead of VERSION - UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a']) - - if test "${GCC}" = "yes" -a ${SHLIB_SUFFIX} = ".dll"; then - AC_CACHE_CHECK(for SEH support in compiler, - tcl_cv_seh, - AC_RUN_IFELSE([AC_LANG_SOURCE([[ -#define WIN32_LEAN_AND_MEAN -#include -#undef WIN32_LEAN_AND_MEAN - - int main(int argc, char** argv) { - int a, b = 0; - __try { - a = 666 / b; - } - __except (EXCEPTION_EXECUTE_HANDLER) { - return 0; - } - return 1; - } - ]])], - [tcl_cv_seh=yes], - [tcl_cv_seh=no], - [tcl_cv_seh=no]) - ) - if test "$tcl_cv_seh" = "no" ; then - AC_DEFINE(HAVE_NO_SEH, 1, - [Defined when mingw does not support SEH]) - fi - - # - # Check to see if the excpt.h include file provided contains the - # definition for EXCEPTION_DISPOSITION; if not, which is the case - # with Cygwin's version as of 2002-04-10, define it to be int, - # sufficient for getting the current code to work. - # - AC_CACHE_CHECK(for EXCEPTION_DISPOSITION support in include files, - tcl_cv_eh_disposition, - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -# define WIN32_LEAN_AND_MEAN -# include -# undef WIN32_LEAN_AND_MEAN - ]], [[ - EXCEPTION_DISPOSITION x; - ]])], - [tcl_cv_eh_disposition=yes], - [tcl_cv_eh_disposition=no]) - ) - if test "$tcl_cv_eh_disposition" = "no" ; then - AC_DEFINE(EXCEPTION_DISPOSITION, int, - [Defined when cygwin/mingw does not support EXCEPTION DISPOSITION]) - fi - - # Check to see if winnt.h defines CHAR, SHORT, and LONG - # even if VOID has already been #defined. The win32api - # used by mingw and cygwin is known to do this. - - AC_CACHE_CHECK(for winnt.h that ignores VOID define, - tcl_cv_winnt_ignore_void, - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#define VOID void -#define WIN32_LEAN_AND_MEAN -#include -#undef WIN32_LEAN_AND_MEAN - ]], [[ - CHAR c; - SHORT s; - LONG l; - ]])], - [tcl_cv_winnt_ignore_void=yes], - [tcl_cv_winnt_ignore_void=no]) - ) - if test "$tcl_cv_winnt_ignore_void" = "yes" ; then - AC_DEFINE(HAVE_WINNT_IGNORE_VOID, 1, - [Defined when cygwin/mingw ignores VOID define in winnt.h]) - fi - fi - - # See if the compiler supports casting to a union type. - # This is used to stop gcc from printing a compiler - # warning when initializing a union member. - - AC_CACHE_CHECK(for cast to union support, - tcl_cv_cast_to_union, - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ - union foo { int i; double d; }; - union foo f = (union foo) (int) 0; - ]])], - [tcl_cv_cast_to_union=yes], - [tcl_cv_cast_to_union=no]) - ) - if test "$tcl_cv_cast_to_union" = "yes"; then - AC_DEFINE(HAVE_CAST_TO_UNION, 1, - [Defined when compiler supports casting to union type.]) - fi - - AC_CHECK_HEADER(stdbool.h, [AC_DEFINE(HAVE_STDBOOL_H, 1, [Do we have ?])],) - - AC_SUBST(CFLAGS_DEBUG) - AC_SUBST(CFLAGS_OPTIMIZE) - AC_SUBST(CFLAGS_WARNING) - AC_SUBST(LDFLAGS_DEBUG) - AC_SUBST(LDFLAGS_OPTIMIZE) - - AC_SUBST(STLIB_LD) - AC_SUBST(SHLIB_LD) - - AC_SUBST(SHLIB_LD_LIBS) - AC_SUBST(SHLIB_CFLAGS) - - AC_SUBST(LD_LIBRARY_PATH_VAR) - - # These must be called after we do the basic CFLAGS checks and - # verify any possible 64-bit or similar switches are necessary - TEA_TCL_EARLY_FLAGS - TEA_TCL_64BIT_FLAGS -]) - -#-------------------------------------------------------------------- -# TEA_SERIAL_PORT -# -# Determine which interface to use to talk to the serial port. -# Note that #include lines must begin in leftmost column for -# some compilers to recognize them as preprocessor directives, -# and some build environments have stdin not pointing at a -# pseudo-terminal (usually /dev/null instead.) -# -# Arguments: -# none -# -# Results: -# -# Defines only one of the following vars: -# HAVE_SYS_MODEM_H -# USE_TERMIOS -# USE_TERMIO -# USE_SGTTY -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_SERIAL_PORT], [ - AC_CHECK_HEADERS(sys/modem.h) - AC_CACHE_CHECK([termios vs. termio vs. sgtty], tcl_cv_api_serial, [ - AC_RUN_IFELSE([AC_LANG_SOURCE([[ -#include - -int main() { - struct termios t; - if (tcgetattr(0, &t) == 0) { - cfsetospeed(&t, 0); - t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB; - return 0; - } - return 1; -}]])],[tcl_cv_api_serial=termios],[tcl_cv_api_serial=no],[tcl_cv_api_serial=no]) - if test $tcl_cv_api_serial = no ; then - AC_RUN_IFELSE([AC_LANG_SOURCE([[ -#include - -int main() { - struct termio t; - if (ioctl(0, TCGETA, &t) == 0) { - t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB; - return 0; - } - return 1; -}]])],[tcl_cv_api_serial=termio],[tcl_cv_api_serial=no],[tcl_cv_api_serial=no]) - fi - if test $tcl_cv_api_serial = no ; then - AC_RUN_IFELSE([AC_LANG_SOURCE([[ -#include - -int main() { - struct sgttyb t; - if (ioctl(0, TIOCGETP, &t) == 0) { - t.sg_ospeed = 0; - t.sg_flags |= ODDP | EVENP | RAW; - return 0; - } - return 1; -}]])],[tcl_cv_api_serial=sgtty],[tcl_cv_api_serial=no],[tcl_cv_api_serial=no]) - fi - if test $tcl_cv_api_serial = no ; then - AC_RUN_IFELSE([AC_LANG_SOURCE([[ -#include -#include - -int main() { - struct termios t; - if (tcgetattr(0, &t) == 0 - || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { - cfsetospeed(&t, 0); - t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB; - return 0; - } - return 1; -}]])],[tcl_cv_api_serial=termios],[tcl_cv_api_serial=no],[tcl_cv_api_serial=no]) - fi - if test $tcl_cv_api_serial = no; then - AC_RUN_IFELSE([AC_LANG_SOURCE([[ -#include -#include - -int main() { - struct termio t; - if (ioctl(0, TCGETA, &t) == 0 - || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { - t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB; - return 0; - } - return 1; - }]])],[tcl_cv_api_serial=termio],[tcl_cv_api_serial=no],[tcl_cv_api_serial=no]) - fi - if test $tcl_cv_api_serial = no; then - AC_RUN_IFELSE([AC_LANG_SOURCE([[ -#include -#include - -int main() { - struct sgttyb t; - if (ioctl(0, TIOCGETP, &t) == 0 - || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { - t.sg_ospeed = 0; - t.sg_flags |= ODDP | EVENP | RAW; - return 0; - } - return 1; -}]])],[tcl_cv_api_serial=sgtty],[tcl_cv_api_serial=none],[tcl_cv_api_serial=none]) - fi]) - case $tcl_cv_api_serial in - termios) AC_DEFINE(USE_TERMIOS, 1, [Use the termios API for serial lines]);; - termio) AC_DEFINE(USE_TERMIO, 1, [Use the termio API for serial lines]);; - sgtty) AC_DEFINE(USE_SGTTY, 1, [Use the sgtty API for serial lines]);; - esac -]) - -#-------------------------------------------------------------------- -# TEA_PATH_X -# -# Locate the X11 header files and the X11 library archive. Try -# the ac_path_x macro first, but if it doesn't find the X stuff -# (e.g. because there's no xmkmf program) then check through -# a list of possible directories. Under some conditions the -# autoconf macro will return an include directory that contains -# no include files, so double-check its result just to be safe. -# -# This should be called after TEA_CONFIG_CFLAGS as setting the -# LIBS line can confuse some configure macro magic. -# -# Arguments: -# none -# -# Results: -# -# Sets the following vars: -# XINCLUDES -# XLIBSW -# PKG_LIBS (appends to) -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_PATH_X], [ - if test "${TEA_WINDOWINGSYSTEM}" = "x11" ; then - TEA_PATH_UNIX_X - fi -]) - -AC_DEFUN([TEA_PATH_UNIX_X], [ - AC_PATH_X - not_really_there="" - if test "$no_x" = ""; then - if test "$x_includes" = ""; then - AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include ]])],[],[not_really_there="yes"]) - else - if test ! -r $x_includes/X11/Xlib.h; then - not_really_there="yes" - fi - fi - fi - if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then - AC_MSG_CHECKING([for X11 header files]) - found_xincludes="no" - AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include ]])],[found_xincludes="yes"],[found_xincludes="no"]) - if test "$found_xincludes" = "no"; then - dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include" - for i in $dirs ; do - if test -r $i/X11/Xlib.h; then - AC_MSG_RESULT([$i]) - XINCLUDES=" -I$i" - found_xincludes="yes" - break - fi - done - fi - else - if test "$x_includes" != ""; then - XINCLUDES="-I$x_includes" - found_xincludes="yes" - fi - fi - if test "$found_xincludes" = "no"; then - AC_MSG_RESULT([couldn't find any!]) - fi - - if test "$no_x" = yes; then - AC_MSG_CHECKING([for X11 libraries]) - XLIBSW=nope - dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib" - for i in $dirs ; do - if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl -o -r $i/libX11.dylib; then - AC_MSG_RESULT([$i]) - XLIBSW="-L$i -lX11" - x_libraries="$i" - break - fi - done - else - if test "$x_libraries" = ""; then - XLIBSW=-lX11 - else - XLIBSW="-L$x_libraries -lX11" - fi - fi - if test "$XLIBSW" = nope ; then - AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow) - fi - if test "$XLIBSW" = nope ; then - AC_MSG_RESULT([could not find any! Using -lX11.]) - XLIBSW=-lX11 - fi - # TEA specific: - if test x"${XLIBSW}" != x ; then - PKG_LIBS="${PKG_LIBS} ${XLIBSW}" - fi -]) - -#-------------------------------------------------------------------- -# TEA_BLOCKING_STYLE -# -# The statements below check for systems where POSIX-style -# non-blocking I/O (O_NONBLOCK) doesn't work or is unimplemented. -# On these systems (mostly older ones), use the old BSD-style -# FIONBIO approach instead. -# -# Arguments: -# none -# -# Results: -# -# Defines some of the following vars: -# HAVE_SYS_IOCTL_H -# HAVE_SYS_FILIO_H -# USE_FIONBIO -# O_NONBLOCK -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_BLOCKING_STYLE], [ - AC_CHECK_HEADERS(sys/ioctl.h) - AC_CHECK_HEADERS(sys/filio.h) - TEA_CONFIG_SYSTEM - AC_MSG_CHECKING([FIONBIO vs. O_NONBLOCK for nonblocking I/O]) - case $system in - OSF*) - AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?]) - AC_MSG_RESULT([FIONBIO]) - ;; - *) - AC_MSG_RESULT([O_NONBLOCK]) - ;; - esac -]) - -#-------------------------------------------------------------------- -# TEA_TIME_HANDLER -# -# Checks how the system deals with time.h, what time structures -# are used on the system, and what fields the structures have. -# -# Arguments: -# none -# -# Results: -# -# Defines some of the following vars: -# USE_DELTA_FOR_TZ -# HAVE_TM_GMTOFF -# HAVE_TM_TZADJ -# HAVE_TIMEZONE_VAR -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_TIME_HANDLER], [ - AC_CHECK_HEADERS(sys/time.h) - AC_HEADER_TIME - AC_STRUCT_TIMEZONE - - AC_CHECK_FUNCS(gmtime_r localtime_r mktime) - - AC_CACHE_CHECK([tm_tzadj in struct tm], tcl_cv_member_tm_tzadj, [ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[struct tm tm; (void)tm.tm_tzadj;]])], - [tcl_cv_member_tm_tzadj=yes], - [tcl_cv_member_tm_tzadj=no])]) - if test $tcl_cv_member_tm_tzadj = yes ; then - AC_DEFINE(HAVE_TM_TZADJ, 1, [Should we use the tm_tzadj field of struct tm?]) - fi - - AC_CACHE_CHECK([tm_gmtoff in struct tm], tcl_cv_member_tm_gmtoff, [ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[struct tm tm; (void)tm.tm_gmtoff;]])], - [tcl_cv_member_tm_gmtoff=yes], - [tcl_cv_member_tm_gmtoff=no])]) - if test $tcl_cv_member_tm_gmtoff = yes ; then - AC_DEFINE(HAVE_TM_GMTOFF, 1, [Should we use the tm_gmtoff field of struct tm?]) - fi - - # - # Its important to include time.h in this check, as some systems - # (like convex) have timezone functions, etc. - # - AC_CACHE_CHECK([long timezone variable], tcl_cv_timezone_long, [ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include -#include ]], - [[extern long timezone; - timezone += 1; - exit (0);]])], - [tcl_cv_timezone_long=yes], [tcl_cv_timezone_long=no])]) - if test $tcl_cv_timezone_long = yes ; then - AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?]) - else - # - # On some systems (eg IRIX 6.2), timezone is a time_t and not a long. - # - AC_CACHE_CHECK([time_t timezone variable], tcl_cv_timezone_time, [ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include -#include ]], - [[extern time_t timezone; - timezone += 1; - exit (0);]])], - [tcl_cv_timezone_time=yes], [tcl_cv_timezone_time=no])]) - if test $tcl_cv_timezone_time = yes ; then - AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?]) - fi - fi -]) - -#-------------------------------------------------------------------- -# TEA_BUGGY_STRTOD -# -# Under Solaris 2.4, strtod returns the wrong value for the -# terminating character under some conditions. Check for this -# and if the problem exists use a substitute procedure -# "fixstrtod" (provided by Tcl) that corrects the error. -# Also, on Compaq's Tru64 Unix 5.0, -# strtod(" ") returns 0.0 instead of a failure to convert. -# -# Arguments: -# none -# -# Results: -# -# Might defines some of the following vars: -# strtod (=fixstrtod) -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_BUGGY_STRTOD], [ - AC_CHECK_FUNC(strtod, tcl_strtod=1, tcl_strtod=0) - if test "$tcl_strtod" = 1; then - AC_CACHE_CHECK([for Solaris2.4/Tru64 strtod bugs], tcl_cv_strtod_buggy,[ - AC_RUN_IFELSE([AC_LANG_SOURCE([[ - #include - extern double strtod(); - int main() { - char *infString="Inf", *nanString="NaN", *spaceString=" "; - char *term; - double value; - value = strtod(infString, &term); - if ((term != infString) && (term[-1] == 0)) { - exit(1); - } - value = strtod(nanString, &term); - if ((term != nanString) && (term[-1] == 0)) { - exit(1); - } - value = strtod(spaceString, &term); - if (term == (spaceString+1)) { - exit(1); - } - exit(0); - }]])], [tcl_cv_strtod_buggy=ok], [tcl_cv_strtod_buggy=buggy], - [tcl_cv_strtod_buggy=buggy])]) - if test "$tcl_cv_strtod_buggy" = buggy; then - AC_LIBOBJ([fixstrtod]) - USE_COMPAT=1 - AC_DEFINE(strtod, fixstrtod, [Do we want to use the strtod() in compat?]) - fi - fi -]) - -#-------------------------------------------------------------------- -# TEA_TCL_LINK_LIBS -# -# Search for the libraries needed to link the Tcl shell. -# Things like the math library (-lm), socket stuff (-lsocket vs. -# -lnsl), zlib (-lz) and libtommath (-ltommath) are dealt with here. -# -# Arguments: -# None. -# -# Results: -# -# Might append to the following vars: -# LIBS -# MATH_LIBS -# -# Might define the following vars: -# HAVE_NET_ERRNO_H -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_TCL_LINK_LIBS], [ - #-------------------------------------------------------------------- - # On a few very rare systems, all of the libm.a stuff is - # already in libc.a. Set compiler flags accordingly. - #-------------------------------------------------------------------- - - AC_CHECK_FUNC(sin, MATH_LIBS="", MATH_LIBS="-lm") - - #-------------------------------------------------------------------- - # Interactive UNIX requires -linet instead of -lsocket, plus it - # needs net/errno.h to define the socket-related error codes. - #-------------------------------------------------------------------- - - AC_CHECK_LIB(inet, main, [LIBS="$LIBS -linet"]) - AC_CHECK_HEADER(net/errno.h, [ - AC_DEFINE(HAVE_NET_ERRNO_H, 1, [Do we have ?])]) - - #-------------------------------------------------------------------- - # Check for the existence of the -lsocket and -lnsl libraries. - # The order here is important, so that they end up in the right - # order in the command line generated by make. Here are some - # special considerations: - # 1. Use "connect" and "accept" to check for -lsocket, and - # "gethostbyname" to check for -lnsl. - # 2. Use each function name only once: can't redo a check because - # autoconf caches the results of the last check and won't redo it. - # 3. Use -lnsl and -lsocket only if they supply procedures that - # aren't already present in the normal libraries. This is because - # IRIX 5.2 has libraries, but they aren't needed and they're - # bogus: they goof up name resolution if used. - # 4. On some SVR4 systems, can't use -lsocket without -lnsl too. - # To get around this problem, check for both libraries together - # if -lsocket doesn't work by itself. - #-------------------------------------------------------------------- - - tcl_checkBoth=0 - AC_CHECK_FUNC(connect, tcl_checkSocket=0, tcl_checkSocket=1) - if test "$tcl_checkSocket" = 1; then - AC_CHECK_FUNC(setsockopt, , [AC_CHECK_LIB(socket, setsockopt, - LIBS="$LIBS -lsocket", tcl_checkBoth=1)]) - fi - if test "$tcl_checkBoth" = 1; then - tk_oldLibs=$LIBS - LIBS="$LIBS -lsocket -lnsl" - AC_CHECK_FUNC(accept, tcl_checkNsl=0, [LIBS=$tk_oldLibs]) - fi - AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname, - [LIBS="$LIBS -lnsl"])]) - AC_CHECK_FUNC(mp_log_u32, , [AC_CHECK_LIB(tommath, mp_log_u32, - [LIBS="$LIBS -ltommath"])]) - AC_CHECK_FUNC(deflateSetHeader, , [AC_CHECK_LIB(z, deflateSetHeader, - [LIBS="$LIBS -lz"])]) -]) - -#-------------------------------------------------------------------- -# TEA_TCL_EARLY_FLAGS -# -# Check for what flags are needed to be passed so the correct OS -# features are available. -# -# Arguments: -# None -# -# Results: -# -# Might define the following vars: -# _ISOC99_SOURCE -# _FILE_OFFSET_BITS -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_TCL_EARLY_FLAG],[ - AC_CACHE_VAL([tcl_cv_flag_]translit($1,[A-Z],[a-z]), - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$2]], [[$3]])], - [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no,[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[[#define ]$1[ ]m4_default([$4],[1])[ -]$2]], [[$3]])], - [tcl_cv_flag_]translit($1,[A-Z],[a-z])=yes, - [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no)])) - if test ["x${tcl_cv_flag_]translit($1,[A-Z],[a-z])[}" = "xyes"] ; then - AC_DEFINE($1, m4_default([$4],[1]), [Add the ]$1[ flag when building]) - tcl_flags="$tcl_flags $1" - fi -]) - -AC_DEFUN([TEA_TCL_EARLY_FLAGS],[ - AC_MSG_CHECKING([for required early compiler flags]) - tcl_flags="" - TEA_TCL_EARLY_FLAG(_ISOC99_SOURCE,[#include ], - [char *p = (char *)strtoll; char *q = (char *)strtoull;]) - if test "${TCL_MAJOR_VERSION}" -ne 8 ; then - TEA_TCL_EARLY_FLAG(_FILE_OFFSET_BITS,[#include ], - [switch (0) { case 0: case (sizeof(off_t)==sizeof(long long)): ; }],64) - fi - if test "x${tcl_flags}" = "x" ; then - AC_MSG_RESULT([none]) - else - AC_MSG_RESULT([${tcl_flags}]) - fi -]) - -#-------------------------------------------------------------------- -# TEA_TCL_64BIT_FLAGS -# -# Check for what is defined in the way of 64-bit features. -# -# Arguments: -# None -# -# Results: -# -# Might define the following vars: -# TCL_WIDE_INT_IS_LONG -# TCL_WIDE_INT_TYPE -# HAVE_STRUCT_DIRENT64, HAVE_DIR64 -# HAVE_STRUCT_STAT64 -# HAVE_TYPE_OFF64_T -# _TIME_BITS -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_TCL_64BIT_FLAGS], [ - AC_MSG_CHECKING([for 64-bit integer type]) - AC_CACHE_VAL(tcl_cv_type_64bit,[ - tcl_cv_type_64bit=none - # See if the compiler knows natively about __int64 - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[__int64 value = (__int64) 0;]])], - [tcl_type_64bit=__int64],[tcl_type_64bit="long long"]) - # See if we could use long anyway Note that we substitute in the - # type that is our current guess for a 64-bit type inside this check - # program, so it should be modified only carefully... - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[switch (0) { - case 1: case (sizeof(${tcl_type_64bit})==sizeof(long)): ; - }]])],[tcl_cv_type_64bit=${tcl_type_64bit}],[])]) - if test "${tcl_cv_type_64bit}" = none ; then - AC_DEFINE(TCL_WIDE_INT_IS_LONG, 1, [Do 'long' and 'long long' have the same size (64-bit)?]) - AC_MSG_RESULT([yes]) - elif test "${tcl_cv_type_64bit}" = "__int64" \ - -a "${TEA_PLATFORM}" = "windows" ; then - # TEA specific: We actually want to use the default tcl.h checks in - # this case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER* - AC_MSG_RESULT([using Tcl header defaults]) - else - AC_DEFINE_UNQUOTED(TCL_WIDE_INT_TYPE,${tcl_cv_type_64bit}, - [What type should be used to define wide integers?]) - AC_MSG_RESULT([${tcl_cv_type_64bit}]) - - # Now check for auxiliary declarations - if test "${TCL_MAJOR_VERSION}" -ne 8 ; then - AC_CACHE_CHECK([for 64-bit time_t], tcl_cv_time_t_64,[ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], - [[switch (0) {case 0: case (sizeof(time_t)==sizeof(long long)): ;}]])], - [tcl_cv_time_t_64=yes],[tcl_cv_time_t_64=no])]) - if test "x${tcl_cv_time_t_64}" = "xno" ; then - # Note that _TIME_BITS=64 requires _FILE_OFFSET_BITS=64 - # which SC_TCL_EARLY_FLAGS has defined if necessary. - AC_CACHE_CHECK([if _TIME_BITS=64 enables 64-bit time_t], tcl_cv__time_bits,[ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#define _TIME_BITS 64 -#include ]], - [[switch (0) {case 0: case (sizeof(time_t)==sizeof(long long)): ;}]])], - [tcl_cv__time_bits=yes],[tcl_cv__time_bits=no])]) - if test "x${tcl_cv__time_bits}" = "xyes" ; then - AC_DEFINE(_TIME_BITS, 64, [_TIME_BITS=64 enables 64-bit time_t.]) - fi - fi - fi - - AC_CACHE_CHECK([for struct dirent64], tcl_cv_struct_dirent64,[ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include -#include ]], [[struct dirent64 p;]])], - [tcl_cv_struct_dirent64=yes],[tcl_cv_struct_dirent64=no])]) - if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then - AC_DEFINE(HAVE_STRUCT_DIRENT64, 1, [Is 'struct dirent64' in ?]) - fi - - AC_CACHE_CHECK([for DIR64], tcl_cv_DIR64,[ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include -#include ]], [[struct dirent64 *p; DIR64 d = opendir64("."); - p = readdir64(d); rewinddir64(d); closedir64(d);]])], - [tcl_cv_DIR64=yes], [tcl_cv_DIR64=no])]) - if test "x${tcl_cv_DIR64}" = "xyes" ; then - AC_DEFINE(HAVE_DIR64, 1, [Is 'DIR64' in ?]) - fi - - AC_CACHE_CHECK([for struct stat64], tcl_cv_struct_stat64,[ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[struct stat64 p; -]])], - [tcl_cv_struct_stat64=yes], [tcl_cv_struct_stat64=no])]) - if test "x${tcl_cv_struct_stat64}" = "xyes" ; then - AC_DEFINE(HAVE_STRUCT_STAT64, 1, [Is 'struct stat64' in ?]) - fi - - AC_CHECK_FUNCS(open64 lseek64) - AC_MSG_CHECKING([for off64_t]) - AC_CACHE_VAL(tcl_cv_type_off64_t,[ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[off64_t offset; -]])], - [tcl_cv_type_off64_t=yes], [tcl_cv_type_off64_t=no])]) - dnl Define HAVE_TYPE_OFF64_T only when the off64_t type and the - dnl functions lseek64 and open64 are defined. - if test "x${tcl_cv_type_off64_t}" = "xyes" && \ - test "x${ac_cv_func_lseek64}" = "xyes" && \ - test "x${ac_cv_func_open64}" = "xyes" ; then - AC_DEFINE(HAVE_TYPE_OFF64_T, 1, [Is off64_t in ?]) - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi - fi -]) - -## -## Here ends the standard Tcl configuration bits and starts the -## TEA specific functions -## - -#------------------------------------------------------------------------ -# TEA_INIT -- -# -# Init various Tcl Extension Architecture (TEA) variables. -# This should be the first called TEA_* macro. -# -# Arguments: -# none -# -# Results: -# -# Defines and substs the following vars: -# CYGPATH -# EXEEXT -# Defines only: -# TEA_VERSION -# TEA_INITED -# TEA_PLATFORM (windows or unix) -# -# "cygpath" is used on windows to generate native path names for include -# files. These variables should only be used with the compiler and linker -# since they generate native path names. -# -# EXEEXT -# Select the executable extension based on the host type. This -# is a lightweight replacement for AC_EXEEXT that doesn't require -# a compiler. -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_INIT], [ - TEA_VERSION="3.13" - - AC_MSG_CHECKING([TEA configuration]) - if test x"${PACKAGE_NAME}" = x ; then - AC_MSG_ERROR([ -The PACKAGE_NAME variable must be defined by your TEA configure.ac]) - fi - AC_MSG_RESULT([ok (TEA ${TEA_VERSION})]) - - # If the user did not set CFLAGS, set it now to keep macros - # like AC_PROG_CC and AC_TRY_COMPILE from adding "-g -O2". - if test "${CFLAGS+set}" != "set" ; then - CFLAGS="" - fi - - case "`uname -s`" in - *win32*|*WIN32*|*MINGW32_*|*MINGW64_*|*MSYS_*) - AC_CHECK_PROG(CYGPATH, cygpath, cygpath -m, echo) - EXEEXT=".exe" - TEA_PLATFORM="windows" - ;; - *CYGWIN_*) - EXEEXT=".exe" - # CYGPATH and TEA_PLATFORM are determined later in LOAD_TCLCONFIG - ;; - *) - CYGPATH=echo - # Maybe we are cross-compiling.... - case ${host_alias} in - *mingw32*) - EXEEXT=".exe" - TEA_PLATFORM="windows" - ;; - *) - EXEEXT="" - TEA_PLATFORM="unix" - ;; - esac - ;; - esac - - # Check if exec_prefix is set. If not use fall back to prefix. - # Note when adjusted, so that TEA_PREFIX can correct for this. - # This is needed for recursive configures, since autoconf propagates - # $prefix, but not $exec_prefix (doh!). - if test x$exec_prefix = xNONE ; then - exec_prefix_default=yes - exec_prefix=$prefix - fi - - AC_MSG_NOTICE([configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}]) - - AC_SUBST(EXEEXT) - AC_SUBST(CYGPATH) - - # This package name must be replaced statically for AC_SUBST to work - AC_SUBST(PKG_LIB_FILE) - AC_SUBST(PKG_LIB_FILE8) - AC_SUBST(PKG_LIB_FILE9) - - # We AC_SUBST these here to ensure they are subst'ed, - # in case the user doesn't call TEA_ADD_... - AC_SUBST(PKG_STUB_SOURCES) - AC_SUBST(PKG_STUB_OBJECTS) - AC_SUBST(PKG_TCL_SOURCES) - AC_SUBST(PKG_HEADERS) - AC_SUBST(PKG_INCLUDES) - AC_SUBST(PKG_LIBS) - AC_SUBST(PKG_CFLAGS) - - # Configure the installer. - TEA_INSTALLER -]) - -#------------------------------------------------------------------------ -# TEA_ADD_SOURCES -- -# -# Specify one or more source files. Users should check for -# the right platform before adding to their list. -# It is not important to specify the directory, as long as it is -# in the generic, win or unix subdirectory of $(srcdir). -# -# Arguments: -# one or more file names -# -# Results: -# -# Defines and substs the following vars: -# PKG_SOURCES -# PKG_OBJECTS -#------------------------------------------------------------------------ -AC_DEFUN([TEA_ADD_SOURCES], [ - vars="$@" - for i in $vars; do - case $i in - [\$]*) - # allow $-var names - PKG_SOURCES="$PKG_SOURCES $i" - PKG_OBJECTS="$PKG_OBJECTS $i" - ;; - *) - # check for existence - allows for generic/win/unix VPATH - # To add more dirs here (like 'src'), you have to update VPATH - # in Makefile.in as well - if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ - -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ - -a ! -f "${srcdir}/macosx/$i" \ - ; then - AC_MSG_ERROR([could not find source file '$i']) - fi - PKG_SOURCES="$PKG_SOURCES $i" - # this assumes it is in a VPATH dir - i=`basename $i` - # handle user calling this before or after TEA_SETUP_COMPILER - if test x"${OBJEXT}" != x ; then - j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}" - else - j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}" - fi - PKG_OBJECTS="$PKG_OBJECTS $j" - ;; - esac - done - AC_SUBST(PKG_SOURCES) - AC_SUBST(PKG_OBJECTS) -]) - -#------------------------------------------------------------------------ -# TEA_ADD_STUB_SOURCES -- -# -# Specify one or more source files. Users should check for -# the right platform before adding to their list. -# It is not important to specify the directory, as long as it is -# in the generic, win or unix subdirectory of $(srcdir). -# -# Arguments: -# one or more file names -# -# Results: -# -# Defines and substs the following vars: -# PKG_STUB_SOURCES -# PKG_STUB_OBJECTS -#------------------------------------------------------------------------ -AC_DEFUN([TEA_ADD_STUB_SOURCES], [ - vars="$@" - for i in $vars; do - # check for existence - allows for generic/win/unix VPATH - if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ - -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ - -a ! -f "${srcdir}/macosx/$i" \ - ; then - AC_MSG_ERROR([could not find stub source file '$i']) - fi - PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i" - # this assumes it is in a VPATH dir - i=`basename $i` - # handle user calling this before or after TEA_SETUP_COMPILER - if test x"${OBJEXT}" != x ; then - j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}" - else - j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}" - fi - PKG_STUB_OBJECTS="$PKG_STUB_OBJECTS $j" - done - AC_SUBST(PKG_STUB_SOURCES) - AC_SUBST(PKG_STUB_OBJECTS) -]) - -#------------------------------------------------------------------------ -# TEA_ADD_TCL_SOURCES -- -# -# Specify one or more Tcl source files. These should be platform -# independent runtime files. -# -# Arguments: -# one or more file names -# -# Results: -# -# Defines and substs the following vars: -# PKG_TCL_SOURCES -#------------------------------------------------------------------------ -AC_DEFUN([TEA_ADD_TCL_SOURCES], [ - vars="$@" - for i in $vars; do - # check for existence, be strict because it is installed - if test ! -f "${srcdir}/$i" ; then - AC_MSG_ERROR([could not find tcl source file '${srcdir}/$i']) - fi - PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i" - done - AC_SUBST(PKG_TCL_SOURCES) -]) - -#------------------------------------------------------------------------ -# TEA_ADD_HEADERS -- -# -# Specify one or more source headers. Users should check for -# the right platform before adding to their list. -# -# Arguments: -# one or more file names -# -# Results: -# -# Defines and substs the following vars: -# PKG_HEADERS -#------------------------------------------------------------------------ -AC_DEFUN([TEA_ADD_HEADERS], [ - vars="$@" - for i in $vars; do - # check for existence, be strict because it is installed - if test ! -f "${srcdir}/$i" ; then - AC_MSG_ERROR([could not find header file '${srcdir}/$i']) - fi - PKG_HEADERS="$PKG_HEADERS $i" - done - AC_SUBST(PKG_HEADERS) -]) - -#------------------------------------------------------------------------ -# TEA_ADD_INCLUDES -- -# -# Specify one or more include dirs. Users should check for -# the right platform before adding to their list. -# -# Arguments: -# one or more file names -# -# Results: -# -# Defines and substs the following vars: -# PKG_INCLUDES -#------------------------------------------------------------------------ -AC_DEFUN([TEA_ADD_INCLUDES], [ - vars="$@" - for i in $vars; do - PKG_INCLUDES="$PKG_INCLUDES $i" - done - AC_SUBST(PKG_INCLUDES) -]) - -#------------------------------------------------------------------------ -# TEA_ADD_LIBS -- -# -# Specify one or more libraries. Users should check for -# the right platform before adding to their list. For Windows, -# libraries provided in "foo.lib" format will be converted to -# "-lfoo" when using GCC (mingw). -# -# Arguments: -# one or more file names -# -# Results: -# -# Defines and substs the following vars: -# PKG_LIBS -#------------------------------------------------------------------------ -AC_DEFUN([TEA_ADD_LIBS], [ - vars="$@" - for i in $vars; do - if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then - # Convert foo.lib to -lfoo for GCC. No-op if not *.lib - i=`echo "$i" | sed -e 's/^\([[^-]].*\)\.[[lL]][[iI]][[bB]][$]/-l\1/'` - fi - PKG_LIBS="$PKG_LIBS $i" - done - AC_SUBST(PKG_LIBS) -]) - -#------------------------------------------------------------------------ -# TEA_ADD_CFLAGS -- -# -# Specify one or more CFLAGS. Users should check for -# the right platform before adding to their list. -# -# Arguments: -# one or more file names -# -# Results: -# -# Defines and substs the following vars: -# PKG_CFLAGS -#------------------------------------------------------------------------ -AC_DEFUN([TEA_ADD_CFLAGS], [ - PKG_CFLAGS="$PKG_CFLAGS $@" - AC_SUBST(PKG_CFLAGS) -]) - -#------------------------------------------------------------------------ -# TEA_ADD_CLEANFILES -- -# -# Specify one or more CLEANFILES. -# -# Arguments: -# one or more file names to clean target -# -# Results: -# -# Appends to CLEANFILES, already defined for subst in LOAD_TCLCONFIG -#------------------------------------------------------------------------ -AC_DEFUN([TEA_ADD_CLEANFILES], [ - CLEANFILES="$CLEANFILES $@" -]) - -#------------------------------------------------------------------------ -# TEA_PREFIX -- -# -# Handle the --prefix=... option by defaulting to what Tcl gave -# -# Arguments: -# none -# -# Results: -# -# If --prefix or --exec-prefix was not specified, $prefix and -# $exec_prefix will be set to the values given to Tcl when it was -# configured. -#------------------------------------------------------------------------ -AC_DEFUN([TEA_PREFIX], [ - if test "${prefix}" = "NONE"; then - prefix_default=yes - if test x"${TCL_PREFIX}" != x; then - AC_MSG_NOTICE([--prefix defaulting to TCL_PREFIX ${TCL_PREFIX}]) - prefix=${TCL_PREFIX} - else - AC_MSG_NOTICE([--prefix defaulting to /usr/local]) - prefix=/usr/local - fi - fi - if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \ - -o x"${exec_prefix_default}" = x"yes" ; then - if test x"${TCL_EXEC_PREFIX}" != x; then - AC_MSG_NOTICE([--exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}]) - exec_prefix=${TCL_EXEC_PREFIX} - else - AC_MSG_NOTICE([--exec-prefix defaulting to ${prefix}]) - exec_prefix=$prefix - fi - fi -]) - -#------------------------------------------------------------------------ -# TEA_SETUP_COMPILER_CC -- -# -# Do compiler checks the way we want. This is just a replacement -# for AC_PROG_CC in TEA configure.ac files to make them cleaner. -# -# Arguments: -# none -# -# Results: -# -# Sets up CC var and other standard bits we need to make executables. -#------------------------------------------------------------------------ -AC_DEFUN([TEA_SETUP_COMPILER_CC], [ - # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE) - # in this macro, they need to go into TEA_SETUP_COMPILER instead. - - AC_PROG_CC - AC_PROG_CPP - - #-------------------------------------------------------------------- - # Checks to see if the make program sets the $MAKE variable. - #-------------------------------------------------------------------- - - AC_PROG_MAKE_SET - - #-------------------------------------------------------------------- - # Find ranlib - #-------------------------------------------------------------------- - - AC_CHECK_TOOL(RANLIB, ranlib) - - #-------------------------------------------------------------------- - # Determines the correct binary file extension (.o, .obj, .exe etc.) - #-------------------------------------------------------------------- - - AC_OBJEXT - AC_EXEEXT -]) - -#------------------------------------------------------------------------ -# TEA_SETUP_COMPILER -- -# -# Do compiler checks that use the compiler. This must go after -# TEA_SETUP_COMPILER_CC, which does the actual compiler check. -# -# Arguments: -# none -# -# Results: -# -# Sets up CC var and other standard bits we need to make executables. -#------------------------------------------------------------------------ -AC_DEFUN([TEA_SETUP_COMPILER], [ - # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here. - AC_REQUIRE([TEA_SETUP_COMPILER_CC]) - - #------------------------------------------------------------------------ - # If we're using GCC, see if the compiler understands -pipe. If so, use it. - # It makes compiling go faster. (This is only a performance feature.) - #------------------------------------------------------------------------ - - if test -z "$no_pipe" -a -n "$GCC"; then - AC_CACHE_CHECK([if the compiler understands -pipe], - tcl_cv_cc_pipe, [ - hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[tcl_cv_cc_pipe=yes],[tcl_cv_cc_pipe=no]) - CFLAGS=$hold_cflags]) - if test $tcl_cv_cc_pipe = yes; then - CFLAGS="$CFLAGS -pipe" - fi - fi - - if test "${TCL_MAJOR_VERSION}" -lt 9 -a "${TCL_MINOR_VERSION}" -lt 7; then - AC_DEFINE(Tcl_Size, int, [Is 'Tcl_Size' in ?]) - fi - - #-------------------------------------------------------------------- - # Common compiler flag setup - #-------------------------------------------------------------------- - - AC_C_BIGENDIAN(,,,[#]) -]) - -#------------------------------------------------------------------------ -# TEA_MAKE_LIB -- -# -# Generate a line that can be used to build a shared/unshared library -# in a platform independent manner. -# -# Arguments: -# none -# -# Requires: -# -# Results: -# -# Defines the following vars: -# CFLAGS - Done late here to note disturb other AC macros -# MAKE_LIB - Command to execute to build the Tcl library; -# differs depending on whether or not Tcl is being -# compiled as a shared library. -# MAKE_SHARED_LIB Makefile rule for building a shared library -# MAKE_STATIC_LIB Makefile rule for building a static library -# MAKE_STUB_LIB Makefile rule for building a stub library -# VC_MANIFEST_EMBED_DLL Makefile rule for embedded VC manifest in DLL -# VC_MANIFEST_EMBED_EXE Makefile rule for embedded VC manifest in EXE -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_MAKE_LIB], [ - if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then - MAKE_STATIC_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_OBJECTS)" - MAKE_SHARED_LIB="\${SHLIB_LD} \${LDFLAGS} \${LDFLAGS_DEFAULT} -out:\[$]@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}" - AC_EGREP_CPP([manifest needed], [ -#if defined(_MSC_VER) && _MSC_VER >= 1400 -print("manifest needed") -#endif - ], [ - # Could do a CHECK_PROG for mt, but should always be with MSVC8+ - VC_MANIFEST_EMBED_DLL="if test -f \[$]@.manifest ; then mt.exe -nologo -manifest \[$]@.manifest -outputresource:\[$]@\;2 ; fi" - VC_MANIFEST_EMBED_EXE="if test -f \[$]@.manifest ; then mt.exe -nologo -manifest \[$]@.manifest -outputresource:\[$]@\;1 ; fi" - MAKE_SHARED_LIB="${MAKE_SHARED_LIB} ; ${VC_MANIFEST_EMBED_DLL}" - TEA_ADD_CLEANFILES([*.manifest]) - ]) - MAKE_STUB_LIB="\${STLIB_LD} -nodefaultlib -out:\[$]@ \$(PKG_STUB_OBJECTS)" - else - MAKE_STATIC_LIB="\${STLIB_LD} \[$]@ \$(PKG_OBJECTS)" - MAKE_SHARED_LIB="\${SHLIB_LD} \${LDFLAGS} \${LDFLAGS_DEFAULT} -o \[$]@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}" - MAKE_STUB_LIB="\${STLIB_LD} \[$]@ \$(PKG_STUB_OBJECTS)" - fi - - if test "${SHARED_BUILD}" = "1" ; then - MAKE_LIB="${MAKE_SHARED_LIB} " - else - MAKE_LIB="${MAKE_STATIC_LIB} " - fi - - #-------------------------------------------------------------------- - # Shared libraries and static libraries have different names. - # Use the double eval to make sure any variables in the suffix is - # substituted. (@@@ Might not be necessary anymore) - #-------------------------------------------------------------------- - - PACKAGE_LIB_PREFIX8="${PACKAGE_LIB_PREFIX}" - PACKAGE_LIB_PREFIX9="${PACKAGE_LIB_PREFIX}tcl9" - if test "${TCL_MAJOR_VERSION}" -gt 8 -a x"${with_tcl8}" = x; then - PACKAGE_LIB_PREFIX="${PACKAGE_LIB_PREFIX9}" - else - PACKAGE_LIB_PREFIX="${PACKAGE_LIB_PREFIX8}" - AC_DEFINE(TCL_MAJOR_VERSION, 8, [Compile for Tcl8?]) - fi - if test "${TEA_PLATFORM}" = "windows" ; then - if test "${SHARED_BUILD}" = "1" ; then - # We force the unresolved linking of symbols that are really in - # the private libraries of Tcl and Tk. - if test x"${TK_BIN_DIR}" != x ; then - SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\"" - fi - SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\"" - if test "$GCC" = "yes"; then - SHLIB_LD_LIBS="${SHLIB_LD_LIBS} -static-libgcc" - fi - eval eval "PKG_LIB_FILE8=${PACKAGE_LIB_PREFIX8}${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" - eval eval "PKG_LIB_FILE9=${PACKAGE_LIB_PREFIX9}${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" - eval eval "PKG_LIB_FILE=${PACKAGE_LIB_PREFIX}${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" - else - if test "$GCC" = "yes"; then - PACKAGE_LIB_PREFIX=lib${PACKAGE_LIB_PREFIX} - fi - eval eval "PKG_LIB_FILE8=${PACKAGE_LIB_PREFIX8}${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" - eval eval "PKG_LIB_FILE9=${PACKAGE_LIB_PREFIX9}${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" - eval eval "PKG_LIB_FILE=${PACKAGE_LIB_PREFIX}${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" - fi - # Some packages build their own stubs libraries - if test "${TCL_MAJOR_VERSION}" -gt 8 -a x"${with_tcl8}" = x; then - eval eval "PKG_STUB_LIB_FILE=${PACKAGE_LIB_PREFIX8}${PACKAGE_NAME}stub.a" - else - eval eval "PKG_STUB_LIB_FILE=${PACKAGE_LIB_PREFIX8}${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" - fi - if test "$GCC" = "yes"; then - PKG_STUB_LIB_FILE=lib${PKG_STUB_LIB_FILE} - fi - # These aren't needed on Windows (either MSVC or gcc) - RANLIB=: - RANLIB_STUB=: - else - RANLIB_STUB="${RANLIB}" - if test "${SHARED_BUILD}" = "1" ; then - SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}" - if test x"${TK_BIN_DIR}" != x ; then - SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}" - fi - eval eval "PKG_LIB_FILE8=lib${PACKAGE_LIB_PREFIX8}${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" - eval eval "PKG_LIB_FILE9=lib${PACKAGE_LIB_PREFIX9}${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" - eval eval "PKG_LIB_FILE=lib${PACKAGE_LIB_PREFIX}${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" - RANLIB=: - else - eval eval "PKG_LIB_FILE8=lib${PACKAGE_LIB_PREFIX8}${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" - eval eval "PKG_LIB_FILE9=lib${PACKAGE_LIB_PREFIX9}${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" - eval eval "PKG_LIB_FILE=lib${PACKAGE_LIB_PREFIX}${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" - fi - # Some packages build their own stubs libraries - if test "${TCL_MAJOR_VERSION}" -gt 8 -a x"${with_tcl8}" = x; then - eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_LIB_PREFIX8}${PACKAGE_NAME}stub.a" - else - eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_LIB_PREFIX8}${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" - fi - fi - - # These are escaped so that only CFLAGS is picked up at configure time. - # The other values will be substituted at make time. - CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}" - if test "${SHARED_BUILD}" = "1" ; then - CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}" - fi - - AC_SUBST(MAKE_LIB) - AC_SUBST(MAKE_SHARED_LIB) - AC_SUBST(MAKE_STATIC_LIB) - AC_SUBST(MAKE_STUB_LIB) - # Substitute STUB_LIB_FILE in case package creates a stub library too. - AC_SUBST(PKG_STUB_LIB_FILE) - AC_SUBST(RANLIB_STUB) - AC_SUBST(VC_MANIFEST_EMBED_DLL) - AC_SUBST(VC_MANIFEST_EMBED_EXE) -]) - -#------------------------------------------------------------------------ -# TEA_LIB_SPEC -- -# -# Compute the name of an existing object library located in libdir -# from the given base name and produce the appropriate linker flags. -# -# Arguments: -# basename The base name of the library without version -# numbers, extensions, or "lib" prefixes. -# extra_dir Extra directory in which to search for the -# library. This location is used first, then -# $prefix/$exec-prefix, then some defaults. -# -# Requires: -# TEA_INIT and TEA_PREFIX must be called first. -# -# Results: -# -# Defines the following vars: -# ${basename}_LIB_NAME The computed library name. -# ${basename}_LIB_SPEC The computed linker flags. -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_LIB_SPEC], [ - AC_MSG_CHECKING([for $1 library]) - - # Look in exec-prefix for the library (defined by TEA_PREFIX). - - tea_lib_name_dir="${exec_prefix}/lib" - - # Or in a user-specified location. - - if test x"$2" != x ; then - tea_extra_lib_dir=$2 - else - tea_extra_lib_dir=NONE - fi - - for i in \ - `ls -dr ${tea_extra_lib_dir}/$1[[0-9]]*.lib 2>/dev/null ` \ - `ls -dr ${tea_extra_lib_dir}/lib$1[[0-9]]* 2>/dev/null ` \ - `ls -dr ${tea_lib_name_dir}/$1[[0-9]]*.lib 2>/dev/null ` \ - `ls -dr ${tea_lib_name_dir}/lib$1[[0-9]]* 2>/dev/null ` \ - `ls -dr /usr/lib/$1[[0-9]]*.lib 2>/dev/null ` \ - `ls -dr /usr/lib/lib$1[[0-9]]* 2>/dev/null ` \ - `ls -dr /usr/lib64/$1[[0-9]]*.lib 2>/dev/null ` \ - `ls -dr /usr/lib64/lib$1[[0-9]]* 2>/dev/null ` \ - `ls -dr /usr/local/lib/$1[[0-9]]*.lib 2>/dev/null ` \ - `ls -dr /usr/local/lib/lib$1[[0-9]]* 2>/dev/null ` ; do - if test -f "$i" ; then - tea_lib_name_dir=`dirname $i` - $1_LIB_NAME=`basename $i` - $1_LIB_PATH_NAME=$i - break - fi - done - - if test "${TEA_PLATFORM}" = "windows"; then - $1_LIB_SPEC=\"`${CYGPATH} ${$1_LIB_PATH_NAME} 2>/dev/null`\" - else - # Strip off the leading "lib" and trailing ".a" or ".so" - - tea_lib_name_lib=`echo ${$1_LIB_NAME}|sed -e 's/^lib//' -e 's/\.[[^.]]*$//' -e 's/\.so.*//'` - $1_LIB_SPEC="-L${tea_lib_name_dir} -l${tea_lib_name_lib}" - fi - - if test "x${$1_LIB_NAME}" = x ; then - AC_MSG_ERROR([not found]) - else - AC_MSG_RESULT([${$1_LIB_SPEC}]) - fi -]) - -#------------------------------------------------------------------------ -# TEA_PRIVATE_TCL_HEADERS -- -# -# Locate the private Tcl include files -# -# Arguments: -# -# Requires: -# TCL_SRC_DIR Assumes that TEA_LOAD_TCLCONFIG has -# already been called. -# -# Results: -# -# Substitutes the following vars: -# TCL_TOP_DIR_NATIVE -# TCL_INCLUDES -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PRIVATE_TCL_HEADERS], [ - # Allow for --with-tclinclude to take effect and define ${ac_cv_c_tclh} - AC_REQUIRE([TEA_PUBLIC_TCL_HEADERS]) - AC_MSG_CHECKING([for Tcl private include files]) - - TCL_SRC_DIR_NATIVE=`${CYGPATH} ${TCL_SRC_DIR}` - TCL_TOP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}\" - - # Check to see if tclPort.h isn't already with the public headers - # Don't look for tclInt.h because that resides with tcl.h in the core - # sources, but the Port headers are in a different directory - if test "${TEA_PLATFORM}" = "windows" -a \ - -f "${ac_cv_c_tclh}/tclWinPort.h"; then - result="private headers found with public headers" - elif test "${TEA_PLATFORM}" = "unix" -a \ - -f "${ac_cv_c_tclh}/tclUnixPort.h"; then - result="private headers found with public headers" - else - TCL_GENERIC_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/generic\" - if test "${TEA_PLATFORM}" = "windows"; then - TCL_PLATFORM_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/win\" - else - TCL_PLATFORM_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/unix\" - fi - # Overwrite the previous TCL_INCLUDES as this should capture both - # public and private headers in the same set. - # We want to ensure these are substituted so as not to require - # any *_NATIVE vars be defined in the Makefile - TCL_INCLUDES="-I${TCL_GENERIC_DIR_NATIVE} -I${TCL_PLATFORM_DIR_NATIVE}" - if test "`uname -s`" = "Darwin"; then - # If Tcl was built as a framework, attempt to use - # the framework's Headers and PrivateHeaders directories - case ${TCL_DEFS} in - *TCL_FRAMEWORK*) - if test -d "${TCL_BIN_DIR}/Headers" -a \ - -d "${TCL_BIN_DIR}/PrivateHeaders"; then - TCL_INCLUDES="-I\"${TCL_BIN_DIR}/Headers\" -I\"${TCL_BIN_DIR}/PrivateHeaders\" ${TCL_INCLUDES}" - else - TCL_INCLUDES="${TCL_INCLUDES} ${TCL_INCLUDE_SPEC} `echo "${TCL_INCLUDE_SPEC}" | sed -e 's/Headers/PrivateHeaders/'`" - fi - ;; - esac - result="Using ${TCL_INCLUDES}" - else - if test ! -f "${TCL_SRC_DIR}/generic/tclInt.h" ; then - AC_MSG_ERROR([Cannot find private header tclInt.h in ${TCL_SRC_DIR}]) - fi - result="Using srcdir found in tclConfig.sh: ${TCL_SRC_DIR}" - fi - fi - - AC_SUBST(TCL_TOP_DIR_NATIVE) - - AC_SUBST(TCL_INCLUDES) - AC_MSG_RESULT([${result}]) -]) - -#------------------------------------------------------------------------ -# TEA_PUBLIC_TCL_HEADERS -- -# -# Locate the installed public Tcl header files -# -# Arguments: -# None. -# -# Requires: -# CYGPATH must be set -# -# Results: -# -# Adds a --with-tclinclude switch to configure. -# Result is cached. -# -# Substitutes the following vars: -# TCL_INCLUDES -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PUBLIC_TCL_HEADERS], [ - AC_MSG_CHECKING([for Tcl public headers]) - - AC_ARG_WITH(tclinclude, [ --with-tclinclude directory containing the public Tcl header files], with_tclinclude=${withval}) - - AC_CACHE_VAL(ac_cv_c_tclh, [ - # Use the value from --with-tclinclude, if it was given - - if test x"${with_tclinclude}" != x ; then - if test -f "${with_tclinclude}/tcl.h" ; then - ac_cv_c_tclh=${with_tclinclude} - else - AC_MSG_ERROR([${with_tclinclude} directory does not contain tcl.h]) - fi - else - list="" - if test "`uname -s`" = "Darwin"; then - # If Tcl was built as a framework, attempt to use - # the framework's Headers directory - case ${TCL_DEFS} in - *TCL_FRAMEWORK*) - list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`" - ;; - esac - fi - - # Look in the source dir only if Tcl is not installed, - # and in that situation, look there before installed locations. - if test -f "${TCL_BIN_DIR}/Makefile" ; then - list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`" - fi - - # Check order: pkg --prefix location, Tcl's --prefix location, - # relative to directory of tclConfig.sh. - - eval "temp_includedir=${includedir}" - list="$list \ - `ls -d ${temp_includedir} 2>/dev/null` \ - `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ - `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" - if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then - list="$list /usr/local/include /usr/include" - if test x"${TCL_INCLUDE_SPEC}" != x ; then - d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'` - list="$list `ls -d ${d} 2>/dev/null`" - fi - fi - for i in $list ; do - if test -f "$i/tcl.h" ; then - ac_cv_c_tclh=$i - break - fi - done - fi - ]) - - # Print a message based on how we determined the include path - - if test x"${ac_cv_c_tclh}" = x ; then - AC_MSG_ERROR([tcl.h not found. Please specify its location with --with-tclinclude]) - else - AC_MSG_RESULT([${ac_cv_c_tclh}]) - fi - - # Convert to a native path and substitute into the output files. - - INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}` - - TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" - - AC_SUBST(TCL_INCLUDES) -]) - -#------------------------------------------------------------------------ -# TEA_PRIVATE_TK_HEADERS -- -# -# Locate the private Tk include files -# -# Arguments: -# -# Requires: -# TK_SRC_DIR Assumes that TEA_LOAD_TKCONFIG has -# already been called. -# -# Results: -# -# Substitutes the following vars: -# TK_INCLUDES -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PRIVATE_TK_HEADERS], [ - # Allow for --with-tkinclude to take effect and define ${ac_cv_c_tkh} - AC_REQUIRE([TEA_PUBLIC_TK_HEADERS]) - AC_MSG_CHECKING([for Tk private include files]) - - TK_SRC_DIR_NATIVE=`${CYGPATH} ${TK_SRC_DIR}` - TK_TOP_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}\" - - # Check to see if tkPort.h isn't already with the public headers - # Don't look for tkInt.h because that resides with tk.h in the core - # sources, but the Port headers are in a different directory - if test "${TEA_PLATFORM}" = "windows" -a \ - -f "${ac_cv_c_tkh}/tkWinPort.h"; then - result="private headers found with public headers" - elif test "${TEA_PLATFORM}" = "unix" -a \ - -f "${ac_cv_c_tkh}/tkUnixPort.h"; then - result="private headers found with public headers" - else - TK_GENERIC_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/generic\" - TK_XLIB_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/xlib\" - if test "${TEA_PLATFORM}" = "windows"; then - TK_PLATFORM_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/win\" - else - TK_PLATFORM_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/unix\" - fi - # Overwrite the previous TK_INCLUDES as this should capture both - # public and private headers in the same set. - # We want to ensure these are substituted so as not to require - # any *_NATIVE vars be defined in the Makefile - TK_INCLUDES="-I${TK_GENERIC_DIR_NATIVE} -I${TK_PLATFORM_DIR_NATIVE}" - # Detect and add ttk subdir - if test -d "${TK_SRC_DIR}/generic/ttk"; then - TK_INCLUDES="${TK_INCLUDES} -I\"${TK_SRC_DIR_NATIVE}/generic/ttk\"" - fi - if test "${TEA_WINDOWINGSYSTEM}" != "x11"; then - TK_INCLUDES="${TK_INCLUDES} -I\"${TK_XLIB_DIR_NATIVE}\"" - fi - if test "${TEA_WINDOWINGSYSTEM}" = "aqua"; then - TK_INCLUDES="${TK_INCLUDES} -I\"${TK_SRC_DIR_NATIVE}/macosx\"" - fi - if test "`uname -s`" = "Darwin"; then - # If Tk was built as a framework, attempt to use - # the framework's Headers and PrivateHeaders directories - case ${TK_DEFS} in - *TK_FRAMEWORK*) - if test -d "${TK_BIN_DIR}/Headers" -a \ - -d "${TK_BIN_DIR}/PrivateHeaders"; then - TK_INCLUDES="-I\"${TK_BIN_DIR}/Headers\" -I\"${TK_BIN_DIR}/PrivateHeaders\" ${TK_INCLUDES}" - else - TK_INCLUDES="${TK_INCLUDES} ${TK_INCLUDE_SPEC} `echo "${TK_INCLUDE_SPEC}" | sed -e 's/Headers/PrivateHeaders/'`" - fi - ;; - esac - result="Using ${TK_INCLUDES}" - else - if test ! -f "${TK_SRC_DIR}/generic/tkInt.h" ; then - AC_MSG_ERROR([Cannot find private header tkInt.h in ${TK_SRC_DIR}]) - fi - result="Using srcdir found in tkConfig.sh: ${TK_SRC_DIR}" - fi - fi - - AC_SUBST(TK_TOP_DIR_NATIVE) - AC_SUBST(TK_XLIB_DIR_NATIVE) - - AC_SUBST(TK_INCLUDES) - AC_MSG_RESULT([${result}]) -]) - -#------------------------------------------------------------------------ -# TEA_PUBLIC_TK_HEADERS -- -# -# Locate the installed public Tk header files -# -# Arguments: -# None. -# -# Requires: -# CYGPATH must be set -# -# Results: -# -# Adds a --with-tkinclude switch to configure. -# Result is cached. -# -# Substitutes the following vars: -# TK_INCLUDES -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PUBLIC_TK_HEADERS], [ - AC_MSG_CHECKING([for Tk public headers]) - - AC_ARG_WITH(tkinclude, [ --with-tkinclude directory containing the public Tk header files], with_tkinclude=${withval}) - - AC_CACHE_VAL(ac_cv_c_tkh, [ - # Use the value from --with-tkinclude, if it was given - - if test x"${with_tkinclude}" != x ; then - if test -f "${with_tkinclude}/tk.h" ; then - ac_cv_c_tkh=${with_tkinclude} - else - AC_MSG_ERROR([${with_tkinclude} directory does not contain tk.h]) - fi - else - list="" - if test "`uname -s`" = "Darwin"; then - # If Tk was built as a framework, attempt to use - # the framework's Headers directory. - case ${TK_DEFS} in - *TK_FRAMEWORK*) - list="`ls -d ${TK_BIN_DIR}/Headers 2>/dev/null`" - ;; - esac - fi - - # Look in the source dir only if Tk is not installed, - # and in that situation, look there before installed locations. - if test -f "${TK_BIN_DIR}/Makefile" ; then - list="$list `ls -d ${TK_SRC_DIR}/generic 2>/dev/null`" - fi - - # Check order: pkg --prefix location, Tk's --prefix location, - # relative to directory of tkConfig.sh, Tcl's --prefix location, - # relative to directory of tclConfig.sh. - - eval "temp_includedir=${includedir}" - list="$list \ - `ls -d ${temp_includedir} 2>/dev/null` \ - `ls -d ${TK_PREFIX}/include 2>/dev/null` \ - `ls -d ${TK_BIN_DIR}/../include 2>/dev/null` \ - `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ - `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" - if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then - list="$list /usr/local/include /usr/include" - if test x"${TK_INCLUDE_SPEC}" != x ; then - d=`echo "${TK_INCLUDE_SPEC}" | sed -e 's/^-I//'` - list="$list `ls -d ${d} 2>/dev/null`" - fi - fi - for i in $list ; do - if test -f "$i/tk.h" ; then - ac_cv_c_tkh=$i - break - fi - done - fi - ]) - - # Print a message based on how we determined the include path - - if test x"${ac_cv_c_tkh}" = x ; then - AC_MSG_ERROR([tk.h not found. Please specify its location with --with-tkinclude]) - else - AC_MSG_RESULT([${ac_cv_c_tkh}]) - fi - - # Convert to a native path and substitute into the output files. - - INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tkh}` - - TK_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" - - AC_SUBST(TK_INCLUDES) - - if test "${TEA_WINDOWINGSYSTEM}" != "x11"; then - # On Windows and Aqua, we need the X compat headers - AC_MSG_CHECKING([for X11 header files]) - if test ! -r "${INCLUDE_DIR_NATIVE}/X11/Xlib.h"; then - INCLUDE_DIR_NATIVE="`${CYGPATH} ${TK_SRC_DIR}/xlib`" - TK_XINCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" - AC_SUBST(TK_XINCLUDES) - fi - AC_MSG_RESULT([${INCLUDE_DIR_NATIVE}]) - fi -]) - -#------------------------------------------------------------------------ -# TEA_PATH_CONFIG -- -# -# Locate the ${1}Config.sh file and perform a sanity check on -# the ${1} compile flags. These are used by packages like -# [incr Tk] that load *Config.sh files from more than Tcl and Tk. -# -# Arguments: -# none -# -# Results: -# -# Adds the following arguments to configure: -# --with-$1=... -# -# Defines the following vars: -# $1_BIN_DIR Full path to the directory containing -# the $1Config.sh file -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PATH_CONFIG], [ - # - # Ok, lets find the $1 configuration - # First, look for one uninstalled. - # the alternative search directory is invoked by --with-$1 - # - - if test x"${no_$1}" = x ; then - # we reset no_$1 in case something fails here - no_$1=true - AC_ARG_WITH($1, [ --with-$1 directory containing $1 configuration ($1Config.sh)], with_$1config=${withval}) - AC_MSG_CHECKING([for $1 configuration]) - AC_CACHE_VAL(ac_cv_c_$1config,[ - - # First check to see if --with-$1 was specified. - if test x"${with_$1config}" != x ; then - case ${with_$1config} in - */$1Config.sh ) - if test -f ${with_$1config}; then - AC_MSG_WARN([--with-$1 argument should refer to directory containing $1Config.sh, not to $1Config.sh itself]) - with_$1config=`echo ${with_$1config} | sed 's!/$1Config\.sh$!!'` - fi;; - esac - if test -f "${with_$1config}/$1Config.sh" ; then - ac_cv_c_$1config=`(cd ${with_$1config}; pwd)` - else - AC_MSG_ERROR([${with_$1config} directory doesn't contain $1Config.sh]) - fi - fi - - # then check for a private $1 installation - if test x"${ac_cv_c_$1config}" = x ; then - for i in \ - ../$1 \ - `ls -dr ../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ - `ls -dr ../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ - `ls -dr ../$1*[[0-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ - ../../$1 \ - `ls -dr ../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ - `ls -dr ../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ - `ls -dr ../../$1*[[0-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ - ../../../$1 \ - `ls -dr ../../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ - `ls -dr ../../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ - `ls -dr ../../../$1*[[0-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ - ${srcdir}/../$1 \ - `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ - `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ - `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ - ; do - if test -f "$i/$1Config.sh" ; then - ac_cv_c_$1config=`(cd $i; pwd)` - break - fi - if test -f "$i/unix/$1Config.sh" ; then - ac_cv_c_$1config=`(cd $i/unix; pwd)` - break - fi - done - fi - - # check in a few common install locations - if test x"${ac_cv_c_$1config}" = x ; then - for i in `ls -d ${libdir} 2>/dev/null` \ - `ls -d ${exec_prefix}/lib 2>/dev/null` \ - `ls -d ${prefix}/lib 2>/dev/null` \ - `ls -d /usr/local/lib 2>/dev/null` \ - `ls -d /usr/contrib/lib 2>/dev/null` \ - `ls -d /usr/pkg/lib 2>/dev/null` \ - `ls -d /usr/lib 2>/dev/null` \ - `ls -d /usr/lib64 2>/dev/null` \ - ; do - if test -f "$i/$1Config.sh" ; then - ac_cv_c_$1config=`(cd $i; pwd)` - break - fi - done - fi - ]) - - if test x"${ac_cv_c_$1config}" = x ; then - $1_BIN_DIR="# no $1 configs found" - AC_MSG_WARN([Cannot find $1 configuration definitions]) - exit 0 - else - no_$1= - $1_BIN_DIR=${ac_cv_c_$1config} - AC_MSG_RESULT([found $$1_BIN_DIR/$1Config.sh]) - fi - fi -]) - -#------------------------------------------------------------------------ -# TEA_LOAD_CONFIG -- -# -# Load the $1Config.sh file -# -# Arguments: -# -# Requires the following vars to be set: -# $1_BIN_DIR -# -# Results: -# -# Substitutes the following vars: -# $1_SRC_DIR -# $1_LIB_FILE -# $1_LIB_SPEC -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_LOAD_CONFIG], [ - AC_MSG_CHECKING([for existence of ${$1_BIN_DIR}/$1Config.sh]) - - if test -f "${$1_BIN_DIR}/$1Config.sh" ; then - AC_MSG_RESULT([loading]) - . "${$1_BIN_DIR}/$1Config.sh" - else - AC_MSG_RESULT([file not found]) - fi - - # - # If the $1_BIN_DIR is the build directory (not the install directory), - # then set the common variable name to the value of the build variables. - # For example, the variable $1_LIB_SPEC will be set to the value - # of $1_BUILD_LIB_SPEC. An extension should make use of $1_LIB_SPEC - # instead of $1_BUILD_LIB_SPEC since it will work with both an - # installed and uninstalled version of Tcl. - # - - if test -f "${$1_BIN_DIR}/Makefile" ; then - AC_MSG_WARN([Found Makefile - using build library specs for $1]) - $1_LIB_SPEC=${$1_BUILD_LIB_SPEC} - $1_STUB_LIB_SPEC=${$1_BUILD_STUB_LIB_SPEC} - $1_STUB_LIB_PATH=${$1_BUILD_STUB_LIB_PATH} - $1_INCLUDE_SPEC=${$1_BUILD_INCLUDE_SPEC} - $1_LIBRARY_PATH=${$1_LIBRARY_PATH} - fi - - AC_SUBST($1_VERSION) - AC_SUBST($1_BIN_DIR) - AC_SUBST($1_SRC_DIR) - - AC_SUBST($1_LIB_FILE) - AC_SUBST($1_LIB_SPEC) - - AC_SUBST($1_STUB_LIB_FILE) - AC_SUBST($1_STUB_LIB_SPEC) - AC_SUBST($1_STUB_LIB_PATH) - - # Allow the caller to prevent this auto-check by specifying any 2nd arg - AS_IF([test "x$2" = x], [ - # Check both upper and lower-case variants - # If a dev wanted non-stubs libs, this function could take an option - # to not use _STUB in the paths below - AS_IF([test "x${$1_STUB_LIB_SPEC}" = x], - [TEA_LOAD_CONFIG_LIB(translit($1,[a-z],[A-Z])_STUB)], - [TEA_LOAD_CONFIG_LIB($1_STUB)]) - ]) -]) - -#------------------------------------------------------------------------ -# TEA_LOAD_CONFIG_LIB -- -# -# Helper function to load correct library from another extension's -# ${PACKAGE}Config.sh. -# -# Results: -# Adds to LIBS the appropriate extension library -#------------------------------------------------------------------------ -AC_DEFUN([TEA_LOAD_CONFIG_LIB], [ - AC_MSG_CHECKING([For $1 library for LIBS]) - # This simplifies the use of stub libraries by automatically adding - # the stub lib to your path. Normally this would add to SHLIB_LD_LIBS, - # but this is called before CONFIG_CFLAGS. More importantly, this adds - # to PKG_LIBS, which becomes LIBS, and that is only used by SHLIB_LD. - if test "x${$1_LIB_SPEC}" != "x" ; then - if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes" ; then - TEA_ADD_LIBS([\"`${CYGPATH} ${$1_LIB_PATH}`\"]) - AC_MSG_RESULT([using $1_LIB_PATH ${$1_LIB_PATH}]) - else - TEA_ADD_LIBS([${$1_LIB_SPEC}]) - AC_MSG_RESULT([using $1_LIB_SPEC ${$1_LIB_SPEC}]) - fi - else - AC_MSG_RESULT([file not found]) - fi -]) - -#------------------------------------------------------------------------ -# TEA_EXPORT_CONFIG -- -# -# Define the data to insert into the ${PACKAGE}Config.sh file -# -# Arguments: -# -# Requires the following vars to be set: -# $1 -# -# Results: -# Substitutes the following vars: -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_EXPORT_CONFIG], [ - #-------------------------------------------------------------------- - # These are for $1Config.sh - #-------------------------------------------------------------------- - - # pkglibdir must be a fully qualified path and (not ${exec_prefix}/lib) - eval pkglibdir="[$]{libdir}/$1${PACKAGE_VERSION}" - if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then - eval $1_LIB_FLAG="-l$1${PACKAGE_VERSION}" - eval $1_STUB_LIB_FLAG="-l$1stub${PACKAGE_VERSION}" - else - eval $1_LIB_FLAG="-l$1`echo ${PACKAGE_VERSION} | tr -d .`" - eval $1_STUB_LIB_FLAG="-l$1stub`echo ${PACKAGE_VERSION} | tr -d .`" - fi - if test "${TCL_MAJOR_VERSION}" -gt 8 -a x"${with_tcl8}" = x; then - eval $1_STUB_LIB_FLAG="-l$1stub" - fi - - $1_BUILD_LIB_SPEC="-L`$CYGPATH $(pwd)` ${$1_LIB_FLAG}" - $1_LIB_SPEC="-L`$CYGPATH ${pkglibdir}` ${$1_LIB_FLAG}" - $1_BUILD_STUB_LIB_SPEC="-L`$CYGPATH $(pwd)` [$]{$1_STUB_LIB_FLAG}" - $1_STUB_LIB_SPEC="-L`$CYGPATH ${pkglibdir}` [$]{$1_STUB_LIB_FLAG}" - $1_BUILD_STUB_LIB_PATH="`$CYGPATH $(pwd)`/[$]{PKG_STUB_LIB_FILE}" - $1_STUB_LIB_PATH="`$CYGPATH ${pkglibdir}`/[$]{PKG_STUB_LIB_FILE}" - - AC_SUBST($1_BUILD_LIB_SPEC) - AC_SUBST($1_LIB_SPEC) - AC_SUBST($1_BUILD_STUB_LIB_SPEC) - AC_SUBST($1_STUB_LIB_SPEC) - AC_SUBST($1_BUILD_STUB_LIB_PATH) - AC_SUBST($1_STUB_LIB_PATH) - - AC_SUBST(MAJOR_VERSION) - AC_SUBST(MINOR_VERSION) - AC_SUBST(PATCHLEVEL) -]) - - -#------------------------------------------------------------------------ -# TEA_INSTALLER -- -# -# Configure the installer. -# -# Arguments: -# none -# -# Results: -# Substitutes the following vars: -# INSTALL -# INSTALL_DATA_DIR -# INSTALL_DATA -# INSTALL_PROGRAM -# INSTALL_SCRIPT -# INSTALL_LIBRARY -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_INSTALLER], [ - INSTALL='$(SHELL) $(srcdir)/tclconfig/install-sh -c' - INSTALL_DATA_DIR='${INSTALL} -d -m 755' - INSTALL_DATA='${INSTALL} -m 644' - INSTALL_PROGRAM='${INSTALL} -m 755' - INSTALL_SCRIPT='${INSTALL} -m 755' - - TEA_CONFIG_SYSTEM - case $system in - HP-UX-*) INSTALL_LIBRARY='${INSTALL} -m 755' ;; - *) INSTALL_LIBRARY='${INSTALL} -m 644' ;; - esac - - AC_SUBST(INSTALL) - AC_SUBST(INSTALL_DATA_DIR) - AC_SUBST(INSTALL_DATA) - AC_SUBST(INSTALL_PROGRAM) - AC_SUBST(INSTALL_SCRIPT) - AC_SUBST(INSTALL_LIBRARY) -]) - -### -# Tip 430 - ZipFS Modifications -### -#------------------------------------------------------------------------ -# TEA_ZIPFS_SUPPORT -# Locate a zip encoder installed on the system path, or none. -# -# Arguments: -# none -# -# Results: -# Substitutes the following vars: -# MACHER_PROG -# ZIP_PROG -# ZIP_PROG_OPTIONS -# ZIP_PROG_VFSSEARCH -# ZIP_INSTALL_OBJS -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_ZIPFS_SUPPORT], [ - MACHER_PROG="" - ZIP_PROG="" - ZIP_PROG_OPTIONS="" - ZIP_PROG_VFSSEARCH="" - ZIP_INSTALL_OBJS="" - - AC_MSG_CHECKING([for macher]) - AC_CACHE_VAL(ac_cv_path_macher, [ - search_path=`echo ${PATH} | sed -e 's/:/ /g'` - for dir in $search_path ; do - for j in `ls -r $dir/macher 2> /dev/null` \ - `ls -r $dir/macher 2> /dev/null` ; do - if test x"$ac_cv_path_macher" = x ; then - if test -f "$j" ; then - ac_cv_path_macher=$j - break - fi - fi - done - done - ]) - if test -f "$ac_cv_path_macher" ; then - MACHER_PROG="$ac_cv_path_macher" - AC_MSG_RESULT([$MACHER_PROG]) - AC_MSG_RESULT([Found macher in environment]) - fi - AC_MSG_CHECKING([for zip]) - AC_CACHE_VAL(ac_cv_path_zip, [ - search_path=`echo ${PATH} | sed -e 's/:/ /g'` - for dir in $search_path ; do - for j in `ls -r $dir/zip 2> /dev/null` \ - `ls -r $dir/zip 2> /dev/null` ; do - if test x"$ac_cv_path_zip" = x ; then - if test -f "$j" ; then - ac_cv_path_zip=$j - break - fi - fi - done - done - ]) - if test -f "$ac_cv_path_zip" ; then - ZIP_PROG="$ac_cv_path_zip" - AC_MSG_RESULT([$ZIP_PROG]) - ZIP_PROG_OPTIONS="-rq" - ZIP_PROG_VFSSEARCH="*" - AC_MSG_RESULT([Found INFO Zip in environment]) - # Use standard arguments for zip - else - # It is not an error if an installed version of Zip can't be located. - # We can use the locally distributed minizip instead - ZIP_PROG="./minizip${EXEEXT_FOR_BUILD}" - ZIP_PROG_OPTIONS="-o -r" - ZIP_PROG_VFSSEARCH="*" - ZIP_INSTALL_OBJS="minizip${EXEEXT_FOR_BUILD}" - AC_MSG_RESULT([No zip found on PATH. Building minizip]) - fi - AC_SUBST(MACHER_PROG) - AC_SUBST(ZIP_PROG) - AC_SUBST(ZIP_PROG_OPTIONS) - AC_SUBST(ZIP_PROG_VFSSEARCH) - AC_SUBST(ZIP_INSTALL_OBJS) -]) - -# Local Variables: -# mode: autoconf -# End: diff --git a/autoconf/tea/teaish.tcl b/autoconf/tea/teaish.tcl new file mode 100644 index 0000000000..ba56680878 --- /dev/null +++ b/autoconf/tea/teaish.tcl @@ -0,0 +1,536 @@ +# teaish.tcl configure script extension for the SQLite TCL extension + +define TEAISH_NAME sqlite +define TEAISH_PKGNAME sqlite3 +define TEAISH_LIBDIR_NAME sqlite3 +define TEAISH_LOAD_PREFIX Sqlite3; # 2nd arg to [load] +# +# Get the version... +# +define TEAISH_VERSION [proj-file-content -trim ../VERSION] +proj-assert {[string match 3.*.* [get-define TEAISH_VERSION]]} + +# +# Object for communicating certain config-time state across various +# auto.def-related pieces. +# +array set sqliteConfig [subst [proj-strip-hash-comments { + # + # The list of feature --flags which the --all flag implies. This + # requires special handling in a few places. + # + all-flag-enables {fts3 fts4 fts5 rtree geopoly} +}]] + +# +# Must return either an empty string or a list in the form accepted by +# autosetup's [options] function. +# +proc teaish-options {} { + return [proj-strip-hash-comments [subst -nocommands -nobackslashes { + with-system-sqlite=0 + => {Use the system-level sqlite instead of the copy in this tree. + WARNING: this extension's version is taken from the in-tree copy + and there is no reliable way to get the version of a system-level copy + without knowing exactly where it lives (which this script does not)} + override-sqlite-version:VERSION + => {For use with --with-system-sqlite to set the version number.} + threadsafe=1 => {Disable mutexing} + with-tempstore:=no => {Use an in-RAM database for temporary tables: never,no,yes,always} + load-extension=0 => {Enable loading of external extensions} + math=1 => {Disable math functions} + json=1 => {Disable JSON functions} + fts3 => {Enable the FTS3 extension} + fts4 => {Enable the FTS4 extension} + fts5 => {Enable the FTS5 extension} + update-limit => {Enable the UPDATE/DELETE LIMIT clause} + geopoly => {Enable the GEOPOLY extension} + rtree => {Enable the RTREE extension} + session => {Enable the SESSION extension} + all=1 => {Disable $::sqliteConfig(all-flag-enables)} + with-icu-ldflags:LDFLAGS + => {Enable SQLITE_ENABLE_ICU and add the given linker flags for the + ICU libraries. e.g. on Ubuntu systems, try '-licui18n -licuuc -licudata'.} + with-icu-cflags:CFLAGS + => {Apply extra CFLAGS/CPPFLAGS necessary for building with ICU. + e.g. -I/usr/local/include} + with-icu-config:=auto + => {Enable SQLITE_ENABLE_ICU. Value must be one of: auto, pkg-config, + /path/to/icu-config} + icu-collations=0 + => {Enable SQLITE_ENABLE_ICU_COLLATIONS. Requires --with-icu-ldflags=... + or --with-icu-config} + }]] +} + +# +# Gets called by tea-configure. Must perform any configuration work +# needed for this extension. +# +proc teaish-configure {} { + uplevel 1 {use teaish-feature-tests} + + set srcdir [get-define TEAISH_DIR] + teaish-add-src -dist -dir generic/tclsqlite3.c + teaish-add-cflags -I.. ; # for sqlite3.c + if {[proj-opt-was-provided override-sqlite-version]} { + define TEAISH_VERSION [opt-val override-sqlite-version] + msg-result "NOTICE: overriding version number: [get-define TEAISH_VERSION]" + } + + define CFLAGS [proj-get-env CFLAGS {-O2}] + sqlite-munge-cflags + + # + # Add feature flags from legacy configure.ac which are not covered by + # --flags. + # + sqlite-add-feature-flag { + -DSQLITE_3_SUFFIX_ONLY=1 + -DSQLITE_ENABLE_DESERIALIZE=1 + -DSQLITE_ENABLE_DBPAGE_VTAB=1 + -DSQLITE_ENABLE_BYTECODE_VTAB=1 + -DSQLITE_ENABLE_DBSTAT_VTAB=1 + } + + if {[opt-bool with-system-sqlite]} { + msg-result "Using system-level sqlite3." + teaish-add-cflags -DUSE_SYSTEM_SQLITE + teaish-add-ldflags -lsqlite3 + } + + sqlite-check-common-system-deps + sqlite-handle-threadsafe + sqlite-handle-tempstore + sqlite-handle-load-extension + sqlite-handle-math + sqlite-handle-icu + sqlite-handle-common-feature-flags +}; # teaish-configure + + +define OPT_FEATURE_FLAGS {} ; # -DSQLITE_OMIT/ENABLE flags. +######################################################################## +# Adds $args, if not empty, to OPT_FEATURE_FLAGS. This is intended only for holding +# -DSQLITE_ENABLE/OMIT/... flags, but that is not enforced here. +proc sqlite-add-feature-flag {args} { + if {"" ne $args} { + define-append OPT_FEATURE_FLAGS {*}$args + } +} + +######################################################################## +# Check for log(3) in libm and die with an error if it is not +# found. $featureName should be the feature name which requires that +# function (it's used only in error messages). defines LDFLAGS_MATH to +# the required linker flags (which may be empty even if the math APIs +# are found, depending on the OS). +proc sqlite-affirm-have-math {featureName} { + if {"" eq [get-define LDFLAGS_MATH ""]} { + if {![msg-quiet proj-check-function-in-lib log m]} { + user-error "Missing math APIs for $featureName" + } + define LDFLAGS_MATH [get-define lib_log ""] + undefine lib_log + } +} + +######################################################################## +# Handle various SQLITE_ENABLE/OMIT_... feature flags. +proc sqlite-handle-common-feature-flags {} { + msg-result "Feature flags..." + if {![opt-bool all]} { + # Special handling for --disable-all + foreach flag $::sqliteConfig(all-flag-enables) { + if {![proj-opt-was-provided $flag]} { + proj-opt-set $flag 0 + } + } + } + foreach {boolFlag featureFlag ifSetEvalThis} [proj-strip-hash-comments { + all {} { + # The 'all' option must be first in this list. This impl makes + # an effort to only apply flags which the user did not already + # apply, so that combinations like (--all --disable-geopoly) + # will indeed disable geopoly. There are corner cases where + # flags which depend on each other will behave in non-intuitive + # ways: + # + # --all --disable-rtree + # + # Will NOT disable geopoly, though geopoly depends on rtree. + # The --geopoly flag, though, will automatically re-enable + # --rtree, so --disable-rtree won't actually disable anything in + # that case. + foreach k $::sqliteConfig(all-flag-enables) { + if {![proj-opt-was-provided $k]} { + proj-opt-set $k 1 + } + } + } + fts3 -DSQLITE_ENABLE_FTS3 {sqlite-affirm-have-math fts3} + fts4 -DSQLITE_ENABLE_FTS4 {sqlite-affirm-have-math fts4} + fts5 -DSQLITE_ENABLE_FTS5 {sqlite-affirm-have-math fts5} + geopoly -DSQLITE_ENABLE_GEOPOLY {proj-opt-set rtree} + rtree -DSQLITE_ENABLE_RTREE {} + session {-DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_PREUPDATE_HOOK} {} + update-limit -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT {} + scanstatus -DSQLITE_ENABLE_STMT_SCANSTATUS {} + }] { + if {$boolFlag ni $::autosetup(options)} { + # Skip flags which are in the canonical build but not + # the autoconf bundle. + continue + } + proj-if-opt-truthy $boolFlag { + sqlite-add-feature-flag $featureFlag + if {0 != [eval $ifSetEvalThis] && "all" ne $boolFlag} { + msg-result " + $boolFlag" + } + } { + if {"all" ne $boolFlag} { + msg-result " - $boolFlag" + } + } + } + ######################################################################## + # Invert the above loop's logic for some SQLITE_OMIT_... cases. If + # config option $boolFlag is false, [sqlite-add-feature-flag + # $featureFlag], where $featureFlag is intended to be + # -DSQLITE_OMIT_... + foreach {boolFlag featureFlag} { + json -DSQLITE_OMIT_JSON + } { + if {[proj-opt-truthy $boolFlag]} { + msg-result " + $boolFlag" + } else { + sqlite-add-feature-flag $featureFlag + msg-result " - $boolFlag" + } + } + + sqlite-finalize-feature-flags +} + +######################################################################### +# Remove duplicates from the final feature flag sets and show them to +# the user. +proc sqlite-finalize-feature-flags {} { + set oFF [get-define OPT_FEATURE_FLAGS] + if {"" ne $oFF} { + define OPT_FEATURE_FLAGS [lsort -unique $oFF] + msg-result "Library feature flags: [get-define OPT_FEATURE_FLAGS]" + } + if {[lsearch [get-define TARGET_DEBUG ""] -DSQLITE_DEBUG=1] > -1} { + msg-result "Note: this is a debug build, so performance will suffer." + } +} + +######################################################################## +# Run checks for system-level includes and libs which are common to +# both the canonical build and the "autoconf" bundle. +# +proc sqlite-check-common-system-deps {} { + # Check for needed/wanted data types + if {0} { + # We don't need these until/unless we want to generate + # sqlite_cfg.h. The historical TEA build does not generate that + # file. + cc-with {-includes stdint.h} \ + {cc-check-types int8_t int16_t int32_t int64_t intptr_t \ + uint8_t uint16_t uint32_t uint64_t uintptr_t} + + # Check for needed/wanted functions + cc-check-functions gmtime_r isnan localtime_r localtime_s \ + malloc_usable_size strchrnul usleep utime pread pread64 pwrite pwrite64 + + # Check for needed/wanted headers + cc-check-includes \ + sys/types.h sys/stat.h dlfcn.h unistd.h \ + stdlib.h malloc.h memory.h \ + string.h strings.h \ + inttypes.h + } + + teaish-check-librt + teaish-check-libz +} + +######################################################################## +# If --enable-threadsafe is set, this adds -DSQLITE_THREADSAFE=1 to +# OPT_FEATURE_FLAGS and sets LDFLAGS_PTHREAD to the linker flags +# needed for linking pthread (possibly an empty string). If +# --enable-threadsafe is not set, adds -DSQLITE_THREADSAFE=0 to +# OPT_FEATURE_FLAGS and sets LDFLAGS_PTHREAD to an empty string. +proc sqlite-handle-threadsafe {} { + msg-checking "Support threadsafe operation? " + define LDFLAGS_PTHREAD "" + set enable 0 + if {[proj-opt-was-provided threadsafe]} { + proj-if-opt-truthy threadsafe { + if {[proj-check-function-in-lib pthread_create pthread] + && [proj-check-function-in-lib pthread_mutexattr_init pthread]} { + set enable 1 + define LDFLAGS_PTHREAD [get-define lib_pthread_create] + undefine lib_pthread_create + undefine lib_pthread_mutexattr_init + } elseif {[proj-opt-was-provided threadsafe]} { + user-error "Missing required pthread libraries. Use --disable-threadsafe to disable this check." + } else { + msg-result "pthread support not detected" + } + # Recall that LDFLAGS_PTHREAD might be empty even if pthreads if + # found because it's in -lc on some platforms. + } { + msg-result "Disabled using --disable-threadsafe" + } + } else { + # + # If user does not specify --[disable-]threadsafe then select a + # default based on whether it looks like TCL has threading + # support. + # + #puts "TCL_LIBS = [get-define TCL_LIBS]" + if {[string match *pthread* [get-define TCL_LIBS]]} { + # ^^^ FIXME: there must be a better way of testing this + set flagName "--threadsafe" + set lblAbled "en" + set enable 1 + msg-result "yes" + } else { + set flagName "--disable-threadsafe" + set lblAbled "dis" + set enable 0 + msg-result "no" + } + msg-result "NOTICE: defaulting to ${flagName} because TCL has threading ${lblAbled}abled." + # ^^^ We don't need to link against -lpthread in the is-enabled case. + } + sqlite-add-feature-flag -DSQLITE_THREADSAFE=${enable} + return $enable +} + +######################################################################## +# Handles the --enable-load-extension flag. Returns 1 if the support +# is enabled, else 0. If support for that feature is not found, a +# fatal error is triggered if --enable-load-extension is explicitly +# provided, else a loud warning is instead emitted. If +# --disable-load-extension is used, no check is performed. +# +# Makes the following environment changes: +# +# - defines LDFLAGS_DLOPEN to any linker flags needed for this +# feature. It may legally be empty on some systems where dlopen() +# is in libc. +# +# - If the feature is not available, adds +# -DSQLITE_OMIT_LOAD_EXTENSION=1 to the feature flags list. +proc sqlite-handle-load-extension {} { + define LDFLAGS_DLOPEN "" + set found 0 + proj-if-opt-truthy load-extension { + set found [proj-check-function-in-lib dlopen dl] + if {$found} { + define LDFLAGS_DLOPEN [get-define lib_dlopen] + undefine lib_dlopen + } else { + if {[proj-opt-was-provided load-extension]} { + # Explicit --enable-load-extension: fail if not found + proj-indented-notice -error { + --enable-load-extension was provided but dlopen() + not found. Use --disable-load-extension to bypass this + check. + } + } else { + # It was implicitly enabled: warn if not found + proj-indented-notice { + WARNING: dlopen() not found, so loadable module support will + be disabled. Use --disable-load-extension to bypass this + check. + } + } + } + } + if {$found} { + msg-result "Loadable extension support enabled." + } else { + msg-result "Disabling loadable extension support. Use --enable-load-extension to enable them." + sqlite-add-feature-flag -DSQLITE_OMIT_LOAD_EXTENSION=1 + } + return $found +} + +######################################################################## +# ICU - International Components for Unicode +# +# Handles these flags: +# +# --with-icu-ldflags=LDFLAGS +# --with-icu-cflags=CFLAGS +# --with-icu-config[=auto | pkg-config | /path/to/icu-config] +# --enable-icu-collations +# +# --with-icu-config values: +# +# - auto: use the first one of (pkg-config, icu-config) found on the +# system. +# - pkg-config: use only pkg-config to determine flags +# - /path/to/icu-config: use that to determine flags +# +# If --with-icu-config is used as neither pkg-config nor icu-config +# are found, fail fatally. +# +# If both --with-icu-ldflags and --with-icu-config are provided, they +# are cumulative. If neither are provided, icu-collations is not +# honored and a warning is emitted if it is provided. +# +# Design note: though we could automatically enable ICU if the +# icu-config binary or (pkg-config icu-io) are found, we specifically +# do not. ICU is always an opt-in feature. +proc sqlite-handle-icu {} { + define LDFLAGS_LIBICU [join [opt-val with-icu-ldflags ""]] + define CFLAGS_LIBICU [join [opt-val with-icu-cflags ""]] + if {[proj-opt-was-provided with-icu-config]} { + msg-result "Checking for ICU support..." + set icuConfigBin [opt-val with-icu-config] + set tryIcuConfigBin 1; # set to 0 if we end up using pkg-config + if {$icuConfigBin in {auto pkg-config}} { + uplevel 3 { use pkg-config } + if {[pkg-config-init 0] && [pkg-config icu-io]} { + # Maintenance reminder: historical docs say to use both of + # (icu-io, icu-uc). icu-uc lacks a required lib and icu-io has + # all of them on tested OSes. + set tryIcuConfigBin 0 + define LDFLAGS_LIBICU [get-define PKG_ICU_IO_LDFLAGS] + define-append LDFLAGS_LIBICU [get-define PKG_ICU_IO_LIBS] + define CFLAGS_LIBICU [get-define PKG_ICU_IO_CFLAGS] + } elseif {"pkg-config" eq $icuConfigBin} { + proj-fatal "pkg-config cannot find package icu-io" + } else { + proj-assert {"auto" eq $icuConfigBin} + } + } + if {$tryIcuConfigBin} { + if {"auto" eq $icuConfigBin} { + set icuConfigBin [proj-first-bin-of \ + /usr/local/bin/icu-config \ + /usr/bin/icu-config] + if {"" eq $icuConfigBin} { + proj-indented-notice -error { + --with-icu-config=auto cannot find (pkg-config icu-io) or icu-config binary. + On Ubuntu-like systems try: + --with-icu-ldflags='-licui18n -licuuc -licudata' + } + } + } + if {[file-isexec $icuConfigBin]} { + set x [exec $icuConfigBin --ldflags] + if {"" eq $x} { + proj-indented-notice -error \ + [subst { + $icuConfigBin --ldflags returned no data. + On Ubuntu-like systems try: + --with-icu-ldflags='-licui18n -licuuc -licudata' + }] + } + define-append LDFLAGS_LIBICU $x + set x [exec $icuConfigBin --cppflags] + define-append CFLAGS_LIBICU $x + } else { + proj-fatal "--with-icu-config=$icuConfigBin does not refer to an executable" + } + } + } + set ldflags [define LDFLAGS_LIBICU [string trim [get-define LDFLAGS_LIBICU]]] + set cflags [define CFLAGS_LIBICU [string trim [get-define CFLAGS_LIBICU]]] + if {"" ne $ldflags} { + sqlite-add-feature-flag -DSQLITE_ENABLE_ICU + msg-result "Enabling ICU support with flags: $ldflags $cflags" + if {[opt-bool icu-collations]} { + msg-result "Enabling ICU collations." + sqlite-add-feature-flag -DSQLITE_ENABLE_ICU_COLLATIONS + } + } elseif {[opt-bool icu-collations]} { + proj-warn "ignoring --enable-icu-collations because neither --with-icu-ldflags nor --with-icu-config provided any linker flags" + } else { + msg-result "ICU support is disabled." + } +}; # sqlite-handle-icu + + +######################################################################## +# Handles the --with-tempstore flag. +# +# The test fixture likes to set SQLITE_TEMP_STORE on its own, so do +# not set that feature flag unless it was explicitly provided to the +# configure script. +proc sqlite-handle-tempstore {} { + if {[proj-opt-was-provided with-tempstore]} { + set ts [opt-val with-tempstore no] + set tsn 1 + msg-checking "Use an in-RAM database for temporary tables? " + switch -exact -- $ts { + never { set tsn 0 } + no { set tsn 1 } + yes { set tsn 2 } + always { set tsn 3 } + default { + user-error "Invalid --with-tempstore value '$ts'. Use one of: never, no, yes, always" + } + } + msg-result $ts + sqlite-add-feature-flag -DSQLITE_TEMP_STORE=$tsn + } +} + +######################################################################## +# Handles the --enable-math flag. +proc sqlite-handle-math {} { + proj-if-opt-truthy math { + if {![proj-check-function-in-lib ceil m]} { + user-error "Cannot find libm functions. Use --disable-math to bypass this." + } + set lfl [get-define lib_ceil] + undefine lib_ceil + define LDFLAGS_MATH $lfl + teaish-prepend-ldflags $lfl + sqlite-add-feature-flag -DSQLITE_ENABLE_MATH_FUNCTIONS + msg-result "Enabling math SQL functions" + } { + define LDFLAGS_MATH "" + msg-result "Disabling math SQL functions" + } +} + +######################################################################## +# Move -DSQLITE_OMIT... and -DSQLITE_ENABLE... flags from CFLAGS and +# CPPFLAGS to OPT_FEATURE_FLAGS and remove them from BUILD_CFLAGS. +proc sqlite-munge-cflags {} { + # Move CFLAGS and CPPFLAGS entries matching -DSQLITE_OMIT* and + # -DSQLITE_ENABLE* to OPT_FEATURE_FLAGS. This behavior is derived + # from the legacy build and was missing the 3.48.0 release (the + # initial Autosetup port). + # https://sqlite.org/forum/forumpost/9801e54665afd728 + # + # Handling of CPPFLAGS, as well as removing ENABLE/OMIT from + # CFLAGS/CPPFLAGS, was missing in the 3.49.0 release as well. + # + # If any configure flags for features are in conflict with + # CFLAGS/CPPFLAGS-specified feature flags, all bets are off. There + # are no guarantees about which one will take precedence. + foreach flagDef {CFLAGS CPPFLAGS} { + set tmp "" + foreach cf [get-define $flagDef ""] { + switch -glob -- $cf { + -DSQLITE_OMIT* - + -DSQLITE_ENABLE* { + sqlite-add-feature-flag $cf + } + default { + lappend tmp $cf + } + } + } + define $flagDef $tmp + } +} diff --git a/autoconf/tea/teaish.tester.tcl.in b/autoconf/tea/teaish.tester.tcl.in new file mode 100644 index 0000000000..c2ff76476a --- /dev/null +++ b/autoconf/tea/teaish.tester.tcl.in @@ -0,0 +1,13 @@ +# -*- tcl -*- +# Automatically generated - do not edit +# +# This is the wrapper script invoked by teaish's "make test" recipe. +load [lindex $::argv 0] [lindex $::argv 1]; source [lindex $::argv 2] +@if TEAISH_PKGINIT_TCL +apply {{} {set dir [file dirname $::argv0]; source @TEAISH_PKGINIT_TCL@}} +@endif +@if TEAISH_TEST_TCL +source @TEAISH_TEST_TCL@ +@else +puts "Extension successfully loaded" +@endif diff --git a/autoconf/tea/win/makefile.vc b/autoconf/tea/win/makefile.vc deleted file mode 100644 index bb32f1a75c..0000000000 --- a/autoconf/tea/win/makefile.vc +++ /dev/null @@ -1,61 +0,0 @@ -#------------------------------------------------------------- -*- makefile -*- -# -# Sample makefile for building Tcl extensions. -# -# Basic build, test and install -# nmake /s /nologo /f makefile.vc INSTALLDIR=c:\path\to\tcl -# nmake /s /nologo /f makefile.vc INSTALLDIR=c:\path\to\tcl test -# nmake /s /nologo /f makefile.vc INSTALLDIR=c:\path\to\tcl install -# -# For other build options (debug, static etc.) -# See TIP 477 (https://core.tcl.tk/tips/doc/trunk/tip/477.md) for -# detailed documentation. -# -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# -#------------------------------------------------------------------------------ - -# PROJECT is sqlite, not sqlite3 to match TEA AC_INIT definition. -# This makes the generated DLL name also consistent between the two -# except for the "t" suffix which is the convention for nmake builds. -PROJECT = sqlite -PRJ_PACKAGE_TCLNAME = sqlite3 - -!include "rules-ext.vc" - -PRJ_OBJS = $(TMP_DIR)\tclsqlite3.obj - -# Preprocessor macros specific to sqlite3. -PRJ_DEFINES = -I"$(ROOT)\.." -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \ - -DSQLITE_ENABLE_DBPAGE_VTAB=1 -DSQLITE_ENABLE_DBSTAT_VTAB=1 \ - -DSQLITE_ENABLE_FTS3_PARENTHESIS=1 -DSQLITE_ENABLE_FTS4=1 \ - -DSQLITE_ENABLE_FTS5=1 -DSQLITE_ENABLE_COLUMN_METADATA=1 \ - -DSQLITE_ENABLE_JSON1=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS=1 \ - -DSQLITE_3_SUFFIX_ONLY=1 -DSQLITE_ENABLE_RTREE=1 \ - -DSQLITE_UNTESTABLE=1 -DSQLITE_OMIT_LOOKASIDE=1 \ - -DSQLITE_SECURE_DELETE=1 -DSQLITE_SOUNDEX=1 -DSQLITE_ENABLE_GEOPOLY=1 \ - -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT=1 \ - -DSQLITE_ENABLE_MATH_FUNCTIONS=1 -DDSQLITE_USE_ALLOCA=1 \ - -DSQLITE_ENABLE_STAT4=1 -DSQLITE_OMIT_DEPRECATED=1 \ - -DSQLITE_WIN32_GETVERSIONEX=0 -DSQLITE_WIN32_NO_ANSI=1 -PRJ_DEFINES = $(PRJ_DEFINES) -I$(TMP_DIR) - -# Standard targets to build, install, test etc. -!include "$(_RULESDIR)\targets.vc" - -# The built-in pkgindex does no suffice for our extension as -# the PROJECT name (sqlite) is not same as init function name (Sqlite3) -pkgindex: - @echo if {[package vsatisfies [package provide Tcl] 9.0-]} { > $(OUT_DIR)\pkgIndex.tcl - @echo package ifneeded $(PRJ_PACKAGE_TCLNAME) $(DOTVERSION) \ - [list load [file join $$dir $(PRJLIBNAME9)] [string totitle $(PRJ_PACKAGE_TCLNAME)]] >> $(OUT_DIR)\pkgIndex.tcl - @echo } else { >> $(OUT_DIR)\pkgIndex.tcl - @echo package ifneeded $(PRJ_PACKAGE_TCLNAME) $(DOTVERSION) \ - [list load [file join $$dir $(PRJLIBNAME8)] [string totitle $(PRJ_PACKAGE_TCLNAME)]] >> $(OUT_DIR)\pkgIndex.tcl - @echo } >> $(OUT_DIR)\pkgIndex.tcl - -# Install the manpage though on Windows, doubt it does much good -install: default-install-docs-n - -# Explicit dependency rules diff --git a/autoconf/tea/win/nmakehlp.c b/autoconf/tea/win/nmakehlp.c deleted file mode 100644 index 2dc33cc657..0000000000 --- a/autoconf/tea/win/nmakehlp.c +++ /dev/null @@ -1,815 +0,0 @@ -/* - * ---------------------------------------------------------------------------- - * nmakehlp.c -- - * - * This is used to fix limitations within nmake and the environment. - * - * Copyright (c) 2002 by David Gravereaux. - * Copyright (c) 2006 by Pat Thoyts - * - * See the file "license.terms" for information on usage and redistribution of - * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * ---------------------------------------------------------------------------- - */ - -#define _CRT_SECURE_NO_DEPRECATE -#include -#ifdef _MSC_VER -#pragma comment (lib, "user32.lib") -#pragma comment (lib, "kernel32.lib") -#endif -#include -#include - -/* - * This library is required for x64 builds with _some_ versions of MSVC - */ -#if defined(_M_IA64) || defined(_M_AMD64) -#if _MSC_VER >= 1400 && _MSC_VER < 1500 -#pragma comment(lib, "bufferoverflowU") -#endif -#endif - -/* ISO hack for dumb VC++ */ -#ifdef _MSC_VER -#define snprintf _snprintf -#endif - - -/* protos */ - -static int CheckForCompilerFeature(const char *option); -static int CheckForLinkerFeature(char **options, int count); -static int IsIn(const char *string, const char *substring); -static int SubstituteFile(const char *substs, const char *filename); -static int QualifyPath(const char *path); -static int LocateDependency(const char *keyfile); -static const char *GetVersionFromFile(const char *filename, const char *match, int numdots); -static DWORD WINAPI ReadFromPipe(LPVOID args); - -/* globals */ - -#define CHUNK 25 -#define STATICBUFFERSIZE 1000 -typedef struct { - HANDLE pipe; - char buffer[STATICBUFFERSIZE]; -} pipeinfo; - -pipeinfo Out = {INVALID_HANDLE_VALUE, ""}; -pipeinfo Err = {INVALID_HANDLE_VALUE, ""}; - -/* - * exitcodes: 0 == no, 1 == yes, 2 == error - */ - -int -main( - int argc, - char *argv[]) -{ - char msg[300]; - DWORD dwWritten; - int chars; - const char *s; - - /* - * Make sure children (cl.exe and link.exe) are kept quiet. - */ - - SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX); - - /* - * Make sure the compiler and linker aren't effected by the outside world. - */ - - SetEnvironmentVariable("CL", ""); - SetEnvironmentVariable("LINK", ""); - - if (argc > 1 && *argv[1] == '-') { - switch (*(argv[1]+1)) { - case 'c': - if (argc != 3) { - chars = snprintf(msg, sizeof(msg) - 1, - "usage: %s -c \n" - "Tests for whether cl.exe supports an option\n" - "exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]); - WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, - &dwWritten, NULL); - return 2; - } - return CheckForCompilerFeature(argv[2]); - case 'l': - if (argc < 3) { - chars = snprintf(msg, sizeof(msg) - 1, - "usage: %s -l ? ...?\n" - "Tests for whether link.exe supports an option\n" - "exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]); - WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, - &dwWritten, NULL); - return 2; - } - return CheckForLinkerFeature(&argv[2], argc-2); - case 'f': - if (argc == 2) { - chars = snprintf(msg, sizeof(msg) - 1, - "usage: %s -f \n" - "Find a substring within another\n" - "exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]); - WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, - &dwWritten, NULL); - return 2; - } else if (argc == 3) { - /* - * If the string is blank, there is no match. - */ - - return 0; - } else { - return IsIn(argv[2], argv[3]); - } - case 's': - if (argc == 2) { - chars = snprintf(msg, sizeof(msg) - 1, - "usage: %s -s \n" - "Perform a set of string map type substutitions on a file\n" - "exitcodes: 0\n", - argv[0]); - WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, - &dwWritten, NULL); - return 2; - } - return SubstituteFile(argv[2], argv[3]); - case 'V': - if (argc != 4) { - chars = snprintf(msg, sizeof(msg) - 1, - "usage: %s -V filename matchstring\n" - "Extract a version from a file:\n" - "eg: pkgIndex.tcl \"package ifneeded http\"", - argv[0]); - WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, - &dwWritten, NULL); - return 0; - } - s = GetVersionFromFile(argv[2], argv[3], *(argv[1]+2) - '0'); - if (s && *s) { - printf("%s\n", s); - return 0; - } else - return 1; /* Version not found. Return non-0 exit code */ - - case 'Q': - if (argc != 3) { - chars = snprintf(msg, sizeof(msg) - 1, - "usage: %s -Q path\n" - "Emit the fully qualified path\n" - "exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]); - WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, - &dwWritten, NULL); - return 2; - } - return QualifyPath(argv[2]); - - case 'L': - if (argc != 3) { - chars = snprintf(msg, sizeof(msg) - 1, - "usage: %s -L keypath\n" - "Emit the fully qualified path of directory containing keypath\n" - "exitcodes: 0 == success, 1 == not found, 2 == error\n", argv[0]); - WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, - &dwWritten, NULL); - return 2; - } - return LocateDependency(argv[2]); - } - } - chars = snprintf(msg, sizeof(msg) - 1, - "usage: %s -c|-f|-l|-Q|-s|-V ...\n" - "This is a little helper app to equalize shell differences between WinNT and\n" - "Win9x and get nmake.exe to accomplish its job.\n", - argv[0]); - WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL); - return 2; -} - -static int -CheckForCompilerFeature( - const char *option) -{ - STARTUPINFO si; - PROCESS_INFORMATION pi; - SECURITY_ATTRIBUTES sa; - DWORD threadID; - char msg[300]; - BOOL ok; - HANDLE hProcess, h, pipeThreads[2]; - char cmdline[100]; - - hProcess = GetCurrentProcess(); - - ZeroMemory(&pi, sizeof(PROCESS_INFORMATION)); - ZeroMemory(&si, sizeof(STARTUPINFO)); - si.cb = sizeof(STARTUPINFO); - si.dwFlags = STARTF_USESTDHANDLES; - si.hStdInput = INVALID_HANDLE_VALUE; - - ZeroMemory(&sa, sizeof(SECURITY_ATTRIBUTES)); - sa.nLength = sizeof(SECURITY_ATTRIBUTES); - sa.lpSecurityDescriptor = NULL; - sa.bInheritHandle = FALSE; - - /* - * Create a non-inheritible pipe. - */ - - CreatePipe(&Out.pipe, &h, &sa, 0); - - /* - * Dupe the write side, make it inheritible, and close the original. - */ - - DuplicateHandle(hProcess, h, hProcess, &si.hStdOutput, 0, TRUE, - DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE); - - /* - * Same as above, but for the error side. - */ - - CreatePipe(&Err.pipe, &h, &sa, 0); - DuplicateHandle(hProcess, h, hProcess, &si.hStdError, 0, TRUE, - DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE); - - /* - * Base command line. - */ - - lstrcpy(cmdline, "cl.exe -nologo -c -TC -Zs -X -Fp.\\_junk.pch "); - - /* - * Append our option for testing - */ - - lstrcat(cmdline, option); - - /* - * Filename to compile, which exists, but is nothing and empty. - */ - - lstrcat(cmdline, " .\\nul"); - - ok = CreateProcess( - NULL, /* Module name. */ - cmdline, /* Command line. */ - NULL, /* Process handle not inheritable. */ - NULL, /* Thread handle not inheritable. */ - TRUE, /* yes, inherit handles. */ - DETACHED_PROCESS, /* No console for you. */ - NULL, /* Use parent's environment block. */ - NULL, /* Use parent's starting directory. */ - &si, /* Pointer to STARTUPINFO structure. */ - &pi); /* Pointer to PROCESS_INFORMATION structure. */ - - if (!ok) { - DWORD err = GetLastError(); - int chars = snprintf(msg, sizeof(msg) - 1, - "Tried to launch: \"%s\", but got error [%u]: ", cmdline, err); - - FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS| - FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPSTR)&msg[chars], - (300-chars), 0); - WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, lstrlen(msg), &err,NULL); - return 2; - } - - /* - * Close our references to the write handles that have now been inherited. - */ - - CloseHandle(si.hStdOutput); - CloseHandle(si.hStdError); - - WaitForInputIdle(pi.hProcess, 5000); - CloseHandle(pi.hThread); - - /* - * Start the pipe reader threads. - */ - - pipeThreads[0] = CreateThread(NULL, 0, ReadFromPipe, &Out, 0, &threadID); - pipeThreads[1] = CreateThread(NULL, 0, ReadFromPipe, &Err, 0, &threadID); - - /* - * Block waiting for the process to end. - */ - - WaitForSingleObject(pi.hProcess, INFINITE); - CloseHandle(pi.hProcess); - - /* - * Wait for our pipe to get done reading, should it be a little slow. - */ - - WaitForMultipleObjects(2, pipeThreads, TRUE, 500); - CloseHandle(pipeThreads[0]); - CloseHandle(pipeThreads[1]); - - /* - * Look for the commandline warning code in both streams. - * - in MSVC 6 & 7 we get D4002, in MSVC 8 we get D9002. - */ - - return !(strstr(Out.buffer, "D4002") != NULL - || strstr(Err.buffer, "D4002") != NULL - || strstr(Out.buffer, "D9002") != NULL - || strstr(Err.buffer, "D9002") != NULL - || strstr(Out.buffer, "D2021") != NULL - || strstr(Err.buffer, "D2021") != NULL); -} - -static int -CheckForLinkerFeature( - char **options, - int count) -{ - STARTUPINFO si; - PROCESS_INFORMATION pi; - SECURITY_ATTRIBUTES sa; - DWORD threadID; - char msg[300]; - BOOL ok; - HANDLE hProcess, h, pipeThreads[2]; - int i; - char cmdline[255]; - - hProcess = GetCurrentProcess(); - - ZeroMemory(&pi, sizeof(PROCESS_INFORMATION)); - ZeroMemory(&si, sizeof(STARTUPINFO)); - si.cb = sizeof(STARTUPINFO); - si.dwFlags = STARTF_USESTDHANDLES; - si.hStdInput = INVALID_HANDLE_VALUE; - - ZeroMemory(&sa, sizeof(SECURITY_ATTRIBUTES)); - sa.nLength = sizeof(SECURITY_ATTRIBUTES); - sa.lpSecurityDescriptor = NULL; - sa.bInheritHandle = TRUE; - - /* - * Create a non-inheritible pipe. - */ - - CreatePipe(&Out.pipe, &h, &sa, 0); - - /* - * Dupe the write side, make it inheritible, and close the original. - */ - - DuplicateHandle(hProcess, h, hProcess, &si.hStdOutput, 0, TRUE, - DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE); - - /* - * Same as above, but for the error side. - */ - - CreatePipe(&Err.pipe, &h, &sa, 0); - DuplicateHandle(hProcess, h, hProcess, &si.hStdError, 0, TRUE, - DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE); - - /* - * Base command line. - */ - - lstrcpy(cmdline, "link.exe -nologo "); - - /* - * Append our option for testing. - */ - - for (i = 0; i < count; i++) { - lstrcat(cmdline, " \""); - lstrcat(cmdline, options[i]); - lstrcat(cmdline, "\""); - } - - ok = CreateProcess( - NULL, /* Module name. */ - cmdline, /* Command line. */ - NULL, /* Process handle not inheritable. */ - NULL, /* Thread handle not inheritable. */ - TRUE, /* yes, inherit handles. */ - DETACHED_PROCESS, /* No console for you. */ - NULL, /* Use parent's environment block. */ - NULL, /* Use parent's starting directory. */ - &si, /* Pointer to STARTUPINFO structure. */ - &pi); /* Pointer to PROCESS_INFORMATION structure. */ - - if (!ok) { - DWORD err = GetLastError(); - int chars = snprintf(msg, sizeof(msg) - 1, - "Tried to launch: \"%s\", but got error [%u]: ", cmdline, err); - - FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS| - FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPSTR)&msg[chars], - (300-chars), 0); - WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, lstrlen(msg), &err,NULL); - return 2; - } - - /* - * Close our references to the write handles that have now been inherited. - */ - - CloseHandle(si.hStdOutput); - CloseHandle(si.hStdError); - - WaitForInputIdle(pi.hProcess, 5000); - CloseHandle(pi.hThread); - - /* - * Start the pipe reader threads. - */ - - pipeThreads[0] = CreateThread(NULL, 0, ReadFromPipe, &Out, 0, &threadID); - pipeThreads[1] = CreateThread(NULL, 0, ReadFromPipe, &Err, 0, &threadID); - - /* - * Block waiting for the process to end. - */ - - WaitForSingleObject(pi.hProcess, INFINITE); - CloseHandle(pi.hProcess); - - /* - * Wait for our pipe to get done reading, should it be a little slow. - */ - - WaitForMultipleObjects(2, pipeThreads, TRUE, 500); - CloseHandle(pipeThreads[0]); - CloseHandle(pipeThreads[1]); - - /* - * Look for the commandline warning code in the stderr stream. - */ - - return !(strstr(Out.buffer, "LNK1117") != NULL || - strstr(Err.buffer, "LNK1117") != NULL || - strstr(Out.buffer, "LNK4044") != NULL || - strstr(Err.buffer, "LNK4044") != NULL || - strstr(Out.buffer, "LNK4224") != NULL || - strstr(Err.buffer, "LNK4224") != NULL); -} - -static DWORD WINAPI -ReadFromPipe( - LPVOID args) -{ - pipeinfo *pi = (pipeinfo *) args; - char *lastBuf = pi->buffer; - DWORD dwRead; - BOOL ok; - - again: - if (lastBuf - pi->buffer + CHUNK > STATICBUFFERSIZE) { - CloseHandle(pi->pipe); - return (DWORD)-1; - } - ok = ReadFile(pi->pipe, lastBuf, CHUNK, &dwRead, 0L); - if (!ok || dwRead == 0) { - CloseHandle(pi->pipe); - return 0; - } - lastBuf += dwRead; - goto again; - - return 0; /* makes the compiler happy */ -} - -static int -IsIn( - const char *string, - const char *substring) -{ - return (strstr(string, substring) != NULL); -} - -/* - * GetVersionFromFile -- - * Looks for a match string in a file and then returns the version - * following the match where a version is anything acceptable to - * package provide or package ifneeded. - */ - -static const char * -GetVersionFromFile( - const char *filename, - const char *match, - int numdots) -{ - static char szBuffer[100]; - char *szResult = NULL; - FILE *fp = fopen(filename, "rt"); - - if (fp != NULL) { - /* - * Read data until we see our match string. - */ - - while (fgets(szBuffer, sizeof(szBuffer), fp) != NULL) { - LPSTR p, q; - - p = strstr(szBuffer, match); - if (p != NULL) { - /* - * Skip to first digit after the match. - */ - - p += strlen(match); - while (*p && !isdigit((unsigned char)*p)) { - ++p; - } - - /* - * Find ending whitespace. - */ - - q = p; - while (*q && (strchr("0123456789.ab", *q)) && (((!strchr(".ab", *q) - && !strchr("ab", q[-1])) || --numdots))) { - ++q; - } - - *q = 0; - szResult = p; - break; - } - } - fclose(fp); - } - return szResult; -} - -/* - * List helpers for the SubstituteFile function - */ - -typedef struct list_item_t { - struct list_item_t *nextPtr; - char * key; - char * value; -} list_item_t; - -/* insert a list item into the list (list may be null) */ -static list_item_t * -list_insert(list_item_t **listPtrPtr, const char *key, const char *value) -{ - list_item_t *itemPtr = (list_item_t *)malloc(sizeof(list_item_t)); - if (itemPtr) { - itemPtr->key = strdup(key); - itemPtr->value = strdup(value); - itemPtr->nextPtr = NULL; - - while(*listPtrPtr) { - listPtrPtr = &(*listPtrPtr)->nextPtr; - } - *listPtrPtr = itemPtr; - } - return itemPtr; -} - -static void -list_free(list_item_t **listPtrPtr) -{ - list_item_t *tmpPtr, *listPtr = *listPtrPtr; - while (listPtr) { - tmpPtr = listPtr; - listPtr = listPtr->nextPtr; - free(tmpPtr->key); - free(tmpPtr->value); - free(tmpPtr); - } -} - -/* - * SubstituteFile -- - * As windows doesn't provide anything useful like sed and it's unreliable - * to use the tclsh you are building against (consider x-platform builds - - * eg compiling AMD64 target from IX86) we provide a simple substitution - * option here to handle autoconf style substitutions. - * The substitution file is whitespace and line delimited. The file should - * consist of lines matching the regular expression: - * \s*\S+\s+\S*$ - * - * Usage is something like: - * nmakehlp -S << $** > $@ - * @PACKAGE_NAME@ $(PACKAGE_NAME) - * @PACKAGE_VERSION@ $(PACKAGE_VERSION) - * << - */ - -static int -SubstituteFile( - const char *substitutions, - const char *filename) -{ - static char szBuffer[1024], szCopy[1024]; - list_item_t *substPtr = NULL; - FILE *fp, *sp; - - fp = fopen(filename, "rt"); - if (fp != NULL) { - - /* - * Build a list of substutitions from the first filename - */ - - sp = fopen(substitutions, "rt"); - if (sp != NULL) { - while (fgets(szBuffer, sizeof(szBuffer), sp) != NULL) { - unsigned char *ks, *ke, *vs, *ve; - ks = (unsigned char*)szBuffer; - while (ks && *ks && isspace(*ks)) ++ks; - ke = ks; - while (ke && *ke && !isspace(*ke)) ++ke; - vs = ke; - while (vs && *vs && isspace(*vs)) ++vs; - ve = vs; - while (ve && *ve && !(*ve == '\r' || *ve == '\n')) ++ve; - *ke = 0, *ve = 0; - list_insert(&substPtr, (char*)ks, (char*)vs); - } - fclose(sp); - } - - /* debug: dump the list */ -#ifndef NDEBUG - { - int n = 0; - list_item_t *p = NULL; - for (p = substPtr; p != NULL; p = p->nextPtr, ++n) { - fprintf(stderr, "% 3d '%s' => '%s'\n", n, p->key, p->value); - } - } -#endif - - /* - * Run the substitutions over each line of the input - */ - - while (fgets(szBuffer, sizeof(szBuffer), fp) != NULL) { - list_item_t *p = NULL; - for (p = substPtr; p != NULL; p = p->nextPtr) { - char *m = strstr(szBuffer, p->key); - if (m) { - char *cp, *op, *sp; - cp = szCopy; - op = szBuffer; - while (op != m) *cp++ = *op++; - sp = p->value; - while (sp && *sp) *cp++ = *sp++; - op += strlen(p->key); - while (*op) *cp++ = *op++; - *cp = 0; - memcpy(szBuffer, szCopy, sizeof(szCopy)); - } - } - printf("%s", szBuffer); - } - - list_free(&substPtr); - } - fclose(fp); - return 0; -} - -BOOL FileExists(LPCTSTR szPath) -{ -#ifndef INVALID_FILE_ATTRIBUTES - #define INVALID_FILE_ATTRIBUTES ((DWORD)-1) -#endif - DWORD pathAttr = GetFileAttributes(szPath); - return (pathAttr != INVALID_FILE_ATTRIBUTES && - !(pathAttr & FILE_ATTRIBUTE_DIRECTORY)); -} - - -/* - * QualifyPath -- - * - * This composes the current working directory with a provided path - * and returns the fully qualified and normalized path. - * Mostly needed to setup paths for testing. - */ - -static int -QualifyPath( - const char *szPath) -{ - char szCwd[MAX_PATH + 1]; - - GetFullPathName(szPath, sizeof(szCwd)-1, szCwd, NULL); - printf("%s\n", szCwd); - return 0; -} - -/* - * Implements LocateDependency for a single directory. See that command - * for an explanation. - * Returns 0 if found after printing the directory. - * Returns 1 if not found but no errors. - * Returns 2 on any kind of error - * Basically, these are used as exit codes for the process. - */ -static int LocateDependencyHelper(const char *dir, const char *keypath) -{ - HANDLE hSearch; - char path[MAX_PATH+1]; - size_t dirlen; - int keylen, ret; - WIN32_FIND_DATA finfo; - - if (dir == NULL || keypath == NULL) - return 2; /* Have no real error reporting mechanism into nmake */ - dirlen = strlen(dir); - if ((dirlen + 3) > sizeof(path)) - return 2; - strncpy(path, dir, dirlen); - strncpy(path+dirlen, "\\*", 3); /* Including terminating \0 */ - keylen = strlen(keypath); - -#if 0 /* This function is not available in Visual C++ 6 */ - /* - * Use numerics 0 -> FindExInfoStandard, - * 1 -> FindExSearchLimitToDirectories, - * as these are not defined in Visual C++ 6 - */ - hSearch = FindFirstFileEx(path, 0, &finfo, 1, NULL, 0); -#else - hSearch = FindFirstFile(path, &finfo); -#endif - if (hSearch == INVALID_HANDLE_VALUE) - return 1; /* Not found */ - - /* Loop through all subdirs checking if the keypath is under there */ - ret = 1; /* Assume not found */ - do { - int sublen; - /* - * We need to check it is a directory despite the - * FindExSearchLimitToDirectories in the above call. See SDK docs - */ - if ((finfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) - continue; - sublen = strlen(finfo.cFileName); - if ((dirlen+1+sublen+1+keylen+1) > sizeof(path)) - continue; /* Path does not fit, assume not matched */ - strncpy(path+dirlen+1, finfo.cFileName, sublen); - path[dirlen+1+sublen] = '\\'; - strncpy(path+dirlen+1+sublen+1, keypath, keylen+1); - if (FileExists(path)) { - /* Found a match, print to stdout */ - path[dirlen+1+sublen] = '\0'; - QualifyPath(path); - ret = 0; - break; - } - } while (FindNextFile(hSearch, &finfo)); - FindClose(hSearch); - return ret; -} - -/* - * LocateDependency -- - * - * Locates a dependency for a package. - * keypath - a relative path within the package directory - * that is used to confirm it is the correct directory. - * The search path for the package directory is currently only - * the parent and grandparent of the current working directory. - * If found, the command prints - * name_DIRPATH= - * and returns 0. If not found, does not print anything and returns 1. - */ -static int LocateDependency(const char *keypath) -{ - size_t i; - int ret; - static const char *paths[] = {"..", "..\\..", "..\\..\\.."}; - - for (i = 0; i < (sizeof(paths)/sizeof(paths[0])); ++i) { - ret = LocateDependencyHelper(paths[i], keypath); - if (ret == 0) - return ret; - } - return ret; -} - - -/* - * Local variables: - * mode: c - * c-basic-offset: 4 - * fill-column: 78 - * indent-tabs-mode: t - * tab-width: 8 - * End: - */ diff --git a/autoconf/tea/win/rules-ext.vc b/autoconf/tea/win/rules-ext.vc deleted file mode 100644 index 479720a4bc..0000000000 --- a/autoconf/tea/win/rules-ext.vc +++ /dev/null @@ -1,123 +0,0 @@ -# This file should only be included in makefiles for Tcl extensions, -# NOT in the makefile for Tcl itself. - -!ifndef _RULES_EXT_VC - -# We need to run from the directory the parent makefile is located in. -# nmake does not tell us what makefile was used to invoke it so parent -# makefile has to set the MAKEFILEVC macro or we just make a guess and -# warn if we think that is not the case. -!if "$(MAKEFILEVC)" == "" - -!if exist("$(PROJECT).vc") -MAKEFILEVC = $(PROJECT).vc -!elseif exist("makefile.vc") -MAKEFILEVC = makefile.vc -!endif -!endif # "$(MAKEFILEVC)" == "" - -!if !exist("$(MAKEFILEVC)") -MSG = ^ -You must run nmake from the directory containing the project makefile.^ -If you are doing that and getting this message, set the MAKEFILEVC^ -macro to the name of the project makefile. -!message WARNING: $(MSG) -!endif - -!if "$(PROJECT)" == "tcl" -!error The rules-ext.vc file is not intended for Tcl itself. -!endif - -# We extract version numbers using the nmakehlp program. For now use -# the local copy of nmakehlp. Once we locate Tcl, we will use that -# one if it is newer. -!if "$(MACHINE)" == "IX86" || "$(MACHINE)" == "$(NATIVE_ARCH)" -!if [$(CC) -nologo -DNDEBUG "nmakehlp.c" -link -subsystem:console > nul] -!endif -!else -!if [copy x86_64-w64-mingw32-nmakehlp.exe nmakehlp.exe >NUL] -!endif -!endif - -# First locate the Tcl directory that we are working with. -!if "$(TCLDIR)" != "" - -_RULESDIR = $(TCLDIR:/=\) - -!else - -# If an installation path is specified, that is also the Tcl directory. -# Also Tk never builds against an installed Tcl, it needs Tcl sources -!if defined(INSTALLDIR) && "$(PROJECT)" != "tk" -_RULESDIR=$(INSTALLDIR:/=\) -!else -# Locate Tcl sources -!if [echo _RULESDIR = \> nmakehlp.out] \ - || [nmakehlp -L generic\tcl.h >> nmakehlp.out] -_RULESDIR = ..\..\tcl -!else -!include nmakehlp.out -!endif - -!endif # defined(INSTALLDIR).... - -!endif # ifndef TCLDIR - -# Now look for the targets.vc file under the Tcl root. Note we check this -# file and not rules.vc because the latter also exists on older systems. -!if exist("$(_RULESDIR)\lib\nmake\targets.vc") # Building against installed Tcl -_RULESDIR = $(_RULESDIR)\lib\nmake -!elseif exist("$(_RULESDIR)\win\targets.vc") # Building against Tcl sources -_RULESDIR = $(_RULESDIR)\win -!else -# If we have not located Tcl's targets file, most likely we are compiling -# against an older version of Tcl and so must use our own support files. -_RULESDIR = . -!endif - -!if "$(_RULESDIR)" != "." -# Potentially using Tcl's support files. If this extension has its own -# nmake support files, need to compare the versions and pick newer. - -!if exist("rules.vc") # The extension has its own copy - -!if [echo TCL_RULES_MAJOR = \> versions.vc] \ - && [nmakehlp -V "$(_RULESDIR)\rules.vc" RULES_VERSION_MAJOR >> versions.vc] -!endif -!if [echo TCL_RULES_MINOR = \>> versions.vc] \ - && [nmakehlp -V "$(_RULESDIR)\rules.vc" RULES_VERSION_MINOR >> versions.vc] -!endif - -!if [echo OUR_RULES_MAJOR = \>> versions.vc] \ - && [nmakehlp -V "rules.vc" RULES_VERSION_MAJOR >> versions.vc] -!endif -!if [echo OUR_RULES_MINOR = \>> versions.vc] \ - && [nmakehlp -V "rules.vc" RULES_VERSION_MINOR >> versions.vc] -!endif -!include versions.vc -# We have a newer version of the support files, use them -!if ($(TCL_RULES_MAJOR) != $(OUR_RULES_MAJOR)) || ($(TCL_RULES_MINOR) < $(OUR_RULES_MINOR)) -_RULESDIR = . -!endif - -!endif # if exist("rules.vc") - -!endif # if $(_RULESDIR) != "." - -# Let rules.vc know what copy of nmakehlp.c to use. -NMAKEHLPC = $(_RULESDIR)\nmakehlp.c - -# Get rid of our internal defines before calling rules.vc -!undef TCL_RULES_MAJOR -!undef TCL_RULES_MINOR -!undef OUR_RULES_MAJOR -!undef OUR_RULES_MINOR - -!if exist("$(_RULESDIR)\rules.vc") -!message *** Using $(_RULESDIR)\rules.vc -!include "$(_RULESDIR)\rules.vc" -!else -!error *** Could not locate rules.vc in $(_RULESDIR) -!endif - -!endif # _RULES_EXT_VC \ No newline at end of file diff --git a/autoconf/tea/win/rules.vc b/autoconf/tea/win/rules.vc deleted file mode 100644 index 8ecce0e106..0000000000 --- a/autoconf/tea/win/rules.vc +++ /dev/null @@ -1,1913 +0,0 @@ -#------------------------------------------------------------- -*- makefile -*- -# rules.vc -- -# -# Part of the nmake based build system for Tcl and its extensions. -# This file does all the hard work in terms of parsing build options, -# compiler switches, defining common targets and macros. The Tcl makefile -# directly includes this. Extensions include it via "rules-ext.vc". -# -# See TIP 477 (https://core.tcl-lang.org/tips/doc/main/tip/477.md) for -# detailed documentation. -# -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# -# Copyright (c) 2001-2003 David Gravereaux. -# Copyright (c) 2003-2008 Patrick Thoyts -# Copyright (c) 2017 Ashok P. Nadkarni -#------------------------------------------------------------------------------ - -!ifndef _RULES_VC -_RULES_VC = 1 - -# The following macros define the version of the rules.vc nmake build system -# For modifications that are not backward-compatible, you *must* change -# the major version. -RULES_VERSION_MAJOR = 1 -RULES_VERSION_MINOR = 12 - -# The PROJECT macro must be defined by parent makefile. -!if "$(PROJECT)" == "" -!error *** Error: Macro PROJECT not defined! Please define it before including rules.vc -!endif - -!if "$(PRJ_PACKAGE_TCLNAME)" == "" -PRJ_PACKAGE_TCLNAME = $(PROJECT) -!endif - -# Also special case Tcl and Tk to save some typing later -DOING_TCL = 0 -DOING_TK = 0 -!if "$(PROJECT)" == "tcl" -DOING_TCL = 1 -!elseif "$(PROJECT)" == "tk" -DOING_TK = 1 -!endif - -!ifndef NEED_TK -# Backwards compatibility -!ifdef PROJECT_REQUIRES_TK -NEED_TK = $(PROJECT_REQUIRES_TK) -!else -NEED_TK = 0 -!endif -!endif - -!ifndef NEED_TCL_SOURCE -NEED_TCL_SOURCE = 0 -!endif - -!ifdef NEED_TK_SOURCE -!if $(NEED_TK_SOURCE) -NEED_TK = 1 -!endif -!else -NEED_TK_SOURCE = 0 -!endif - -################################################################ -# Nmake is a pretty weak environment in syntax and capabilities -# so this file is necessarily verbose. It's broken down into -# the following parts. -# -# 0. Sanity check that compiler environment is set up and initialize -# any built-in settings from the parent makefile -# 1. First define the external tools used for compiling, copying etc. -# as this is independent of everything else. -# 2. Figure out our build structure in terms of the directory, whether -# we are building Tcl or an extension, etc. -# 3. Determine the compiler and linker versions -# 4. Build the nmakehlp helper application -# 5. Determine the supported compiler options and features -# 6. Extract Tcl, Tk, and possibly extensions, version numbers from the -# headers -# 7. Parse the OPTS macro value for user-specified build configuration -# 8. Parse the STATS macro value for statistics instrumentation -# 9. Parse the CHECKS macro for additional compilation checks -# 10. Based on this selected configuration, construct the output -# directory and file paths -# 11. Construct the paths where the package is to be installed -# 12. Set up the actual options passed to compiler and linker based -# on the information gathered above. -# 13. Define some standard build targets and implicit rules. These may -# be optionally disabled by the parent makefile. -# 14. (For extensions only.) Compare the configuration of the target -# Tcl and the extensions and warn against discrepancies. -# -# One final note about the macro names used. They are as they are -# for historical reasons. We would like legacy extensions to -# continue to work with this make include file so be wary of -# changing them for consistency or clarity. - -# 0. Sanity check compiler environment - -# Check to see we are configured to build with MSVC (MSDEVDIR, MSVCDIR or -# VCINSTALLDIR) or with the MS Platform SDK (MSSDK or WindowsSDKDir) - -!if !defined(MSDEVDIR) && !defined(MSVCDIR) && !defined(VCINSTALLDIR) && !defined(MSSDK) && !defined(WINDOWSSDKDIR) -MSG = ^ -Visual C++ compiler environment not initialized. -!error $(MSG) -!endif - -# We need to run from the directory the parent makefile is located in. -# nmake does not tell us what makefile was used to invoke it so parent -# makefile has to set the MAKEFILEVC macro or we just make a guess and -# warn if we think that is not the case. -!if "$(MAKEFILEVC)" == "" - -!if exist("$(PROJECT).vc") -MAKEFILEVC = $(PROJECT).vc -!elseif exist("makefile.vc") -MAKEFILEVC = makefile.vc -!endif -!endif # "$(MAKEFILEVC)" == "" - -!if !exist("$(MAKEFILEVC)") -MSG = ^ -You must run nmake from the directory containing the project makefile.^ -If you are doing that and getting this message, set the MAKEFILEVC^ -macro to the name of the project makefile. -!message WARNING: $(MSG) -!endif - - -################################################################ -# 1. Define external programs being used - -#---------------------------------------------------------- -# Set the proper copy method to avoid overwrite questions -# to the user when copying files and selecting the right -# "delete all" method. -#---------------------------------------------------------- - -RMDIR = rmdir /S /Q -CPY = xcopy /i /y >NUL -CPYDIR = xcopy /e /i /y >NUL -COPY = copy /y >NUL -MKDIR = mkdir - -###################################################################### -# 2. Figure out our build environment in terms of what we're building. -# -# (a) Tcl itself -# (b) Tk -# (c) a Tcl extension using libraries/includes from an *installed* Tcl -# (d) a Tcl extension using libraries/includes from Tcl source directory -# -# This last is needed because some extensions still need -# some Tcl interfaces that are not publicly exposed. -# -# The fragment will set the following macros: -# ROOT - root of this module sources -# COMPATDIR - source directory that holds compatibility sources -# DOCDIR - source directory containing documentation files -# GENERICDIR - platform-independent source directory -# WIN_DIR - Windows-specific source directory -# TESTDIR - directory containing test files -# TOOLSDIR - directory containing build tools -# _TCLDIR - root of the Tcl installation OR the Tcl sources. Not set -# when building Tcl itself. -# _INSTALLDIR - native form of the installation path. For Tcl -# this will be the root of the Tcl installation. For extensions -# this will be the lib directory under the root. -# TCLINSTALL - set to 1 if _TCLDIR refers to -# headers and libraries from an installed Tcl, and 0 if built against -# Tcl sources. Not set when building Tcl itself. Yes, not very well -# named. -# _TCL_H - native path to the tcl.h file -# -# If Tk is involved, also sets the following -# _TKDIR - native form Tk installation OR Tk source. Not set if building -# Tk itself. -# TKINSTALL - set 1 if _TKDIR refers to installed Tk and 0 if Tk sources -# _TK_H - native path to the tk.h file - -# Root directory for sources and assumed subdirectories -ROOT = $(MAKEDIR)\.. -# The following paths CANNOT have spaces in them as they appear on the -# left side of implicit rules. -!ifndef COMPATDIR -COMPATDIR = $(ROOT)\compat -!endif -!ifndef DOCDIR -DOCDIR = $(ROOT)\doc -!endif -!ifndef GENERICDIR -GENERICDIR = $(ROOT)\generic -!endif -!ifndef TOOLSDIR -TOOLSDIR = $(ROOT)\tools -!endif -!ifndef TESTDIR -TESTDIR = $(ROOT)\tests -!endif -!ifndef LIBDIR -!if exist("$(ROOT)\library") -LIBDIR = $(ROOT)\library -!else -LIBDIR = $(ROOT)\lib -!endif -!endif -!ifndef DEMODIR -!if exist("$(LIBDIR)\demos") -DEMODIR = $(LIBDIR)\demos -!else -DEMODIR = $(ROOT)\demos -!endif -!endif # ifndef DEMODIR -# Do NOT use WINDIR because it is Windows internal environment -# variable to point to c:\windows! -WIN_DIR = $(ROOT)\win - -!ifndef RCDIR -!if exist("$(WIN_DIR)\rc") -RCDIR = $(WIN_DIR)\rc -!else -RCDIR = $(WIN_DIR) -!endif -!endif -RCDIR = $(RCDIR:/=\) - -# The target directory where the built packages and binaries will be installed. -# INSTALLDIR is the (optional) path specified by the user. -# _INSTALLDIR is INSTALLDIR using the backslash separator syntax -!ifdef INSTALLDIR -### Fix the path separators. -_INSTALLDIR = $(INSTALLDIR:/=\) -!else -### Assume the normal default. -_INSTALLDIR = $(HOMEDRIVE)\Tcl -!endif - -!if $(DOING_TCL) - -# BEGIN Case 2(a) - Building Tcl itself - -# Only need to define _TCL_H -_TCL_H = ..\generic\tcl.h - -# END Case 2(a) - Building Tcl itself - -!elseif $(DOING_TK) - -# BEGIN Case 2(b) - Building Tk - -TCLINSTALL = 0 # Tk always builds against Tcl source, not an installed Tcl -!if "$(TCLDIR)" == "" -!if [echo TCLDIR = \> nmakehlp.out] \ - || [nmakehlp -L generic\tcl.h >> nmakehlp.out] -!error *** Could not locate Tcl source directory. -!endif -!include nmakehlp.out -!endif # TCLDIR == "" - -_TCLDIR = $(TCLDIR:/=\) -_TCL_H = $(_TCLDIR)\generic\tcl.h -!if !exist("$(_TCL_H)") -!error Could not locate tcl.h. Please set the TCLDIR macro to point to the Tcl *source* directory. -!endif - -_TK_H = ..\generic\tk.h - -# END Case 2(b) - Building Tk - -!else - -# BEGIN Case 2(c) or (d) - Building an extension other than Tk - -# If command line has specified Tcl location through TCLDIR, use it -# else default to the INSTALLDIR setting -!if "$(TCLDIR)" != "" - -_TCLDIR = $(TCLDIR:/=\) -!if exist("$(_TCLDIR)\include\tcl.h") # Case 2(c) with TCLDIR defined -TCLINSTALL = 1 -_TCL_H = $(_TCLDIR)\include\tcl.h -!elseif exist("$(_TCLDIR)\generic\tcl.h") # Case 2(d) with TCLDIR defined -TCLINSTALL = 0 -_TCL_H = $(_TCLDIR)\generic\tcl.h -!endif - -!else # # Case 2(c) for extensions with TCLDIR undefined - -# Need to locate Tcl depending on whether it needs Tcl source or not. -# If we don't, check the INSTALLDIR for an installed Tcl first - -!if exist("$(_INSTALLDIR)\include\tcl.h") && !$(NEED_TCL_SOURCE) - -TCLINSTALL = 1 -TCLDIR = $(_INSTALLDIR)\.. -# NOTE: we will be resetting _INSTALLDIR to _INSTALLDIR/lib for extensions -# later so the \.. accounts for the /lib -_TCLDIR = $(_INSTALLDIR)\.. -_TCL_H = $(_TCLDIR)\include\tcl.h - -!else # exist(...) && !$(NEED_TCL_SOURCE) - -!if [echo _TCLDIR = \> nmakehlp.out] \ - || [nmakehlp -L generic\tcl.h >> nmakehlp.out] -!error *** Could not locate Tcl source directory. -!endif -!include nmakehlp.out -TCLINSTALL = 0 -TCLDIR = $(_TCLDIR) -_TCL_H = $(_TCLDIR)\generic\tcl.h - -!endif # exist(...) && !$(NEED_TCL_SOURCE) - -!endif # TCLDIR - -!ifndef _TCL_H -MSG =^ -Failed to find tcl.h. The TCLDIR macro is set incorrectly or is not set and default path does not contain tcl.h. -!error $(MSG) -!endif - -# Now do the same to locate Tk headers and libs if project requires Tk -!if $(NEED_TK) - -!if "$(TKDIR)" != "" - -_TKDIR = $(TKDIR:/=\) -!if exist("$(_TKDIR)\include\tk.h") -TKINSTALL = 1 -_TK_H = $(_TKDIR)\include\tk.h -!elseif exist("$(_TKDIR)\generic\tk.h") -TKINSTALL = 0 -_TK_H = $(_TKDIR)\generic\tk.h -!endif - -!else # TKDIR not defined - -# Need to locate Tcl depending on whether it needs Tcl source or not. -# If we don't, check the INSTALLDIR for an installed Tcl first - -!if exist("$(_INSTALLDIR)\include\tk.h") && !$(NEED_TK_SOURCE) - -TKINSTALL = 1 -# NOTE: we will be resetting _INSTALLDIR to _INSTALLDIR/lib for extensions -# later so the \.. accounts for the /lib -_TKDIR = $(_INSTALLDIR)\.. -_TK_H = $(_TKDIR)\include\tk.h -TKDIR = $(_TKDIR) - -!else # exist("$(_INSTALLDIR)\include\tk.h") && !$(NEED_TK_SOURCE) - -!if [echo _TKDIR = \> nmakehlp.out] \ - || [nmakehlp -L generic\tk.h >> nmakehlp.out] -!error *** Could not locate Tk source directory. -!endif -!include nmakehlp.out -TKINSTALL = 0 -TKDIR = $(_TKDIR) -_TK_H = $(_TKDIR)\generic\tk.h - -!endif # exist("$(_INSTALLDIR)\include\tk.h") && !$(NEED_TK_SOURCE) - -!endif # TKDIR - -!ifndef _TK_H -MSG =^ -Failed to find tk.h. The TKDIR macro is set incorrectly or is not set and default path does not contain tk.h. -!error $(MSG) -!endif - -!endif # NEED_TK - -!if $(NEED_TCL_SOURCE) && $(TCLINSTALL) -MSG = ^ -*** Warning: This extension requires the source distribution of Tcl.^ -*** Please set the TCLDIR macro to point to the Tcl sources. -!error $(MSG) -!endif - -!if $(NEED_TK_SOURCE) -!if $(TKINSTALL) -MSG = ^ -*** Warning: This extension requires the source distribution of Tk.^ -*** Please set the TKDIR macro to point to the Tk sources. -!error $(MSG) -!endif -!endif - - -# If INSTALLDIR set to Tcl installation root dir then reset to the -# lib dir for installing extensions -!if exist("$(_INSTALLDIR)\include\tcl.h") -_INSTALLDIR=$(_INSTALLDIR)\lib -!endif - -# END Case 2(c) or (d) - Building an extension -!endif # if $(DOING_TCL) - -################################################################ -# 3. Determine compiler version and architecture -# In this section, we figure out the compiler version and the -# architecture for which we are building. This sets the -# following macros: -# VCVERSION - the internal compiler version as 1200, 1400, 1910 etc. -# This is also printed by the compiler in dotted form 19.10 etc. -# VCVER - the "marketing version", for example Visual C++ 6 for internal -# compiler version 1200. This is kept only for legacy reasons as it -# does not make sense for recent Microsoft compilers. Only used for -# output directory names. -# ARCH - set to IX86, ARM64 or AMD64 depending on 32- or 64-bit target -# NATIVE_ARCH - set to IX86, ARM64 or AMD64 for the host machine -# MACHINE - same as $(ARCH) - legacy -# _VC_MANIFEST_EMBED_{DLL,EXE} - commands for embedding a manifest if needed - -cc32 = $(CC) # built-in default. -link32 = link -lib32 = lib -rc32 = $(RC) # built-in default. - -#---------------------------------------------------------------- -# Figure out the compiler architecture and version by writing -# the C macros to a file, preprocessing them with the C -# preprocessor and reading back the created file - -_HASH=^# -_VC_MANIFEST_EMBED_EXE= -_VC_MANIFEST_EMBED_DLL= -VCVER=0 -!if ![echo VCVERSION=_MSC_VER > vercl.x] \ - && ![echo $(_HASH)if defined(_M_IX86) >> vercl.x] \ - && ![echo ARCH=IX86 >> vercl.x] \ - && ![echo $(_HASH)elif defined(_M_AMD64) >> vercl.x] \ - && ![echo ARCH=AMD64 >> vercl.x] \ - && ![echo $(_HASH)elif defined(_M_ARM64) >> vercl.x] \ - && ![echo ARCH=ARM64 >> vercl.x] \ - && ![echo $(_HASH)endif >> vercl.x] \ - && ![$(cc32) -nologo -TC -P vercl.x 2>NUL] -!include vercl.i -!if $(VCVERSION) < 1900 -!if ![echo VCVER= ^\> vercl.vc] \ - && ![set /a $(VCVERSION) / 100 - 6 >> vercl.vc] -!include vercl.vc -!endif -!else -# The simple calculation above does not apply to new Visual Studio releases -# Keep the compiler version in its native form. -VCVER = $(VCVERSION) -!endif -!endif - -!if ![del 2>NUL /q/f vercl.x vercl.i vercl.vc] -!endif - -#---------------------------------------------------------------- -# The MACHINE macro is used by legacy makefiles so set it as well -!ifdef MACHINE -!if "$(MACHINE)" == "x86" -!undef MACHINE -MACHINE = IX86 -!elseif "$(MACHINE)" == "arm64" -!undef MACHINE -MACHINE = ARM64 -!elseif "$(MACHINE)" == "x64" -!undef MACHINE -MACHINE = AMD64 -!endif -!if "$(MACHINE)" != "$(ARCH)" -!error Specified MACHINE macro $(MACHINE) does not match detected target architecture $(ARCH). -!endif -!else -MACHINE=$(ARCH) -!endif - -#--------------------------------------------------------------- -# The PLATFORM_IDENTIFY macro matches the values returned by -# the Tcl platform::identify command -!if "$(MACHINE)" == "AMD64" -PLATFORM_IDENTIFY = win32-x86_64 -!elseif "$(MACHINE)" == "ARM64" -PLATFORM_IDENTIFY = win32-arm -!else -PLATFORM_IDENTIFY = win32-ix86 -!endif - -# The MULTIPLATFORM macro controls whether binary extensions are installed -# in platform-specific directories. Intended to be set/used by extensions. -!ifndef MULTIPLATFORM_INSTALL -MULTIPLATFORM_INSTALL = 0 -!endif - -#------------------------------------------------------------ -# Figure out the *host* architecture by reading the registry - -!if ![reg query HKLM\Hardware\Description\System\CentralProcessor\0 /v Identifier | findstr /i x86] -NATIVE_ARCH=IX86 -!elseif ![reg query HKLM\Hardware\Description\System\CentralProcessor\0 /v Identifier | findstr /i ARM | findstr /i 64-bit] -NATIVE_ARCH=ARM64 -!else -NATIVE_ARCH=AMD64 -!endif - -# Since MSVC8 we must deal with manifest resources. -!if $(VCVERSION) >= 1400 -_VC_MANIFEST_EMBED_EXE=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;1 -_VC_MANIFEST_EMBED_DLL=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;2 -!endif - -################################################################ -# 4. Build the nmakehlp program -# This is a helper app we need to overcome nmake's limiting -# environment. We will call out to it to get various bits of -# information about supported compiler options etc. -# -# Tcl itself will always use the nmakehlp.c program which is -# in its own source. It will be kept updated there. -# -# Extensions built against an installed Tcl will use the installed -# copy of Tcl's nmakehlp.c if there is one and their own version -# otherwise. In the latter case, they would also be using their own -# rules.vc. Note that older versions of Tcl do not install nmakehlp.c -# or rules.vc. -# -# Extensions built against Tcl sources will use the one from the Tcl source. -# -# When building an extension using a sufficiently new version of Tcl, -# rules-ext.vc will define NMAKEHLPC appropriately to point to the -# copy of nmakehlp.c to be used. - -!ifndef NMAKEHLPC -# Default to the one in the current directory (the extension's own nmakehlp.c) -NMAKEHLPC = nmakehlp.c - -!if !$(DOING_TCL) -!if $(TCLINSTALL) -!if exist("$(_TCLDIR)\lib\nmake\nmakehlp.c") -NMAKEHLPC = $(_TCLDIR)\lib\nmake\nmakehlp.c -!endif -!else # !$(TCLINSTALL) -!if exist("$(_TCLDIR)\win\nmakehlp.c") -NMAKEHLPC = $(_TCLDIR)\win\nmakehlp.c -!endif -!endif # $(TCLINSTALL) -!endif # !$(DOING_TCL) - -!endif # NMAKEHLPC - -# We always build nmakehlp even if it exists since we do not know -# what source it was built from. -!if "$(MACHINE)" == "IX86" || "$(MACHINE)" == "$(NATIVE_ARCH)" -!if [$(cc32) -nologo "$(NMAKEHLPC)" -link -subsystem:console > nul] -!endif -!else -!if [copy $(NMAKEHLPC:nmakehlp.c=x86_64-w64-mingw32-nmakehlp.exe) nmakehlp.exe >NUL] -!endif -!endif - -################################################################ -# 5. Test for compiler features -# Visual C++ compiler options have changed over the years. Check -# which options are supported by the compiler in use. -# -# The following macros are set: -# OPTIMIZATIONS - the compiler flags to be used for optimized builds -# DEBUGFLAGS - the compiler flags to be used for debug builds -# LINKERFLAGS - Flags passed to the linker -# -# Note that these are the compiler settings *available*, not those -# that will be *used*. The latter depends on the OPTS macro settings -# which we have not yet parsed. -# -# Also note that some of the flags in OPTIMIZATIONS are not really -# related to optimization. They are placed there only for legacy reasons -# as some extensions expect them to be included in that macro. - -# -Op improves float consistency. Note only needed for older compilers -# Newer compilers do not need or support this option. -!if [nmakehlp -c -Op] -FPOPTS = -Op -!endif - -# Strict floating point semantics - present in newer compilers in lieu of -Op -!if [nmakehlp -c -fp:strict] -FPOPTS = $(FPOPTS) -fp:strict -!endif - -!if "$(MACHINE)" == "IX86" -### test for pentium errata -!if [nmakehlp -c -QI0f] -!message *** Compiler has 'Pentium 0x0f fix' -FPOPTS = $(FPOPTS) -QI0f -!else -!message *** Compiler does not have 'Pentium 0x0f fix' -!endif -!endif - -### test for optimizations -# /O2 optimization includes /Og /Oi /Ot /Oy /Ob2 /Gs /GF /Gy as per -# documentation. Note we do NOT want /Gs as that inserts a _chkstk -# stack probe at *every* function entry, not just those with more than -# a page of stack allocation resulting in a performance hit. However, -# /O2 documentation is misleading as its stack probes are simply the -# default page size locals allocation probes and not what is implied -# by an explicit /Gs option. - -OPTIMIZATIONS = $(FPOPTS) - -!if [nmakehlp -c -O2] -OPTIMIZING = 1 -OPTIMIZATIONS = $(OPTIMIZATIONS) -O2 -!else -# Legacy, really. All modern compilers support this -!message *** Compiler does not have 'Optimizations' -OPTIMIZING = 0 -!endif - -# Checks for buffer overflows in local arrays -!if [nmakehlp -c -GS] -OPTIMIZATIONS = $(OPTIMIZATIONS) -GS -!endif - -# Link time optimization. Note that this option (potentially) makes -# generated libraries only usable by the specific VC++ version that -# created it. Requires /LTCG linker option -!if [nmakehlp -c -GL] -OPTIMIZATIONS = $(OPTIMIZATIONS) -GL -CC_GL_OPT_ENABLED = 1 -!else -# In newer compilers -GL and -YX are incompatible. -!if [nmakehlp -c -YX] -OPTIMIZATIONS = $(OPTIMIZATIONS) -YX -!endif -!endif # [nmakehlp -c -GL] - -DEBUGFLAGS = $(FPOPTS) - -# Run time error checks. Not available or valid in a release, non-debug build -# RTC is for modern compilers, -GZ is legacy -!if [nmakehlp -c -RTC1] -DEBUGFLAGS = $(DEBUGFLAGS) -RTC1 -!elseif [nmakehlp -c -GZ] -DEBUGFLAGS = $(DEBUGFLAGS) -GZ -!endif - -#---------------------------------------------------------------- -# Linker flags - -# LINKER_TESTFLAGS are for internal use when we call nmakehlp to test -# if the linker supports a specific option. Without these flags link will -# return "LNK1561: entry point must be defined" error compiling from VS-IDE: -# They are not passed through to the actual application / extension -# link rules. -!ifndef LINKER_TESTFLAGS -LINKER_TESTFLAGS = /DLL /NOENTRY /OUT:nmakehlp.out -!endif - -LINKERFLAGS = - -# If compiler has enabled link time optimization, linker must too with -ltcg -!ifdef CC_GL_OPT_ENABLED -!if [nmakehlp -l -ltcg $(LINKER_TESTFLAGS)] -LINKERFLAGS = $(LINKERFLAGS) -ltcg -!endif -!endif - - -################################################################ -# 6. Extract various version numbers from headers -# For Tcl and Tk, version numbers are extracted from tcl.h and tk.h -# respectively. For extensions, versions are extracted from the -# configure.in or configure.ac from the TEA configuration if it -# exists, and unset otherwise. -# Sets the following macros: -# TCL_MAJOR_VERSION -# TCL_MINOR_VERSION -# TCL_RELEASE_SERIAL -# TCL_PATCH_LEVEL -# TCL_PATCH_LETTER -# TCL_VERSION -# TK_MAJOR_VERSION -# TK_MINOR_VERSION -# TK_RELEASE_SERIAL -# TK_PATCH_LEVEL -# TK_PATCH_LETTER -# TK_VERSION -# DOTVERSION - set as (for example) 2.5 -# VERSION - set as (for example 25) -#-------------------------------------------------------------- - -!if [echo REM = This file is generated from rules.vc > versions.vc] -!endif -!if [echo TCL_MAJOR_VERSION = \>> versions.vc] \ - && [nmakehlp -V "$(_TCL_H)" "define TCL_MAJOR_VERSION" >> versions.vc] -!endif -!if [echo TCL_MINOR_VERSION = \>> versions.vc] \ - && [nmakehlp -V "$(_TCL_H)" TCL_MINOR_VERSION >> versions.vc] -!endif -!if [echo TCL_RELEASE_SERIAL = \>> versions.vc] \ - && [nmakehlp -V "$(_TCL_H)" TCL_RELEASE_SERIAL >> versions.vc] -!endif -!if [echo TCL_PATCH_LEVEL = \>> versions.vc] \ - && [nmakehlp -V "$(_TCL_H)" TCL_PATCH_LEVEL >> versions.vc] -!endif - -!if defined(_TK_H) -!if [echo TK_MAJOR_VERSION = \>> versions.vc] \ - && [nmakehlp -V $(_TK_H) "define TK_MAJOR_VERSION" >> versions.vc] -!endif -!if [echo TK_MINOR_VERSION = \>> versions.vc] \ - && [nmakehlp -V $(_TK_H) TK_MINOR_VERSION >> versions.vc] -!endif -!if [echo TK_RELEASE_SERIAL = \>> versions.vc] \ - && [nmakehlp -V "$(_TK_H)" TK_RELEASE_SERIAL >> versions.vc] -!endif -!if [echo TK_PATCH_LEVEL = \>> versions.vc] \ - && [nmakehlp -V $(_TK_H) TK_PATCH_LEVEL >> versions.vc] -!endif -!endif # _TK_H - -!include versions.vc - -TCL_VERSION = $(TCL_MAJOR_VERSION)$(TCL_MINOR_VERSION) -TCL_DOTVERSION = $(TCL_MAJOR_VERSION).$(TCL_MINOR_VERSION) -!if [nmakehlp -f $(TCL_PATCH_LEVEL) "a"] -TCL_PATCH_LETTER = a -!elseif [nmakehlp -f $(TCL_PATCH_LEVEL) "b"] -TCL_PATCH_LETTER = b -!else -TCL_PATCH_LETTER = . -!endif - -!if defined(_TK_H) - -TK_VERSION = $(TK_MAJOR_VERSION)$(TK_MINOR_VERSION) -TK_DOTVERSION = $(TK_MAJOR_VERSION).$(TK_MINOR_VERSION) -!if [nmakehlp -f $(TK_PATCH_LEVEL) "a"] -TK_PATCH_LETTER = a -!elseif [nmakehlp -f $(TK_PATCH_LEVEL) "b"] -TK_PATCH_LETTER = b -!else -TK_PATCH_LETTER = . -!endif - -!endif - -# Set DOTVERSION and VERSION -!if $(DOING_TCL) - -DOTVERSION = $(TCL_MAJOR_VERSION).$(TCL_MINOR_VERSION) -VERSION = $(TCL_VERSION) - -!elseif $(DOING_TK) - -DOTVERSION = $(TK_DOTVERSION) -VERSION = $(TK_VERSION) - -!else # Doing a non-Tk extension - -# If parent makefile has not defined DOTVERSION, try to get it from TEA -# first from a configure.in file, and then from configure.ac -!ifndef DOTVERSION -!if [echo DOTVERSION = \> versions.vc] \ - || [nmakehlp -V $(ROOT)\configure.in ^[$(PROJECT)^] >> versions.vc] -!if [echo DOTVERSION = \> versions.vc] \ - || [nmakehlp -V $(ROOT)\configure.ac ^[$(PROJECT)^] >> versions.vc] -!error *** Could not figure out extension version. Please define DOTVERSION in parent makefile before including rules.vc. -!endif -!endif -!include versions.vc -!endif # DOTVERSION -VERSION = $(DOTVERSION:.=) - -!endif # $(DOING_TCL) ... etc. - -# Windows RC files have 3 version components. Ensure this irrespective -# of how many components the package has specified. Basically, ensure -# minimum 4 components by appending 4 0's and then pick out the first 4. -# Also take care of the fact that DOTVERSION may have "a" or "b" instead -# of "." separating the version components. -DOTSEPARATED=$(DOTVERSION:a=.) -DOTSEPARATED=$(DOTSEPARATED:b=.) -!if [echo RCCOMMAVERSION = \> versions.vc] \ - || [for /f "tokens=1,2,3,4,5* delims=." %a in ("$(DOTSEPARATED).0.0.0.0") do echo %a,%b,%c,%d >> versions.vc] -!error *** Could not generate RCCOMMAVERSION *** -!endif -!include versions.vc - -######################################################################## -# 7. Parse the OPTS macro to work out the requested build configuration. -# Based on this, we will construct the actual switches to be passed to the -# compiler and linker using the macros defined in the previous section. -# The following macros are defined by this section based on OPTS -# STATIC_BUILD - 0 -> Tcl is to be built as a shared library -# 1 -> build as a static library and shell -# TCL_THREADS - legacy but always 1 on Windows since winsock requires it. -# DEBUG - 1 -> debug build, 0 -> release builds -# SYMBOLS - 1 -> generate PDB's, 0 -> no PDB's -# PROFILE - 1 -> generate profiling info, 0 -> no profiling -# PGO - 1 -> profile based optimization, 0 -> no -# MSVCRT - 1 -> link to dynamic C runtime even when building static Tcl build -# 0 -> link to static C runtime for static Tcl build. -# Does not impact shared Tcl builds (STATIC_BUILD == 0) -# Default: 1 for Tcl 8.7 and up, 0 otherwise. -# TCL_USE_STATIC_PACKAGES - 1 -> statically link the registry and dde extensions -# in the Tcl and Wish shell. 0 -> keep them as shared libraries. Does -# not impact shared Tcl builds. Implied by STATIC_BUILD since Tcl 8.7. -# USE_THREAD_ALLOC - 1 -> Use a shared global free pool for allocation. -# 0 -> Use the non-thread allocator. -# UNCHECKED - 1 -> when doing a debug build with symbols, use the release -# C runtime, 0 -> use the debug C runtime. -# USE_STUBS - 1 -> compile to use stubs interfaces, 0 -> direct linking -# CONFIG_CHECK - 1 -> check current build configuration against Tcl -# configuration (ignored for Tcl itself) -# _USE_64BIT_TIME_T - forces a build using 64-bit time_t for 32-bit build -# (CRT library should support this, not needed for Tcl 9.x) -# Further, LINKERFLAGS are modified based on above. - -# Default values for all the above -STATIC_BUILD = 0 -TCL_THREADS = 1 -DEBUG = 0 -SYMBOLS = 0 -PROFILE = 0 -PGO = 0 -MSVCRT = 1 -TCL_USE_STATIC_PACKAGES = 0 -USE_THREAD_ALLOC = 1 -UNCHECKED = 0 -CONFIG_CHECK = 1 -!if $(DOING_TCL) -USE_STUBS = 0 -!else -USE_STUBS = 1 -!endif - -# If OPTS is not empty AND does not contain "none" which turns off all OPTS -# set the above macros based on OPTS content -!if "$(OPTS)" != "" && ![nmakehlp -f "$(OPTS)" "none"] - -# OPTS are specified, parse them - -!if [nmakehlp -f $(OPTS) "static"] -!message *** Doing static -STATIC_BUILD = 1 -!endif - -!if [nmakehlp -f $(OPTS) "nostubs"] -!message *** Not using stubs -USE_STUBS = 0 -!endif - -!if [nmakehlp -f $(OPTS) "nomsvcrt"] -!message *** Doing nomsvcrt -MSVCRT = 0 -!else -!if [nmakehlp -f $(OPTS) "msvcrt"] -!message *** Doing msvcrt -!else -!if $(TCL_MAJOR_VERSION) == 8 && $(TCL_MINOR_VERSION) < 7 && $(STATIC_BUILD) -MSVCRT = 0 -!endif -!endif -!endif # [nmakehlp -f $(OPTS) "nomsvcrt"] - -!if [nmakehlp -f $(OPTS) "staticpkg"] && $(STATIC_BUILD) -!message *** Doing staticpkg -TCL_USE_STATIC_PACKAGES = 1 -!endif - -!if [nmakehlp -f $(OPTS) "nothreads"] -!message *** Compile explicitly for non-threaded tcl -TCL_THREADS = 0 -USE_THREAD_ALLOC= 0 -!endif - -!if [nmakehlp -f $(OPTS) "tcl8"] -!message *** Build for Tcl8 -TCL_BUILD_FOR = 8 -!endif - -!if $(TCL_MAJOR_VERSION) == 8 -!if [nmakehlp -f $(OPTS) "time64bit"] -!message *** Force 64-bit time_t -_USE_64BIT_TIME_T = 1 -!endif -!endif - -# Yes, it's weird that the "symbols" option controls DEBUG and -# the "pdbs" option controls SYMBOLS. That's historical. -!if [nmakehlp -f $(OPTS) "symbols"] -!message *** Doing symbols -DEBUG = 1 -!else -DEBUG = 0 -!endif - -!if [nmakehlp -f $(OPTS) "pdbs"] -!message *** Doing pdbs -SYMBOLS = 1 -!else -SYMBOLS = 0 -!endif - -!if [nmakehlp -f $(OPTS) "profile"] -!message *** Doing profile -PROFILE = 1 -!else -PROFILE = 0 -!endif - -!if [nmakehlp -f $(OPTS) "pgi"] -!message *** Doing profile guided optimization instrumentation -PGO = 1 -!elseif [nmakehlp -f $(OPTS) "pgo"] -!message *** Doing profile guided optimization -PGO = 2 -!else -PGO = 0 -!endif - -!if [nmakehlp -f $(OPTS) "loimpact"] -!message *** Warning: ignoring option "loimpact" - deprecated on modern Windows. -!endif - -# TBD - should get rid of this option -!if [nmakehlp -f $(OPTS) "thrdalloc"] -!message *** Doing thrdalloc -USE_THREAD_ALLOC = 1 -!endif - -!if [nmakehlp -f $(OPTS) "tclalloc"] -USE_THREAD_ALLOC = 0 -!endif - -!if [nmakehlp -f $(OPTS) "unchecked"] -!message *** Doing unchecked -UNCHECKED = 1 -!else -UNCHECKED = 0 -!endif - -!if [nmakehlp -f $(OPTS) "noconfigcheck"] -CONFIG_CHECK = 1 -!else -CONFIG_CHECK = 0 -!endif - -!endif # "$(OPTS)" != "" && ... parsing of OPTS - -# Set linker flags based on above - -!if $(PGO) > 1 -!if [nmakehlp -l -ltcg:pgoptimize $(LINKER_TESTFLAGS)] -LINKERFLAGS = $(LINKERFLAGS:-ltcg=) -ltcg:pgoptimize -!else -MSG=^ -This compiler does not support profile guided optimization. -!error $(MSG) -!endif -!elseif $(PGO) > 0 -!if [nmakehlp -l -ltcg:pginstrument $(LINKER_TESTFLAGS)] -LINKERFLAGS = $(LINKERFLAGS:-ltcg=) -ltcg:pginstrument -!else -MSG=^ -This compiler does not support profile guided optimization. -!error $(MSG) -!endif -!endif - -################################################################ -# 8. Parse the STATS macro to configure code instrumentation -# The following macros are set by this section: -# TCL_MEM_DEBUG - 1 -> enables memory allocation instrumentation -# 0 -> disables -# TCL_COMPILE_DEBUG - 1 -> enables byte compiler logging -# 0 -> disables - -# Default both are off -TCL_MEM_DEBUG = 0 -TCL_COMPILE_DEBUG = 0 - -!if "$(STATS)" != "" && ![nmakehlp -f "$(STATS)" "none"] - -!if [nmakehlp -f $(STATS) "memdbg"] -!message *** Doing memdbg -TCL_MEM_DEBUG = 1 -!else -TCL_MEM_DEBUG = 0 -!endif - -!if [nmakehlp -f $(STATS) "compdbg"] -!message *** Doing compdbg -TCL_COMPILE_DEBUG = 1 -!else -TCL_COMPILE_DEBUG = 0 -!endif - -!endif - -#################################################################### -# 9. Parse the CHECKS macro to configure additional compiler checks -# The following macros are set by this section: -# WARNINGS - compiler switches that control the warnings level -# TCL_NO_DEPRECATED - 1 -> disable support for deprecated functions -# 0 -> enable deprecated functions - -# Defaults - Permit deprecated functions and warning level 3 -TCL_NO_DEPRECATED = 0 -WARNINGS = -W3 - -!if "$(CHECKS)" != "" && ![nmakehlp -f "$(CHECKS)" "none"] - -!if [nmakehlp -f $(CHECKS) "nodep"] -!message *** Doing nodep check -TCL_NO_DEPRECATED = 1 -!endif - -!if [nmakehlp -f $(CHECKS) "fullwarn"] -!message *** Doing full warnings check -WARNINGS = -W4 -!if [nmakehlp -l -warn:3 $(LINKER_TESTFLAGS)] -LINKERFLAGS = $(LINKERFLAGS) -warn:3 -!endif -!endif - -!if [nmakehlp -f $(CHECKS) "64bit"] && [nmakehlp -c -Wp64] -!message *** Doing 64bit portability warnings -WARNINGS = $(WARNINGS) -Wp64 -!endif - -!endif - - -################################################################ -# 10. Construct output directory and file paths -# Figure-out how to name our intermediate and output directories. -# In order to avoid inadvertent mixing of object files built using -# different compilers, build configurations etc., -# -# Naming convention (suffixes): -# t = full thread support. (Not used for Tcl >= 8.7) -# s = static library (as opposed to an import library) -# g = linked to the debug enabled C run-time. -# x = special static build when it links to the dynamic C run-time. -# -# The following macros are set in this section: -# SUFX - the suffix to use for binaries based on above naming convention -# BUILDDIRTOP - the toplevel default output directory -# is of the form {Release,Debug}[_AMD64][_COMPILERVERSION] -# TMP_DIR - directory where object files are created -# OUT_DIR - directory where output executables are created -# Both TMP_DIR and OUT_DIR are defaulted only if not defined by the -# parent makefile (or command line). The default values are -# based on BUILDDIRTOP. -# STUBPREFIX - name of the stubs library for this project -# PRJIMPLIB - output path of the generated project import library -# PRJLIBNAME - name of generated project library -# PRJLIB - output path of generated project library -# PRJSTUBLIBNAME - name of the generated project stubs library -# PRJSTUBLIB - output path of the generated project stubs library -# RESFILE - output resource file (only if not static build) - -SUFX = tsgx - -!if $(DEBUG) -BUILDDIRTOP = Debug -!else -BUILDDIRTOP = Release -!endif - -!if "$(MACHINE)" != "IX86" -BUILDDIRTOP =$(BUILDDIRTOP)_$(MACHINE) -!endif -!if $(VCVER) > 6 -BUILDDIRTOP =$(BUILDDIRTOP)_VC$(VCVER) -!endif - -!if !$(DEBUG) || $(TCL_VERSION) > 86 || $(DEBUG) && $(UNCHECKED) -SUFX = $(SUFX:g=) -!endif - -TMP_DIRFULL = .\$(BUILDDIRTOP)\$(PROJECT)_ThreadedDynamicStaticX - -!if !$(STATIC_BUILD) -TMP_DIRFULL = $(TMP_DIRFULL:Static=) -SUFX = $(SUFX:s=) -EXT = dll -TMP_DIRFULL = $(TMP_DIRFULL:X=) -SUFX = $(SUFX:x=) -!else -TMP_DIRFULL = $(TMP_DIRFULL:Dynamic=) -EXT = lib -!if $(MSVCRT) && $(TCL_VERSION) > 86 || !$(MSVCRT) && $(TCL_VERSION) < 87 -TMP_DIRFULL = $(TMP_DIRFULL:X=) -SUFX = $(SUFX:x=) -!endif -!endif - -!if !$(TCL_THREADS) || $(TCL_VERSION) > 86 -TMP_DIRFULL = $(TMP_DIRFULL:Threaded=) -SUFX = $(SUFX:t=) -!endif - -!ifndef TMP_DIR -TMP_DIR = $(TMP_DIRFULL) -!ifndef OUT_DIR -OUT_DIR = .\$(BUILDDIRTOP) -!endif -!else -!ifndef OUT_DIR -OUT_DIR = $(TMP_DIR) -!endif -!endif - -# Relative paths -> absolute -!if [echo OUT_DIR = \> nmakehlp.out] \ - || [nmakehlp -Q "$(OUT_DIR)" >> nmakehlp.out] -!error *** Could not fully qualify path OUT_DIR=$(OUT_DIR) -!endif -!if [echo TMP_DIR = \>> nmakehlp.out] \ - || [nmakehlp -Q "$(TMP_DIR)" >> nmakehlp.out] -!error *** Could not fully qualify path TMP_DIR=$(TMP_DIR) -!endif -!include nmakehlp.out - -# The name of the stubs library for the project being built -STUBPREFIX = $(PROJECT)stub - -# -# Set up paths to various Tcl executables and libraries needed by extensions -# - -# TIP 430. Unused for 8.6 but no harm defining it to allow a common rules.vc -TCL_ZIP_FILE = libtcl$(TCL_MAJOR_VERSION).$(TCL_MINOR_VERSION)$(TCL_PATCH_LETTER)$(TCL_RELEASE_SERIAL).zip -TK_ZIP_FILE = libtk$(TK_MAJOR_VERSION).$(TK_MINOR_VERSION)$(TK_PATCH_LETTER)$(TK_RELEASE_SERIAL).zip - -!if $(DOING_TCL) -TCLSHNAME = $(PROJECT)sh$(VERSION)$(SUFX).exe -TCLSH = $(OUT_DIR)\$(TCLSHNAME) -TCLIMPLIB = $(OUT_DIR)\$(PROJECT)$(VERSION)$(SUFX).lib -TCLLIBNAME = $(PROJECT)$(VERSION)$(SUFX).$(EXT) -TCLLIB = $(OUT_DIR)\$(TCLLIBNAME) -TCLSCRIPTZIP = $(OUT_DIR)\$(TCL_ZIP_FILE) - -!if $(TCL_MAJOR_VERSION) == 8 -TCLSTUBLIBNAME = $(STUBPREFIX)$(VERSION).lib -!else -TCLSTUBLIBNAME = $(STUBPREFIX).lib -!endif -TCLSTUBLIB = $(OUT_DIR)\$(TCLSTUBLIBNAME) -TCL_INCLUDES = -I"$(WIN_DIR)" -I"$(GENERICDIR)" - -!else # !$(DOING_TCL) - -!if $(TCLINSTALL) # Building against an installed Tcl - -# When building extensions, we need to locate tclsh. Depending on version -# of Tcl we are building against, this may or may not have a "t" suffix. -# Try various possibilities in turn. -TCLSH = $(_TCLDIR)\bin\tclsh$(TCL_VERSION)$(SUFX:t=).exe -!if !exist("$(TCLSH)") -TCLSH = $(_TCLDIR)\bin\tclsh$(TCL_VERSION)t$(SUFX:t=).exe -!endif - -!if $(TCL_MAJOR_VERSION) == 8 -TCLSTUBLIB = $(_TCLDIR)\lib\tclstub$(TCL_VERSION).lib -!else -TCLSTUBLIB = $(_TCLDIR)\lib\tclstub.lib -!endif -TCLIMPLIB = $(_TCLDIR)\lib\tcl$(TCL_VERSION)$(SUFX:t=).lib -# When building extensions, may be linking against Tcl that does not add -# "t" suffix (e.g. 8.5 or 8.7). If lib not found check for that possibility. -!if !exist("$(TCLIMPLIB)") -TCLIMPLIB = $(_TCLDIR)\lib\tcl$(TCL_VERSION)t$(SUFX:t=).lib -!endif -TCL_LIBRARY = $(_TCLDIR)\lib -TCLREGLIB = $(_TCLDIR)\lib\tclreg13$(SUFX:t=).lib -TCLDDELIB = $(_TCLDIR)\lib\tcldde14$(SUFX:t=).lib -TCLSCRIPTZIP = $(_TCLDIR)\lib\$(TCL_ZIP_FILE) -TCLTOOLSDIR = \must\have\tcl\sources\to\build\this\target -TCL_INCLUDES = -I"$(_TCLDIR)\include" - -!else # Building against Tcl sources - -TCLSH = $(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)$(SUFX:t=).exe -!if !exist($(TCLSH)) -TCLSH = $(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)t$(SUFX:t=).exe -!endif -!if $(TCL_MAJOR_VERSION) == 8 -TCLSTUBLIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\tclstub$(TCL_VERSION).lib -!else -TCLSTUBLIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\tclstub.lib -!endif -TCLIMPLIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\tcl$(TCL_VERSION)$(SUFX:t=).lib -# When building extensions, may be linking against Tcl that does not add -# "t" suffix (e.g. 8.5 or 8.7). If lib not found check for that possibility. -!if !exist("$(TCLIMPLIB)") -TCLIMPLIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\tcl$(TCL_VERSION)t$(SUFX:t=).lib -!endif -TCL_LIBRARY = $(_TCLDIR)\library -TCLREGLIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\tclreg13$(SUFX:t=).lib -TCLDDELIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\tcldde14$(SUFX:t=).lib -TCLSCRIPTZIP = $(_TCLDIR)\win\$(BUILDDIRTOP)\$(TCL_ZIP_FILE) -TCLTOOLSDIR = $(_TCLDIR)\tools -TCL_INCLUDES = -I"$(_TCLDIR)\generic" -I"$(_TCLDIR)\win" - -!endif # TCLINSTALL - -!if !$(STATIC_BUILD) && "$(TCL_BUILD_FOR)" == "8" -tcllibs = "$(TCLSTUBLIB)" -!else -tcllibs = "$(TCLSTUBLIB)" "$(TCLIMPLIB)" -!endif - -!endif # $(DOING_TCL) - -# We need a tclsh that will run on the host machine as part of the build. -# IX86 runs on all architectures. -!ifndef TCLSH_NATIVE -!if "$(MACHINE)" == "IX86" || "$(MACHINE)" == "$(NATIVE_ARCH)" -TCLSH_NATIVE = $(TCLSH) -!else -!error You must explicitly set TCLSH_NATIVE for cross-compilation -!endif -!endif - -# Do the same for Tk and Tk extensions that require the Tk libraries -!if $(DOING_TK) || $(NEED_TK) -WISHNAMEPREFIX = wish -WISHNAME = $(WISHNAMEPREFIX)$(TK_VERSION)$(SUFX).exe -TKLIBNAME8 = tk$(TK_VERSION)$(SUFX).$(EXT) -TKLIBNAME9 = tcl9tk$(TK_VERSION)$(SUFX).$(EXT) -!if $(TCL_MAJOR_VERSION) == 8 || "$(TCL_BUILD_FOR)" == "8" -TKLIBNAME = tk$(TK_VERSION)$(SUFX).$(EXT) -TKIMPLIBNAME = tk$(TK_VERSION)$(SUFX).lib -!else -TKLIBNAME = tcl9tk$(TK_VERSION)$(SUFX).$(EXT) -TKIMPLIBNAME = tcl9tk$(TK_VERSION)$(SUFX).lib -!endif -!if $(TK_MAJOR_VERSION) == 8 -TKSTUBLIBNAME = tkstub$(TK_VERSION).lib -!else -TKSTUBLIBNAME = tkstub.lib -!endif - -!if $(DOING_TK) -WISH = $(OUT_DIR)\$(WISHNAME) -TKSTUBLIB = $(OUT_DIR)\$(TKSTUBLIBNAME) -TKIMPLIB = $(OUT_DIR)\$(TKIMPLIBNAME) -TKLIB = $(OUT_DIR)\$(TKLIBNAME) -TK_INCLUDES = -I"$(WIN_DIR)" -I"$(GENERICDIR)" -TKSCRIPTZIP = $(OUT_DIR)\$(TK_ZIP_FILE) - -!else # effectively NEED_TK - -!if $(TKINSTALL) # Building against installed Tk -WISH = $(_TKDIR)\bin\$(WISHNAME) -TKSTUBLIB = $(_TKDIR)\lib\$(TKSTUBLIBNAME) -TKIMPLIB = $(_TKDIR)\lib\$(TKIMPLIBNAME) -# When building extensions, may be linking against Tk that does not add -# "t" suffix (e.g. 8.5 or 8.7). If lib not found check for that possibility. -!if !exist("$(TKIMPLIB)") -TKIMPLIBNAME = tk$(TK_VERSION)$(SUFX:t=).lib -TKIMPLIB = $(_TKDIR)\lib\$(TKIMPLIBNAME) -!endif -TK_INCLUDES = -I"$(_TKDIR)\include" -TKSCRIPTZIP = $(_TKDIR)\lib\$(TK_ZIP_FILE) - -!else # Building against Tk sources - -WISH = $(_TKDIR)\win\$(BUILDDIRTOP)\$(WISHNAME) -TKSTUBLIB = $(_TKDIR)\win\$(BUILDDIRTOP)\$(TKSTUBLIBNAME) -TKIMPLIB = $(_TKDIR)\win\$(BUILDDIRTOP)\$(TKIMPLIBNAME) -# When building extensions, may be linking against Tk that does not add -# "t" suffix (e.g. 8.5 or 8.7). If lib not found check for that possibility. -!if !exist("$(TKIMPLIB)") -TKIMPLIBNAME = tk$(TK_VERSION)$(SUFX:t=).lib -TKIMPLIB = $(_TKDIR)\win\$(BUILDDIRTOP)\$(TKIMPLIBNAME) -!endif -TK_INCLUDES = -I"$(_TKDIR)\generic" -I"$(_TKDIR)\win" -I"$(_TKDIR)\xlib" -TKSCRIPTZIP = $(_TKDIR)\win\$(BUILDDIRTOP)\$(TK_ZIP_FILE) - -!endif # TKINSTALL - -tklibs = "$(TKSTUBLIB)" "$(TKIMPLIB)" - -!endif # $(DOING_TK) -!endif # $(DOING_TK) || $(NEED_TK) - -# Various output paths -PRJIMPLIB = $(OUT_DIR)\$(PROJECT)$(VERSION)$(SUFX).lib -PRJLIBNAME8 = $(PROJECT)$(VERSION)$(SUFX).$(EXT) -# Even when building against Tcl 8, PRJLIBNAME9 must not have "t" -PRJLIBNAME9 = tcl9$(PROJECT)$(VERSION)$(SUFX:t=).$(EXT) -!if $(TCL_MAJOR_VERSION) == 8 || "$(TCL_BUILD_FOR)" == "8" -PRJLIBNAME = $(PRJLIBNAME8) -!else -PRJLIBNAME = $(PRJLIBNAME9) -!endif -PRJLIB = $(OUT_DIR)\$(PRJLIBNAME) - -!if $(TCL_MAJOR_VERSION) == 8 -PRJSTUBLIBNAME = $(STUBPREFIX)$(VERSION).lib -!else -PRJSTUBLIBNAME = $(STUBPREFIX).lib -!endif -PRJSTUBLIB = $(OUT_DIR)\$(PRJSTUBLIBNAME) - -# If extension parent makefile has not defined a resource definition file, -# we will generate one from standard template. -!if !$(DOING_TCL) && !$(DOING_TK) && !$(STATIC_BUILD) -!ifdef RCFILE -RESFILE = $(TMP_DIR)\$(RCFILE:.rc=.res) -!else -RESFILE = $(TMP_DIR)\$(PROJECT).res -!endif -!endif - -################################################################### -# 11. Construct the paths for the installation directories -# The following macros get defined in this section: -# LIB_INSTALL_DIR - where libraries should be installed -# BIN_INSTALL_DIR - where the executables should be installed -# DOC_INSTALL_DIR - where documentation should be installed -# SCRIPT_INSTALL_DIR - where scripts should be installed -# INCLUDE_INSTALL_DIR - where C include files should be installed -# DEMO_INSTALL_DIR - where demos should be installed -# PRJ_INSTALL_DIR - where package will be installed (not set for Tcl and Tk) - -!if $(DOING_TCL) || $(DOING_TK) -LIB_INSTALL_DIR = $(_INSTALLDIR)\lib -BIN_INSTALL_DIR = $(_INSTALLDIR)\bin -DOC_INSTALL_DIR = $(_INSTALLDIR)\doc -!if $(DOING_TCL) -SCRIPT_INSTALL_DIR = $(_INSTALLDIR)\lib\$(PROJECT)$(TCL_MAJOR_VERSION).$(TCL_MINOR_VERSION) -MODULE_INSTALL_DIR = $(_INSTALLDIR)\lib\tcl$(TCL_MAJOR_VERSION) -!else # DOING_TK -SCRIPT_INSTALL_DIR = $(_INSTALLDIR)\lib\$(PROJECT)$(TK_MAJOR_VERSION).$(TK_MINOR_VERSION) -!endif -DEMO_INSTALL_DIR = $(SCRIPT_INSTALL_DIR)\demos -INCLUDE_INSTALL_DIR = $(_INSTALLDIR)\include - -!else # extension other than Tk - -PRJ_INSTALL_DIR = $(_INSTALLDIR)\$(PROJECT)$(DOTVERSION) -!if $(MULTIPLATFORM_INSTALL) -LIB_INSTALL_DIR = $(PRJ_INSTALL_DIR)\$(PLATFORM_IDENTIFY) -BIN_INSTALL_DIR = $(PRJ_INSTALL_DIR)\$(PLATFORM_IDENTIFY) -!else -LIB_INSTALL_DIR = $(PRJ_INSTALL_DIR) -BIN_INSTALL_DIR = $(PRJ_INSTALL_DIR) -!endif -DOC_INSTALL_DIR = $(PRJ_INSTALL_DIR) -SCRIPT_INSTALL_DIR = $(PRJ_INSTALL_DIR) -DEMO_INSTALL_DIR = $(PRJ_INSTALL_DIR)\demos -INCLUDE_INSTALL_DIR = $(_INSTALLDIR)\..\include - -!endif - -################################################################### -# 12. Set up actual options to be passed to the compiler and linker -# Now we have all the information we need, set up the actual flags and -# options that we will pass to the compiler and linker. The main -# makefile should use these in combination with whatever other flags -# and switches are specific to it. -# The following macros are defined, names are for historical compatibility: -# OPTDEFINES - /Dxxx C macro flags based on user-specified OPTS -# COMPILERFLAGS - /Dxxx C macro flags independent of any configuration options -# crt - Compiler switch that selects the appropriate C runtime -# cdebug - Compiler switches related to debug AND optimizations -# cwarn - Compiler switches that set warning levels -# cflags - complete compiler switches (subsumes cdebug and cwarn) -# ldebug - Linker switches controlling debug information and optimization -# lflags - complete linker switches (subsumes ldebug) except subsystem type -# dlllflags - complete linker switches to build DLLs (subsumes lflags) -# conlflags - complete linker switches for console program (subsumes lflags) -# guilflags - complete linker switches for GUI program (subsumes lflags) -# baselibs - minimum Windows libraries required. Parent makefile can -# define PRJ_LIBS before including rules.rc if additional libs are needed - -OPTDEFINES = /DSTDC_HEADERS /DUSE_NMAKE=1 -!if $(VCVERSION) > 1600 -OPTDEFINES = $(OPTDEFINES) /DHAVE_STDINT_H=1 -!else -OPTDEFINES = $(OPTDEFINES) /DMP_NO_STDINT=1 -!endif -!if $(VCVERSION) >= 1800 -OPTDEFINES = $(OPTDEFINES) /DHAVE_INTTYPES_H=1 /DHAVE_STDBOOL_H=1 -!endif - -!if $(TCL_MEM_DEBUG) -OPTDEFINES = $(OPTDEFINES) /DTCL_MEM_DEBUG -!endif -!if $(TCL_COMPILE_DEBUG) -OPTDEFINES = $(OPTDEFINES) /DTCL_COMPILE_DEBUG /DTCL_COMPILE_STATS -!endif -!if $(TCL_THREADS) && $(TCL_VERSION) < 87 -OPTDEFINES = $(OPTDEFINES) /DTCL_THREADS=1 -!if $(USE_THREAD_ALLOC) && $(TCL_VERSION) < 87 -OPTDEFINES = $(OPTDEFINES) /DUSE_THREAD_ALLOC=1 -!endif -!endif -!if $(STATIC_BUILD) -OPTDEFINES = $(OPTDEFINES) /DSTATIC_BUILD -!elseif $(TCL_VERSION) > 86 -OPTDEFINES = $(OPTDEFINES) /DTCL_WITH_EXTERNAL_TOMMATH -!if "$(MACHINE)" == "AMD64" || "$(MACHINE)" == "ARM64" -OPTDEFINES = $(OPTDEFINES) /DMP_64BIT -!endif -!endif -!if $(TCL_NO_DEPRECATED) -OPTDEFINES = $(OPTDEFINES) /DTCL_NO_DEPRECATED -!endif - -!if $(USE_STUBS) -# Note we do not define USE_TCL_STUBS even when building tk since some -# test targets in tk do not use stubs -!if !$(DOING_TCL) -USE_STUBS_DEFS = /DUSE_TCL_STUBS /DUSE_TCLOO_STUBS -!if $(NEED_TK) -USE_STUBS_DEFS = $(USE_STUBS_DEFS) /DUSE_TK_STUBS -!endif -!endif -!endif # USE_STUBS - -!if !$(DEBUG) -OPTDEFINES = $(OPTDEFINES) /DNDEBUG -!if $(OPTIMIZING) -OPTDEFINES = $(OPTDEFINES) /DTCL_CFG_OPTIMIZED -!endif -!endif -!if $(PROFILE) -OPTDEFINES = $(OPTDEFINES) /DTCL_CFG_PROFILED -!endif -!if "$(MACHINE)" == "AMD64" || "$(MACHINE)" == "ARM64" -OPTDEFINES = $(OPTDEFINES) /DTCL_CFG_DO64BIT -!endif -!if $(VCVERSION) < 1300 -OPTDEFINES = $(OPTDEFINES) /DNO_STRTOI64=1 -!endif - -!if $(TCL_MAJOR_VERSION) == 8 -!if "$(_USE_64BIT_TIME_T)" == "1" -OPTDEFINES = $(OPTDEFINES) /D_USE_64BIT_TIME_T=1 -!endif -!endif -!if "$(TCL_BUILD_FOR)" == "8" -OPTDEFINES = $(OPTDEFINES) /DTCL_MAJOR_VERSION=8 -!endif - -# Like the TEA system only set this non empty for non-Tk extensions -# Note: some extensions use PACKAGE_NAME and others use PACKAGE_TCLNAME -# so we pass both -!if !$(DOING_TCL) && !$(DOING_TK) -PKGNAMEFLAGS = /DPACKAGE_NAME="\"$(PRJ_PACKAGE_TCLNAME)\"" \ - /DPACKAGE_TCLNAME="\"$(PRJ_PACKAGE_TCLNAME)\"" \ - /DPACKAGE_VERSION="\"$(DOTVERSION)\"" \ - /DMODULE_SCOPE=extern -!endif - -# crt picks the C run time based on selected OPTS -!if $(MSVCRT) -!if $(DEBUG) && !$(UNCHECKED) -crt = -MDd -!else -crt = -MD -!endif -!else -!if $(DEBUG) && !$(UNCHECKED) -crt = -MTd -!else -crt = -MT -!endif -!endif - -# cdebug includes compiler options for debugging as well as optimization. -!if $(DEBUG) - -# In debugging mode, optimizations need to be disabled -cdebug = -Zi -Od $(DEBUGFLAGS) - -!else - -cdebug = $(OPTIMIZATIONS) -!if $(SYMBOLS) -cdebug = $(cdebug) -Zi -!endif - -!endif # $(DEBUG) - -# cwarn includes default warning levels, also C4090 (buggy) and C4146 is useless. -cwarn = $(WARNINGS) -wd4090 -wd4146 - -!if "$(MACHINE)" == "AMD64" || "$(MACHINE)" == "ARM64" -# Disable pointer<->int warnings related to cast between different sizes -# There are a gadzillion of these due to use of ClientData and -# clutter up compiler -# output increasing chance of a real warning getting lost. So disable them. -# Eventually some day, Tcl will be 64-bit clean. -cwarn = $(cwarn) -wd4311 -wd4312 -!endif - -### Common compiler options that are architecture specific -!if "$(MACHINE)" == "ARM" -carch = /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE -!else -carch = -!endif - -# cpuid is only available on intel machines -!if "$(MACHINE)" == "IX86" || "$(MACHINE)" == "AMD64" -carch = $(carch) /DHAVE_CPUID=1 -!endif - -!if $(DEBUG) -# Turn warnings into errors -cwarn = $(cwarn) -WX -!endif - -INCLUDES = $(TCL_INCLUDES) $(TK_INCLUDES) $(PRJ_INCLUDES) -!if !$(DOING_TCL) && !$(DOING_TK) -INCLUDES = $(INCLUDES) -I"$(GENERICDIR)" -I"$(WIN_DIR)" -I"$(COMPATDIR)" -!endif - -# These flags are defined roughly in the order of the pre-reform -# rules.vc/makefile.vc to help visually compare that the pre- and -# post-reform build logs - -# cflags contains generic flags used for building practically all object files -cflags = -nologo -c $(COMPILERFLAGS) $(carch) $(cwarn) -Fp$(TMP_DIR)^\ $(cdebug) - -!if $(TCL_MAJOR_VERSION) == 8 && $(TCL_MINOR_VERSION) < 7 -cflags = $(cflags) -DTcl_Size=int -!endif - -# appcflags contains $(cflags) and flags for building the application -# object files (e.g. tclsh, or wish) pkgcflags contains $(cflags) plus -# flags used for building shared object files The two differ in the -# BUILD_$(PROJECT) macro which should be defined only for the shared -# library *implementation* and not for its caller interface - -appcflags_nostubs = $(cflags) $(crt) $(INCLUDES) $(TCL_DEFINES) $(PRJ_DEFINES) $(OPTDEFINES) -appcflags = $(appcflags_nostubs) $(USE_STUBS_DEFS) -pkgcflags = $(appcflags) $(PKGNAMEFLAGS) /DBUILD_$(PROJECT) -pkgcflags_nostubs = $(appcflags_nostubs) $(PKGNAMEFLAGS) /DBUILD_$(PROJECT) - -# stubscflags contains $(cflags) plus flags used for building a stubs -# library for the package. Note: /DSTATIC_BUILD is defined in -# $(OPTDEFINES) only if the OPTS configuration indicates a static -# library. However the stubs library is ALWAYS static hence included -# here irrespective of the OPTS setting. -# -# TBD - tclvfs has a comment that stubs libs should not be compiled with -GL -# without stating why. Tcl itself compiled stubs libs with this flag. -# so we do not remove it from cflags. -GL may prevent extensions -# compiled with one VC version to fail to link against stubs library -# compiled with another VC version. Check for this and fix accordingly. -stubscflags = $(cflags) $(PKGNAMEFLAGS) $(PRJ_DEFINES) $(OPTDEFINES) /Zl /GL- /DSTATIC_BUILD $(INCLUDES) $(USE_STUBS_DEFS) - -# Link flags - -!if $(DEBUG) -ldebug = -debug -debugtype:cv -!else -ldebug = -release -opt:ref -opt:icf,3 -!if $(SYMBOLS) -ldebug = $(ldebug) -debug -debugtype:cv -!endif -!endif - -# Note: Profiling is currently only possible with the Visual Studio Enterprise -!if $(PROFILE) -ldebug= $(ldebug) -profile -!endif - -### Declarations common to all linker versions -lflags = -nologo -machine:$(MACHINE) $(LINKERFLAGS) $(ldebug) - -!if $(MSVCRT) && !($(DEBUG) && !$(UNCHECKED)) && $(VCVERSION) >= 1900 -lflags = $(lflags) -nodefaultlib:libucrt.lib -!endif - -dlllflags = $(lflags) -dll -conlflags = $(lflags) -subsystem:console -guilflags = $(lflags) -subsystem:windows - -# Libraries that are required for every image. -# Extensions should define any additional libraries with $(PRJ_LIBS) -winlibs = kernel32.lib advapi32.lib - -!if $(NEED_TK) -winlibs = $(winlibs) gdi32.lib user32.lib uxtheme.lib -!endif - -# Avoid 'unresolved external symbol __security_cookie' errors. -# c.f. http://support.microsoft.com/?id=894573 -!if "$(MACHINE)" == "AMD64" -!if $(VCVERSION) > 1399 && $(VCVERSION) < 1500 -winlibs = $(winlibs) bufferoverflowU.lib -!endif -!endif - -baselibs = $(winlibs) $(PRJ_LIBS) - -!if $(MSVCRT) && !($(DEBUG) && !$(UNCHECKED)) && $(VCVERSION) >= 1900 -baselibs = $(baselibs) ucrt.lib -!endif - -################################################################ -# 13. Define standard commands, common make targets and implicit rules - -CCPKGCMD = $(cc32) $(pkgcflags) -Fo$(TMP_DIR)^\ -CCAPPCMD = $(cc32) $(appcflags) -Fo$(TMP_DIR)^\ -CCSTUBSCMD = $(cc32) $(stubscflags) -Fo$(TMP_DIR)^\ - -LIBCMD = $(lib32) -nologo $(LINKERFLAGS) -out:$@ -DLLCMD = $(link32) $(dlllflags) -out:$@ $(baselibs) $(tcllibs) $(tklibs) - -CONEXECMD = $(link32) $(conlflags) -out:$@ $(baselibs) $(tcllibs) $(tklibs) -GUIEXECMD = $(link32) $(guilflags) -out:$@ $(baselibs) $(tcllibs) $(tklibs) -RESCMD = $(rc32) -fo $@ -r -i "$(GENERICDIR)" -i "$(TMP_DIR)" \ - $(TCL_INCLUDES) /DSTATIC_BUILD=$(STATIC_BUILD) \ - /DDEBUG=$(DEBUG) -d UNCHECKED=$(UNCHECKED) \ - /DCOMMAVERSION=$(RCCOMMAVERSION) \ - /DDOTVERSION=\"$(DOTVERSION)\" \ - /DVERSION=\"$(VERSION)\" \ - /DSUFX=\"$(SUFX)\" \ - /DPROJECT=\"$(PROJECT)\" \ - /DPRJLIBNAME=\"$(PRJLIBNAME)\" - -!ifndef DEFAULT_BUILD_TARGET -DEFAULT_BUILD_TARGET = $(PROJECT) -!endif - -default-target: $(DEFAULT_BUILD_TARGET) - -!if $(MULTIPLATFORM_INSTALL) -default-pkgindex: - @echo if {[package vsatisfies [package provide Tcl] 9.0-]} { > $(OUT_DIR)\pkgIndex.tcl - @echo package ifneeded $(PRJ_PACKAGE_TCLNAME) $(DOTVERSION) \ - [list load [file join $$dir $(PLATFORM_IDENTIFY) $(PRJLIBNAME9)]] >> $(OUT_DIR)\pkgIndex.tcl - @echo } else { >> $(OUT_DIR)\pkgIndex.tcl - @echo package ifneeded $(PRJ_PACKAGE_TCLNAME) $(DOTVERSION) \ - [list load [file join $$dir $(PLATFORM_IDENTIFY) $(PRJLIBNAME8)]] >> $(OUT_DIR)\pkgIndex.tcl - @echo } >> $(OUT_DIR)\pkgIndex.tcl -!else -default-pkgindex: - @echo if {[package vsatisfies [package provide Tcl] 9.0-]} { > $(OUT_DIR)\pkgIndex.tcl - @echo package ifneeded $(PRJ_PACKAGE_TCLNAME) $(DOTVERSION) \ - [list load [file join $$dir $(PRJLIBNAME9)]] >> $(OUT_DIR)\pkgIndex.tcl - @echo } else { >> $(OUT_DIR)\pkgIndex.tcl - @echo package ifneeded $(PRJ_PACKAGE_TCLNAME) $(DOTVERSION) \ - [list load [file join $$dir $(PRJLIBNAME8)]] >> $(OUT_DIR)\pkgIndex.tcl - @echo } >> $(OUT_DIR)\pkgIndex.tcl -!endif - -default-pkgindex-tea: - @if exist $(ROOT)\pkgIndex.tcl.in nmakehlp -s << $(ROOT)\pkgIndex.tcl.in > $(OUT_DIR)\pkgIndex.tcl -@PACKAGE_VERSION@ $(DOTVERSION) -@PACKAGE_NAME@ $(PRJ_PACKAGE_TCLNAME) -@PACKAGE_TCLNAME@ $(PRJ_PACKAGE_TCLNAME) -@PKG_LIB_FILE@ $(PRJLIBNAME) -@PKG_LIB_FILE8@ $(PRJLIBNAME8) -@PKG_LIB_FILE9@ $(PRJLIBNAME9) -<< - -default-install: default-install-binaries default-install-libraries -!if $(SYMBOLS) -default-install: default-install-pdbs -!endif - -# Again to deal with historical brokenness, there is some confusion -# in terminlogy. For extensions, the "install-binaries" was used to -# locate target directory for *binary shared libraries* and thus -# the appropriate macro is LIB_INSTALL_DIR since BIN_INSTALL_DIR is -# for executables (exes). On the other hand the "install-libraries" -# target is for *scripts* and should have been called "install-scripts". -default-install-binaries: $(PRJLIB) - @echo Installing binaries to '$(LIB_INSTALL_DIR)' - @if not exist "$(LIB_INSTALL_DIR)" mkdir "$(LIB_INSTALL_DIR)" - @$(CPY) $(PRJLIB) "$(LIB_INSTALL_DIR)" >NUL - -# Alias for default-install-scripts -default-install-libraries: default-install-scripts - -default-install-scripts: $(OUT_DIR)\pkgIndex.tcl - @echo Installing libraries to '$(SCRIPT_INSTALL_DIR)' - @if exist $(LIBDIR) $(CPY) $(LIBDIR)\*.tcl "$(SCRIPT_INSTALL_DIR)" - @echo Installing package index in '$(SCRIPT_INSTALL_DIR)' - @$(CPY) $(OUT_DIR)\pkgIndex.tcl $(SCRIPT_INSTALL_DIR) - -default-install-stubs: - @echo Installing stubs library to '$(SCRIPT_INSTALL_DIR)' - @if not exist "$(SCRIPT_INSTALL_DIR)" mkdir "$(SCRIPT_INSTALL_DIR)" - @$(CPY) $(PRJSTUBLIB) "$(SCRIPT_INSTALL_DIR)" >NUL - -default-install-pdbs: - @echo Installing PDBs to '$(LIB_INSTALL_DIR)' - @if not exist "$(LIB_INSTALL_DIR)" mkdir "$(LIB_INSTALL_DIR)" - @$(CPY) "$(OUT_DIR)\*.pdb" "$(LIB_INSTALL_DIR)\" - -# "emacs font-lock highlighting fix - -default-install-docs-html: - @echo Installing documentation files to '$(DOC_INSTALL_DIR)' - @if not exist "$(DOC_INSTALL_DIR)" mkdir "$(DOC_INSTALL_DIR)" - @if exist $(DOCDIR) for %f in ("$(DOCDIR)\*.html" "$(DOCDIR)\*.css" "$(DOCDIR)\*.png") do @$(COPY) %f "$(DOC_INSTALL_DIR)" - -default-install-docs-n: - @echo Installing documentation files to '$(DOC_INSTALL_DIR)' - @if not exist "$(DOC_INSTALL_DIR)" mkdir "$(DOC_INSTALL_DIR)" - @if exist $(DOCDIR) for %f in ("$(DOCDIR)\*.n") do @$(COPY) %f "$(DOC_INSTALL_DIR)" - -default-install-demos: - @echo Installing demos to '$(DEMO_INSTALL_DIR)' - @if not exist "$(DEMO_INSTALL_DIR)" mkdir "$(DEMO_INSTALL_DIR)" - @if exist $(DEMODIR) $(CPYDIR) "$(DEMODIR)" "$(DEMO_INSTALL_DIR)" - -default-clean: - @echo Cleaning $(TMP_DIR)\* ... - @if exist $(TMP_DIR)\nul $(RMDIR) $(TMP_DIR) - @echo Cleaning $(WIN_DIR)\nmakehlp.obj, nmakehlp.exe ... - @if exist $(WIN_DIR)\nmakehlp.obj del $(WIN_DIR)\nmakehlp.obj - @if exist $(WIN_DIR)\nmakehlp.exe del $(WIN_DIR)\nmakehlp.exe - @if exist $(WIN_DIR)\nmakehlp.out del $(WIN_DIR)\nmakehlp.out - @echo Cleaning $(WIN_DIR)\nmhlp-out.txt ... - @if exist $(WIN_DIR)\nmhlp-out.txt del $(WIN_DIR)\nmhlp-out.txt - @echo Cleaning $(WIN_DIR)\_junk.pch ... - @if exist $(WIN_DIR)\_junk.pch del $(WIN_DIR)\_junk.pch - @echo Cleaning $(WIN_DIR)\vercl.x, vercl.i ... - @if exist $(WIN_DIR)\vercl.x del $(WIN_DIR)\vercl.x - @if exist $(WIN_DIR)\vercl.i del $(WIN_DIR)\vercl.i - @echo Cleaning $(WIN_DIR)\versions.vc, version.vc ... - @if exist $(WIN_DIR)\versions.vc del $(WIN_DIR)\versions.vc - @if exist $(WIN_DIR)\version.vc del $(WIN_DIR)\version.vc - -default-hose: default-clean - @echo Hosing $(OUT_DIR)\* ... - @if exist $(OUT_DIR)\nul $(RMDIR) $(OUT_DIR) - -# Only for backward compatibility -default-distclean: default-hose - -default-setup: - @if not exist $(OUT_DIR)\nul mkdir $(OUT_DIR) - @if not exist $(TMP_DIR)\nul mkdir $(TMP_DIR) - -!if "$(TESTPAT)" != "" -TESTFLAGS = $(TESTFLAGS) -file $(TESTPAT) -!endif - -default-test: default-setup $(PROJECT) - @set TCLLIBPATH=$(OUT_DIR:\=/) - @if exist $(LIBDIR) for %f in ("$(LIBDIR)\*.tcl") do @$(COPY) %f "$(OUT_DIR)" - cd "$(TESTDIR)" && $(DEBUGGER) $(TCLSH) all.tcl $(TESTFLAGS) - -default-shell: default-setup $(PROJECT) - @set TCLLIBPATH=$(OUT_DIR:\=/) - @if exist $(LIBDIR) for %f in ("$(LIBDIR)\*.tcl") do @$(COPY) %f "$(OUT_DIR)" - $(DEBUGGER) $(TCLSH) - -# Generation of Windows version resource -!ifdef RCFILE - -# Note: don't use $** in below rule because there may be other dependencies -# and only the "main" rc must be passed to the resource compiler -$(TMP_DIR)\$(PROJECT).res: $(RCDIR)\$(PROJECT).rc - $(RESCMD) $(RCDIR)\$(PROJECT).rc - -!else - -# If parent makefile has not defined a resource definition file, -# we will generate one from standard template. -$(TMP_DIR)\$(PROJECT).res: $(TMP_DIR)\$(PROJECT).rc - -$(TMP_DIR)\$(PROJECT).rc: - @$(COPY) << $(TMP_DIR)\$(PROJECT).rc -#include - -VS_VERSION_INFO VERSIONINFO - FILEVERSION COMMAVERSION - PRODUCTVERSION COMMAVERSION - FILEFLAGSMASK 0x3fL -#ifdef DEBUG - FILEFLAGS VS_FF_DEBUG -#else - FILEFLAGS 0x0L -#endif - FILEOS VOS_NT_WINDOWS32 - FILETYPE VFT_DLL - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "FileDescription", "Tcl extension " PROJECT - VALUE "OriginalFilename", PRJLIBNAME - VALUE "FileVersion", DOTVERSION - VALUE "ProductName", "Package " PROJECT " for Tcl" - VALUE "ProductVersion", DOTVERSION - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -<< - -!endif # ifdef RCFILE - -!ifndef DISABLE_IMPLICIT_RULES -DISABLE_IMPLICIT_RULES = 0 -!endif - -!if !$(DISABLE_IMPLICIT_RULES) -# Implicit rule definitions - only for building library objects. For stubs and -# main application, the makefile should define explicit rules. - -{$(ROOT)}.c{$(TMP_DIR)}.obj:: - $(CCPKGCMD) @<< -$< -<< - -{$(WIN_DIR)}.c{$(TMP_DIR)}.obj:: - $(CCPKGCMD) @<< -$< -<< - -{$(GENERICDIR)}.c{$(TMP_DIR)}.obj:: - $(CCPKGCMD) @<< -$< -<< - -{$(COMPATDIR)}.c{$(TMP_DIR)}.obj:: - $(CCPKGCMD) @<< -$< -<< - -{$(RCDIR)}.rc{$(TMP_DIR)}.res: - $(RESCMD) $< - -{$(WIN_DIR)}.rc{$(TMP_DIR)}.res: - $(RESCMD) $< - -{$(TMP_DIR)}.rc{$(TMP_DIR)}.res: - $(RESCMD) $< - -.SUFFIXES: -.SUFFIXES:.c .rc - -!endif - -################################################################ -# 14. Sanity check selected options against Tcl build options -# When building an extension, certain configuration options should -# match the ones used when Tcl was built. Here we check and -# warn on a mismatch. -!if !$(DOING_TCL) - -!if $(TCLINSTALL) # Building against an installed Tcl -!if exist("$(_TCLDIR)\lib\nmake\tcl.nmake") -TCLNMAKECONFIG = "$(_TCLDIR)\lib\nmake\tcl.nmake" -!endif -!else # !$(TCLINSTALL) - building against Tcl source -!if exist("$(_TCLDIR)\win\$(BUILDDIRTOP)\tcl.nmake") -TCLNMAKECONFIG = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcl.nmake" -!endif -!endif # TCLINSTALL - -!if $(CONFIG_CHECK) -!ifdef TCLNMAKECONFIG -!include $(TCLNMAKECONFIG) - -!if defined(CORE_MACHINE) && "$(CORE_MACHINE)" != "$(MACHINE)" -!error ERROR: Build target ($(MACHINE)) does not match the Tcl library architecture ($(CORE_MACHINE)). -!endif -!if $(TCL_VERSION) < 87 && defined(CORE_USE_THREAD_ALLOC) && $(CORE_USE_THREAD_ALLOC) != $(USE_THREAD_ALLOC) -!message WARNING: Value of USE_THREAD_ALLOC ($(USE_THREAD_ALLOC)) does not match its Tcl core value ($(CORE_USE_THREAD_ALLOC)). -!endif -!if defined(CORE_DEBUG) && $(CORE_DEBUG) != $(DEBUG) -!message WARNING: Value of DEBUG ($(DEBUG)) does not match its Tcl library configuration ($(DEBUG)). -!endif -!endif - -!endif # TCLNMAKECONFIG - -!endif # !$(DOING_TCL) - - -#---------------------------------------------------------- -# Display stats being used. -#---------------------------------------------------------- - -!if !$(DOING_TCL) -!message *** Building against Tcl at '$(_TCLDIR)' -!endif -!if !$(DOING_TK) && $(NEED_TK) -!message *** Building against Tk at '$(_TKDIR)' -!endif -!message *** Intermediate directory will be '$(TMP_DIR)' -!message *** Output directory will be '$(OUT_DIR)' -!message *** Installation, if selected, will be in '$(_INSTALLDIR)' -!message *** Suffix for binaries will be '$(SUFX)' -!message *** Compiler version $(VCVER). Target $(MACHINE), host $(NATIVE_ARCH). - -!endif # ifdef _RULES_VC diff --git a/autoconf/tea/win/targets.vc b/autoconf/tea/win/targets.vc deleted file mode 100644 index 49ed7d4a41..0000000000 --- a/autoconf/tea/win/targets.vc +++ /dev/null @@ -1,98 +0,0 @@ -#------------------------------------------------------------- -*- makefile -*- -# targets.vc -- -# -# Part of the nmake based build system for Tcl and its extensions. -# This file defines some standard targets for the convenience of extensions -# and can be optionally included by the extension makefile. -# See TIP 477 (https://core.tcl-lang.org/tips/doc/main/tip/477.md) for docs. - -$(PROJECT): setup pkgindex $(PRJLIB) - -!ifdef PRJ_STUBOBJS -$(PROJECT): $(PRJSTUBLIB) -$(PRJSTUBLIB): $(PRJ_STUBOBJS) - $(LIBCMD) $** - -$(PRJ_STUBOBJS): - $(CCSTUBSCMD) %s -!endif # PRJ_STUBOBJS - -!ifdef PRJ_MANIFEST -$(PROJECT): $(PRJLIB).manifest -$(PRJLIB).manifest: $(PRJ_MANIFEST) - @nmakehlp -s << $** >$@ -@MACHINE@ $(MACHINE:IX86=X86) -<< -!endif - -!if "$(PROJECT)" != "tcl" && "$(PROJECT)" != "tk" -$(PRJLIB): $(PRJ_OBJS) $(RESFILE) -!if $(STATIC_BUILD) - $(LIBCMD) $** -!else - $(DLLCMD) $** - $(_VC_MANIFEST_EMBED_DLL) -!endif - -@del $*.exp -!endif - -!if "$(PRJ_HEADERS)" != "" && "$(PRJ_OBJS)" != "" -$(PRJ_OBJS): $(PRJ_HEADERS) -!endif - -# If parent makefile has defined stub objects, add their installation -# to the default install -!if "$(PRJ_STUBOBJS)" != "" -default-install: default-install-stubs -!endif - -# Unlike the other default targets, these cannot be in rules.vc because -# the executed command depends on existence of macro PRJ_HEADERS_PUBLIC -# that the parent makefile will not define until after including rules-ext.vc -!if "$(PRJ_HEADERS_PUBLIC)" != "" -default-install: default-install-headers -default-install-headers: - @echo Installing headers to '$(INCLUDE_INSTALL_DIR)' - @for %f in ($(PRJ_HEADERS_PUBLIC)) do @$(COPY) %f "$(INCLUDE_INSTALL_DIR)" -!endif - -!if "$(DISABLE_STANDARD_TARGETS)" == "" -DISABLE_STANDARD_TARGETS = 0 -!endif - -!if "$(DISABLE_TARGET_setup)" == "" -DISABLE_TARGET_setup = 0 -!endif -!if "$(DISABLE_TARGET_install)" == "" -DISABLE_TARGET_install = 0 -!endif -!if "$(DISABLE_TARGET_clean)" == "" -DISABLE_TARGET_clean = 0 -!endif -!if "$(DISABLE_TARGET_test)" == "" -DISABLE_TARGET_test = 0 -!endif -!if "$(DISABLE_TARGET_shell)" == "" -DISABLE_TARGET_shell = 0 -!endif - -!if !$(DISABLE_STANDARD_TARGETS) -!if !$(DISABLE_TARGET_setup) -setup: default-setup -!endif -!if !$(DISABLE_TARGET_install) -install: default-install -!endif -!if !$(DISABLE_TARGET_clean) -clean: default-clean -realclean: hose -hose: default-hose -distclean: realclean default-distclean -!endif -!if !$(DISABLE_TARGET_test) -test: default-test -!endif -!if !$(DISABLE_TARGET_shell) -shell: default-shell -!endif -!endif # DISABLE_STANDARD_TARGETS diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl index 75ec46c64c..9ae12929ff 100644 --- a/autosetup/proj.tcl +++ b/autosetup/proj.tcl @@ -76,7 +76,7 @@ set proj_(isatty) [isatty? stdout] # Emits a warning message to stderr. proc proj-warn {args} { show-notices - puts stderr "WARNING: $args" + puts stderr [join [list "WARNING:" {*}$args] " "] } ######################################################################## diff --git a/manifest b/manifest index 580bc0184f..43049f23e0 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\smemory\sleak\sin\ssqlite3session_diff(). -D 2025-04-10T20:52:47.688 +C Initial\sport\sof\sthe\sTEA\sbuild\s(autoconf/tea)\sfrom\sautotools\sto\sautosetup. +D 2025-04-12T02:30:04.750 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -17,25 +17,24 @@ F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2 F art/sqlite370.svg 40b7e2fe8aac3add5d56dd86ab8d427a4eca5bcb3fe4f8946cb3794e1821d531 F auto.def 82c32443a91c1062f7a48beec37dbb2d8d03447b1286bce8df5ebb6d8d353f8a F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac -F autoconf/Makefile.in 78ff1feb1b934b2e9d24ae50a3b4ed9e53ef368b940b9cf10f5a68956ec6de93 +F autoconf/Makefile.in 36516827bb5d2309422bbcbf53e873fa22ef179f5c25b1d3dc6a7255e63270b7 F autoconf/Makefile.msc 5bc67d3912444c40c6f96d003e5c90663e51abb83d204a520110b1b2038dcd8b F autoconf/README.first f1d3876e9a7852c22f275a6f06814e64934cecbc0b5b9617d64849094c1fd136 F autoconf/README.txt b749816b8452b3af994dc6d607394bef3df1736d7e09359f1087de8439a52807 F autoconf/auto.def 3d994f3a9cc9b712dbce92a5708570ddcf3b988141b6eb738f2ed16127a9f0ac -F autoconf/tea/Makefile.in ba0556fee8da09c066bad85a4457904e46ee2c2eabaa309c0e83a78f2f151a8e -F autoconf/tea/README.txt 6c396709b45eb2b3be0ae6dc7e40a140d231962e3a2354da6c4dd48b1d9999bc -F autoconf/tea/aclocal.m4 52c47aac44ce0ddb1f918b6993e8beb8eee88f43 -F autoconf/tea/configure.ac.in f49cd68ed9ab7870ce5d67b8463bcf944232d96ce19dd01461f31098ff688634 +F autoconf/tea/Makefile.in 9ca3a7ccbeda98aaf4d48582905f00b7c3b30c0c2843383dc4424d1e57969c44 +F autoconf/tea/README.txt 656d4686c509d375f5988ff3deda94f65fe6cd8358cd55d1f1dcc7b6e2ff73aa +F autoconf/tea/auto.def 0ee2afbdbf5289fb5ab06d8c4cc9cd6fa8cdd173cf0db962bbb66212c8dc5106 +F autoconf/tea/autosetup/README.txt 17dd4cfae6094b3c239c7ad0a437b13162481e72c60243ba482d180e34314024 +F autoconf/tea/autosetup/teaish-core.tcl 401488767f6caeb69c2fc5133e783a8ee69675a0a295c3333f8a1dcdfe59bfc3 +F autoconf/tea/autosetup/teaish-feature-tests.tcl 4f641aff23eb364d5483dbd2122e070ea279059cab17e24b8108598c2b5f4457 +F autoconf/tea/autosetup/teaish-tester.tcl 6ea18f15260db28961581599de6b675b5118e86da1511b5e5bffdcbbc8d3b42c +F autoconf/tea/configure 80438748ef71927f0d42f3e3db2df62a7a5d1eb65be3944ea589184d269d903e x F autoconf/tea/doc/sqlite3.n 4499e2b556710dd4f9ea76a0bb35bd9616769dc4d33858213b075de8f6334872 F autoconf/tea/license.terms 13bd403c9610fd2b76ece0ab50c4c5eda933d523 -F autoconf/tea/pkgIndex.tcl.in 55aec3c6d7e9a1de9b8d2fdc9c27fd055da3ac3a51b572195e2ae7300bcfd3a2 -F autoconf/tea/tclconfig/install-sh 2182b3705d92e25753411e2c28cf788c69e35a48fbb8aa332e342dfc6b95b80d -F autoconf/tea/tclconfig/tcl.m4 284faa1d9cf66c1efb42817beb5c8a63626fb35bf903993d4f11fde75677cc1a -F autoconf/tea/win/makefile.vc 55721106928894cb818164a8ce054da11d948948f5a92a54d262dd0a6a891d4d -F autoconf/tea/win/nmakehlp.c b01f822eabbe1ed2b64e70882d97d48402b42d2689a1ea00342d1a1a7eaa19cb -F autoconf/tea/win/rules-ext.vc fd5740d97aac8c41c97eaa0fbcc0c15a41b6f7075d5f9f593e147d7a284a247a -F autoconf/tea/win/rules.vc 94a18c3e453535459b4a643983acca52fb8756e79055bd2ad4b0999d66484f4c -F autoconf/tea/win/targets.vc 96a25a1fa6e9e9cfb348fd3760a5395b4ce8acafc8ed10f0412937ec200d5dbd +F autoconf/tea/pkgIndex.tcl.in ea13b90006ef3f1205f46fbd382736fe2f364caa644cc8e958c83a78ac7fa1d1 +F autoconf/tea/teaish.tcl ea6b73ebe5849fe0e2bc7a1877a18da6c003e255554e5b22c1fea16bba6d1439 +F autoconf/tea/teaish.tester.tcl.in 743fd0fe1e667f82fd8fc3ebe0a5c77763e4dbed7bbc8605a9d4b1d0663dac78 F autosetup/LICENSE 41a26aebdd2cd185d1e2b210f71b7ce234496979f6b35aef2cbf6b80cbed4ce4 F autosetup/README.autosetup a78ff8c4a3d2636a4268736672a74bf14a82f42687fcf0631a70c516075c031e F autosetup/README.md f324bb9f9bf1cc787122034df53fbfdfed28ee2657e6652b763d992ab0d04829 @@ -51,7 +50,7 @@ F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e F autosetup/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1821baf61bc86a7e F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba -F autosetup/proj.tcl e4170f543e417fcc1ae3c8aedcf8d6044221dbdeb880d324579730e0c96a6198 +F autosetup/proj.tcl 2ab356dd6a2c43c25044820b5eab5021c2ad373416bde36243405cf93a509969 F autosetup/sqlite-config.tcl a61e86a4033e3a77680bfba45e7950950285beaf756ddc2d14bec5147972d2b1 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x @@ -2152,7 +2151,7 @@ F tool/logest.c c34e5944318415de513d29a6098df247a9618c96d83c38d4abd88641fe46e669 F tool/max-limits.c cbb635fbb37ae4d05f240bfb5b5270bb63c54439 F tool/merge-test.tcl de76b62f2de2a92d4c1ca4f976bce0aea6899e0229e250479b229b2a1914b176 F tool/mkamalzip.tcl 8aa5ebe7973c8b8774062d34e15fea9815c4cc2ceea3a9b184695f005910876a -F tool/mkautoconfamal.sh 401f6378a99bb045b63abe8c2dad6bd6fd5a1c2b9c8cded9d7ac5848ea578994 +F tool/mkautoconfamal.sh 9947a17b6ce7eac3f139be4d4a0b9e8a1672c3fd0a2b870a48ddfb3f6461c094 F tool/mkccode.tcl c42a8f8cf78f92e83795d5447460dbce7aaf78a3bbf9082f1507dc71a3665f3c x F tool/mkctimec.tcl f76dbfc74cefad8d126384ba3263677939f077bd184fcdf8c592a1daf64f50c3 x F tool/mkkeywordhash.c 6b0be901c47f9ad42215fc995eb2f4384ac49213b1fba395102ec3e999acf559 @@ -2216,8 +2215,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 0e5e0e2f558a417d57c01a2d62cb2117d2adf6ddbc62e6a0208ae23f19b05347 -R ea8e02173c6f4e7238e9e39c21ec2d22 -U dan -Z fad13ff67cc688b0b5e83e82f9779719 +P a6cbc5db1c4973ea236874bd9c24cd86dc48fbc7a10e424896c0407c7c32ce6a +R f3d207dbee46dba15a1c65b83e43fe61 +U stephan +Z c1cf051277bbad0070552a6d2485794b # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 97db019baa..fdac3fe06c 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a6cbc5db1c4973ea236874bd9c24cd86dc48fbc7a10e424896c0407c7c32ce6a +95227341cf290ca6f20b5ff7e707a28b59f87784947425c3fd1d8e5e7eb878a4 diff --git a/tool/mkautoconfamal.sh b/tool/mkautoconfamal.sh index 9ccf8b6558..8d104c020c 100644 --- a/tool/mkautoconfamal.sh +++ b/tool/mkautoconfamal.sh @@ -25,20 +25,6 @@ VERSION=`cat $TOP/VERSION` HASH=`cut -c1-10 $TOP/manifest.uuid` DATETIME=`grep '^D' $TOP/manifest | tr -c -d '[0-9]' | cut -c1-12` -# Inject the current version into the TEA autoconf file. -# -sed -e "s/@VERSION@/$VERSION/" \ - < $TOP/autoconf/tea/configure.ac.in \ - > $TOP/autoconf/tea/configure.ac -# And then verify that that worked... -# -if grep $VERSION $TOP/autoconf/tea/configure.ac > /dev/null -then echo "TEA version number ok" -else echo "TEA version number mismatch. Should be $VERSION"; exit 1 -fi - - - # If this script is given an argument of --snapshot, then generate a # snapshot tarball named for the current checkout SHA hash, rather than # the version number. @@ -88,6 +74,9 @@ rm -f ./*~ #fi mkdir -p tea/generic +mv tea/autosetup/*.tcl autosetup/. +rm -fr tea/autosetup + cat < tea/generic/tclsqlite3.c #ifdef USE_SYSTEM_SQLITE # include @@ -97,12 +86,7 @@ cat < tea/generic/tclsqlite3.c EOF cat $TOP/src/tclsqlite.c >> tea/generic/tclsqlite3.c -cd tea -rm -f configure.ac.in -autoconf -rm -rf autom4te.cache - -cd ../ +find . -type f -name '*~' -exec rm -f \{} \; ./configure && make dist tar xzf sqlite-$VERSION.tar.gz mv sqlite-$VERSION $TARBALLNAME From 71b7e44869b5cb42d2299bd13247a9c52357d1e6 Mon Sep 17 00:00:00 2001 From: stephan Date: Sat, 12 Apr 2025 02:44:02 +0000 Subject: [PATCH 088/120] Correct out-of-tree build for autoconf/tea. FossilOrigin-Name: 955b516618a34eac69da25fc7405015701a72f3cb918fca0cda7d316f6c3db9a --- autoconf/tea/autosetup/teaish-core.tcl | 4 ++-- autoconf/tea/configure | 7 +++++-- autoconf/tea/teaish.tcl | 4 ++-- manifest | 16 ++++++++-------- manifest.uuid | 2 +- 5 files changed, 18 insertions(+), 15 deletions(-) diff --git a/autoconf/tea/autosetup/teaish-core.tcl b/autoconf/tea/autosetup/teaish-core.tcl index ecc614e4c0..48babe84c8 100644 --- a/autoconf/tea/autosetup/teaish-core.tcl +++ b/autoconf/tea/autosetup/teaish-core.tcl @@ -633,7 +633,7 @@ proc teaish__find-extension {} { # We use the first one we find in the builddir or srcdir. # if {"" eq $extT} { - set flist [list $dext/teaish.tcl];# $dsrc/teaish.tcl] + set flist [list $dext/teaish.tcl $dsrc/teaish.tcl] if {![proj-first-file-found $flist extT]} { if {"--help" in $::argv} { return 0 @@ -665,7 +665,7 @@ use --teaish-extension-dir=/path/to/extension" # the builddir or the srcdir. # if {"" eq $extM} { - set flist [list $dext/teaish.make.in];# $dsrc/teaish.make.in] + set flist [list $dext/teaish.make.in $dsrc/teaish.make.in] proj-first-file-found $flist extM } if {"" ne $extM && [file readable $extM]} { diff --git a/autoconf/tea/configure b/autoconf/tea/configure index 82751815f9..47378126f5 100755 --- a/autoconf/tea/configure +++ b/autoconf/tea/configure @@ -1,4 +1,7 @@ #!/bin/sh -dir="`dirname "$0"`/../autosetup" +dir0="`dirname "$0"`" +dirA="$dir0/../autosetup" # This is the case ^^^^^^^^^^^^ in the SQLite "autoconf" bundle. -WRAPPER="$0"; export WRAPPER; exec "`"$dir/autosetup-find-tclsh"`" "$dir/autosetup" "$@" +WRAPPER="$0"; export WRAPPER; exec "`"$dirA/autosetup-find-tclsh"`" \ + "$dirA/autosetup" --teaish-extension-dir="$dir0" \ + "$@" diff --git a/autoconf/tea/teaish.tcl b/autoconf/tea/teaish.tcl index ba56680878..d4a43f46f7 100644 --- a/autoconf/tea/teaish.tcl +++ b/autoconf/tea/teaish.tcl @@ -7,7 +7,7 @@ define TEAISH_LOAD_PREFIX Sqlite3; # 2nd arg to [load] # # Get the version... # -define TEAISH_VERSION [proj-file-content -trim ../VERSION] +define TEAISH_VERSION [proj-file-content -trim [get-define TEAISH_DIR]/../VERSION] proj-assert {[string match 3.*.* [get-define TEAISH_VERSION]]} # @@ -72,7 +72,7 @@ proc teaish-configure {} { set srcdir [get-define TEAISH_DIR] teaish-add-src -dist -dir generic/tclsqlite3.c - teaish-add-cflags -I.. ; # for sqlite3.c + teaish-add-cflags -I${srcdir}/.. ; # for sqlite3.c if {[proj-opt-was-provided override-sqlite-version]} { define TEAISH_VERSION [opt-val override-sqlite-version] msg-result "NOTICE: overriding version number: [get-define TEAISH_VERSION]" diff --git a/manifest b/manifest index 43049f23e0..52f98dd469 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Initial\sport\sof\sthe\sTEA\sbuild\s(autoconf/tea)\sfrom\sautotools\sto\sautosetup. -D 2025-04-12T02:30:04.750 +C Correct\sout-of-tree\sbuild\sfor\sautoconf/tea. +D 2025-04-12T02:44:02.397 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -26,14 +26,14 @@ F autoconf/tea/Makefile.in 9ca3a7ccbeda98aaf4d48582905f00b7c3b30c0c2843383dc4424 F autoconf/tea/README.txt 656d4686c509d375f5988ff3deda94f65fe6cd8358cd55d1f1dcc7b6e2ff73aa F autoconf/tea/auto.def 0ee2afbdbf5289fb5ab06d8c4cc9cd6fa8cdd173cf0db962bbb66212c8dc5106 F autoconf/tea/autosetup/README.txt 17dd4cfae6094b3c239c7ad0a437b13162481e72c60243ba482d180e34314024 -F autoconf/tea/autosetup/teaish-core.tcl 401488767f6caeb69c2fc5133e783a8ee69675a0a295c3333f8a1dcdfe59bfc3 +F autoconf/tea/autosetup/teaish-core.tcl 3d5d66ae83704330662f48165b5f8d914640ffdb5d6910c98c6499ec87404563 F autoconf/tea/autosetup/teaish-feature-tests.tcl 4f641aff23eb364d5483dbd2122e070ea279059cab17e24b8108598c2b5f4457 F autoconf/tea/autosetup/teaish-tester.tcl 6ea18f15260db28961581599de6b675b5118e86da1511b5e5bffdcbbc8d3b42c -F autoconf/tea/configure 80438748ef71927f0d42f3e3db2df62a7a5d1eb65be3944ea589184d269d903e x +F autoconf/tea/configure d0b12b984edca6030d1976375b80157ac78b5b90a5b4f0dcee39357f63f4a80b x F autoconf/tea/doc/sqlite3.n 4499e2b556710dd4f9ea76a0bb35bd9616769dc4d33858213b075de8f6334872 F autoconf/tea/license.terms 13bd403c9610fd2b76ece0ab50c4c5eda933d523 F autoconf/tea/pkgIndex.tcl.in ea13b90006ef3f1205f46fbd382736fe2f364caa644cc8e958c83a78ac7fa1d1 -F autoconf/tea/teaish.tcl ea6b73ebe5849fe0e2bc7a1877a18da6c003e255554e5b22c1fea16bba6d1439 +F autoconf/tea/teaish.tcl 12a05b5763b6eb3d312c826844e6d21b7695373afc9afa473c6edcadaf2b53b5 F autoconf/tea/teaish.tester.tcl.in 743fd0fe1e667f82fd8fc3ebe0a5c77763e4dbed7bbc8605a9d4b1d0663dac78 F autosetup/LICENSE 41a26aebdd2cd185d1e2b210f71b7ce234496979f6b35aef2cbf6b80cbed4ce4 F autosetup/README.autosetup a78ff8c4a3d2636a4268736672a74bf14a82f42687fcf0631a70c516075c031e @@ -2215,8 +2215,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P a6cbc5db1c4973ea236874bd9c24cd86dc48fbc7a10e424896c0407c7c32ce6a -R f3d207dbee46dba15a1c65b83e43fe61 +P 95227341cf290ca6f20b5ff7e707a28b59f87784947425c3fd1d8e5e7eb878a4 +R 3cc3ff6fd9dc8c1dc6e629ff46b63fc4 U stephan -Z c1cf051277bbad0070552a6d2485794b +Z 2ea84868f01b833ad43bece152510791 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index fdac3fe06c..5dd05b4d04 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -95227341cf290ca6f20b5ff7e707a28b59f87784947425c3fd1d8e5e7eb878a4 +955b516618a34eac69da25fc7405015701a72f3cb918fca0cda7d316f6c3db9a From 22a85a418e0e99161e6c1e55dd33d406238476fd Mon Sep 17 00:00:00 2001 From: stephan Date: Sat, 12 Apr 2025 03:08:13 +0000 Subject: [PATCH 089/120] Add missing exports of various LDFLAGS and CFLAGS for the teaish build. FossilOrigin-Name: 7462b1c66e8b3799ba1d73a1b815993e1c511ac0b7263e747ca0186d263ad001 --- autoconf/tea/autosetup/teaish-core.tcl | 45 +++++++++++++++++++++++--- autoconf/tea/teaish.tcl | 7 ++++ manifest | 16 ++++----- manifest.uuid | 2 +- tool/mkautoconfamal.sh | 1 + 5 files changed, 58 insertions(+), 13 deletions(-) diff --git a/autoconf/tea/autosetup/teaish-core.tcl b/autoconf/tea/autosetup/teaish-core.tcl index 48babe84c8..25c17276f9 100644 --- a/autoconf/tea/autosetup/teaish-core.tcl +++ b/autoconf/tea/autosetup/teaish-core.tcl @@ -721,18 +721,34 @@ proc teaish__append_stuff {def args} { } } -# @teaish-add-cflags cflags... +# @teaish-add-cflags ?-define? cflags... +# # Appends all non-empty $args to TEAISH_CFLAGS +# +# If -define is used then each flag is assumed to be a [define]'d +# symbol name and [get-define X ""] used to fetch it. proc teaish-add-cflags {args} { + set isdefs 0 + if {[lindex $args 0] in {-d -define}} { + set args [lassign $args -] + set xargs [list] + foreach arg $args { + lappend xargs [get-define $arg ""] + } + set args $xargs + } teaish__append_stuff TEAISH_CFLAGS {*}$args } -# @teaish-add-cflags ?-p|-prepend? ldflags... +# @teaish-add-cflags ?-p|-prepend? ?-define? ldflags... # # Appends all non-empty $args to TEAISH_LDFLAGS unless the first # argument is one of (-p | -prepend), in which case it prepends all # arguments, in their given order, to TEAISH_LDFLAGS. # +# If -define is used then each argument is assumed to be a [define]'d +# flag and [get-define X ""] is used to fetch it. +# # Typically, -lXYZ flags need to be in "reverse" order, with each -lY # resolving symbols for -lX's to its left. This order is largely # historical, and not relevant on all environments, but it is @@ -740,8 +756,29 @@ proc teaish-add-cflags {args} { # # See: teaish-prepend-ldflags proc teaish-add-ldflags {args} { - if {[lindex $args 0] in {-p -prepend}} { - set args [lassign $args -] + set prepend 0 + set isdefs 0 + set xargs [list] + foreach arg $args { + switch -exact -- $arg { + -p - -prepend { set prepend 1 } + -d - -define { + set isdefs 1 + } + default { + lappend xargs $arg + } + } + } + set args $xargs + if {$isdefs} { + set xargs [list] + foreach arg $args { + lappend xargs [get-define $arg ""] + } + set args $xargs + } + if {$prepend} { lappend args {*}[get-define TEAISH_LDFLAGS ""] define TEAISH_LDFLAGS [join $args]; # join to eliminate {} entries } else { diff --git a/autoconf/tea/teaish.tcl b/autoconf/tea/teaish.tcl index d4a43f46f7..0f3a4ad472 100644 --- a/autoconf/tea/teaish.tcl +++ b/autoconf/tea/teaish.tcl @@ -106,6 +106,13 @@ proc teaish-configure {} { sqlite-handle-math sqlite-handle-icu sqlite-handle-common-feature-flags + + teaish-add-ldflags -d \ + LDFLAGS_LIBICU LDFLAGS_LIBMATH LDFLAGS_DLOPEN \ + LDFLAGS_LIBRT LDFLAGS_LIBZ + + teaish-add-cflags -define CFLAGS_LIBICU OPT_FEATURE_FLAGS + }; # teaish-configure diff --git a/manifest b/manifest index 52f98dd469..e3003ce869 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Correct\sout-of-tree\sbuild\sfor\sautoconf/tea. -D 2025-04-12T02:44:02.397 +C Add\smissing\sexports\sof\svarious\sLDFLAGS\sand\sCFLAGS\sfor\sthe\steaish\sbuild. +D 2025-04-12T03:08:13.139 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -26,14 +26,14 @@ F autoconf/tea/Makefile.in 9ca3a7ccbeda98aaf4d48582905f00b7c3b30c0c2843383dc4424 F autoconf/tea/README.txt 656d4686c509d375f5988ff3deda94f65fe6cd8358cd55d1f1dcc7b6e2ff73aa F autoconf/tea/auto.def 0ee2afbdbf5289fb5ab06d8c4cc9cd6fa8cdd173cf0db962bbb66212c8dc5106 F autoconf/tea/autosetup/README.txt 17dd4cfae6094b3c239c7ad0a437b13162481e72c60243ba482d180e34314024 -F autoconf/tea/autosetup/teaish-core.tcl 3d5d66ae83704330662f48165b5f8d914640ffdb5d6910c98c6499ec87404563 +F autoconf/tea/autosetup/teaish-core.tcl 3e2ebf01d65e111c57ab0fb5ebad8a74459820976bbff1b609261e52a09388ee F autoconf/tea/autosetup/teaish-feature-tests.tcl 4f641aff23eb364d5483dbd2122e070ea279059cab17e24b8108598c2b5f4457 F autoconf/tea/autosetup/teaish-tester.tcl 6ea18f15260db28961581599de6b675b5118e86da1511b5e5bffdcbbc8d3b42c F autoconf/tea/configure d0b12b984edca6030d1976375b80157ac78b5b90a5b4f0dcee39357f63f4a80b x F autoconf/tea/doc/sqlite3.n 4499e2b556710dd4f9ea76a0bb35bd9616769dc4d33858213b075de8f6334872 F autoconf/tea/license.terms 13bd403c9610fd2b76ece0ab50c4c5eda933d523 F autoconf/tea/pkgIndex.tcl.in ea13b90006ef3f1205f46fbd382736fe2f364caa644cc8e958c83a78ac7fa1d1 -F autoconf/tea/teaish.tcl 12a05b5763b6eb3d312c826844e6d21b7695373afc9afa473c6edcadaf2b53b5 +F autoconf/tea/teaish.tcl 241824df34b1439df433e505bc302076a672487665c7519be27efefed7462271 F autoconf/tea/teaish.tester.tcl.in 743fd0fe1e667f82fd8fc3ebe0a5c77763e4dbed7bbc8605a9d4b1d0663dac78 F autosetup/LICENSE 41a26aebdd2cd185d1e2b210f71b7ce234496979f6b35aef2cbf6b80cbed4ce4 F autosetup/README.autosetup a78ff8c4a3d2636a4268736672a74bf14a82f42687fcf0631a70c516075c031e @@ -2151,7 +2151,7 @@ F tool/logest.c c34e5944318415de513d29a6098df247a9618c96d83c38d4abd88641fe46e669 F tool/max-limits.c cbb635fbb37ae4d05f240bfb5b5270bb63c54439 F tool/merge-test.tcl de76b62f2de2a92d4c1ca4f976bce0aea6899e0229e250479b229b2a1914b176 F tool/mkamalzip.tcl 8aa5ebe7973c8b8774062d34e15fea9815c4cc2ceea3a9b184695f005910876a -F tool/mkautoconfamal.sh 9947a17b6ce7eac3f139be4d4a0b9e8a1672c3fd0a2b870a48ddfb3f6461c094 +F tool/mkautoconfamal.sh 3e9ff23d3f63ccc82097022208859ff961faf7f171041695b369b9443fb907dc F tool/mkccode.tcl c42a8f8cf78f92e83795d5447460dbce7aaf78a3bbf9082f1507dc71a3665f3c x F tool/mkctimec.tcl f76dbfc74cefad8d126384ba3263677939f077bd184fcdf8c592a1daf64f50c3 x F tool/mkkeywordhash.c 6b0be901c47f9ad42215fc995eb2f4384ac49213b1fba395102ec3e999acf559 @@ -2215,8 +2215,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 95227341cf290ca6f20b5ff7e707a28b59f87784947425c3fd1d8e5e7eb878a4 -R 3cc3ff6fd9dc8c1dc6e629ff46b63fc4 +P 955b516618a34eac69da25fc7405015701a72f3cb918fca0cda7d316f6c3db9a +R 48e7957df92ab14c3490cd95c8142140 U stephan -Z 2ea84868f01b833ad43bece152510791 +Z 8897e2da99fcd312c2d10a48bd959303 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 5dd05b4d04..37d9203cbd 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -955b516618a34eac69da25fc7405015701a72f3cb918fca0cda7d316f6c3db9a +7462b1c66e8b3799ba1d73a1b815993e1c511ac0b7263e747ca0186d263ad001 diff --git a/tool/mkautoconfamal.sh b/tool/mkautoconfamal.sh index 8d104c020c..7c9ee06a7b 100644 --- a/tool/mkautoconfamal.sh +++ b/tool/mkautoconfamal.sh @@ -87,6 +87,7 @@ EOF cat $TOP/src/tclsqlite.c >> tea/generic/tclsqlite3.c find . -type f -name '*~' -exec rm -f \{} \; + ./configure && make dist tar xzf sqlite-$VERSION.tar.gz mv sqlite-$VERSION $TARBALLNAME From a69b2b29739a0f50bd9a2f0116e92bed0d0a01e3 Mon Sep 17 00:00:00 2001 From: stephan Date: Sat, 12 Apr 2025 03:20:42 +0000 Subject: [PATCH 090/120] Add missing teaish.test.tcl. FossilOrigin-Name: 3946a3ad9cd2d03b6940621066a8e5be0bd6fade88cbf6cb2823425a90eba9c9 --- autoconf/tea/teaish.test.tcl | 14 ++++++++++++++ manifest | 11 ++++++----- manifest.uuid | 2 +- 3 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 autoconf/tea/teaish.test.tcl diff --git a/autoconf/tea/teaish.test.tcl b/autoconf/tea/teaish.test.tcl new file mode 100644 index 0000000000..b63c9426e3 --- /dev/null +++ b/autoconf/tea/teaish.test.tcl @@ -0,0 +1,14 @@ +test-expect 1.0-open { + sqlite3 db :memory: +} {} + +test-assert 1.1-version-3.x { + [string match 3.* [db eval {select sqlite_version()}]] +} + +test-expect 1.2-select { + db eval {select 'hi, world',1,2,3} +} {{hi, world} 1 2 3} + + +test-expect 99.0-db-close {db close} {} diff --git a/manifest b/manifest index e3003ce869..f88e22cf81 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\smissing\sexports\sof\svarious\sLDFLAGS\sand\sCFLAGS\sfor\sthe\steaish\sbuild. -D 2025-04-12T03:08:13.139 +C Add\smissing\steaish.test.tcl. +D 2025-04-12T03:20:42.834 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -34,6 +34,7 @@ F autoconf/tea/doc/sqlite3.n 4499e2b556710dd4f9ea76a0bb35bd9616769dc4d33858213b0 F autoconf/tea/license.terms 13bd403c9610fd2b76ece0ab50c4c5eda933d523 F autoconf/tea/pkgIndex.tcl.in ea13b90006ef3f1205f46fbd382736fe2f364caa644cc8e958c83a78ac7fa1d1 F autoconf/tea/teaish.tcl 241824df34b1439df433e505bc302076a672487665c7519be27efefed7462271 +F autoconf/tea/teaish.test.tcl cfe94e1fb79dd078f650295be59843d470125e0cc3a17a1414c1fb8d77f4aea6 F autoconf/tea/teaish.tester.tcl.in 743fd0fe1e667f82fd8fc3ebe0a5c77763e4dbed7bbc8605a9d4b1d0663dac78 F autosetup/LICENSE 41a26aebdd2cd185d1e2b210f71b7ce234496979f6b35aef2cbf6b80cbed4ce4 F autosetup/README.autosetup a78ff8c4a3d2636a4268736672a74bf14a82f42687fcf0631a70c516075c031e @@ -2215,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 955b516618a34eac69da25fc7405015701a72f3cb918fca0cda7d316f6c3db9a -R 48e7957df92ab14c3490cd95c8142140 +P 7462b1c66e8b3799ba1d73a1b815993e1c511ac0b7263e747ca0186d263ad001 +R a63487aeced1a079bed4e4ecb736a066 U stephan -Z 8897e2da99fcd312c2d10a48bd959303 +Z d3640194c58031ae14dcf79915b66d12 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 37d9203cbd..e83d5b457b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -7462b1c66e8b3799ba1d73a1b815993e1c511ac0b7263e747ca0186d263ad001 +3946a3ad9cd2d03b6940621066a8e5be0bd6fade88cbf6cb2823425a90eba9c9 From 807186f1d3ece86eddc468bca9e145b6d2626751 Mon Sep 17 00:00:00 2001 From: stephan Date: Sat, 12 Apr 2025 10:33:12 +0000 Subject: [PATCH 091/120] Eliminate a duplicate -lz flag in the teaish build. FossilOrigin-Name: 5efb372c9b0d46625cb17aa3e48ead0da2483ca9d04d1507c9d728763f1ee959 --- autoconf/tea/teaish.tcl | 4 ++-- manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/autoconf/tea/teaish.tcl b/autoconf/tea/teaish.tcl index 0f3a4ad472..9b61bf5540 100644 --- a/autoconf/tea/teaish.tcl +++ b/autoconf/tea/teaish.tcl @@ -107,9 +107,9 @@ proc teaish-configure {} { sqlite-handle-icu sqlite-handle-common-feature-flags - teaish-add-ldflags -d \ + teaish-add-ldflags -p -d \ LDFLAGS_LIBICU LDFLAGS_LIBMATH LDFLAGS_DLOPEN \ - LDFLAGS_LIBRT LDFLAGS_LIBZ + LDFLAGS_LIBRT teaish-add-cflags -define CFLAGS_LIBICU OPT_FEATURE_FLAGS diff --git a/manifest b/manifest index f88e22cf81..d1dc054547 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\smissing\steaish.test.tcl. -D 2025-04-12T03:20:42.834 +C Eliminate\sa\sduplicate\s-lz\sflag\sin\sthe\steaish\sbuild. +D 2025-04-12T10:33:12.462 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -33,7 +33,7 @@ F autoconf/tea/configure d0b12b984edca6030d1976375b80157ac78b5b90a5b4f0dcee39357 F autoconf/tea/doc/sqlite3.n 4499e2b556710dd4f9ea76a0bb35bd9616769dc4d33858213b075de8f6334872 F autoconf/tea/license.terms 13bd403c9610fd2b76ece0ab50c4c5eda933d523 F autoconf/tea/pkgIndex.tcl.in ea13b90006ef3f1205f46fbd382736fe2f364caa644cc8e958c83a78ac7fa1d1 -F autoconf/tea/teaish.tcl 241824df34b1439df433e505bc302076a672487665c7519be27efefed7462271 +F autoconf/tea/teaish.tcl 057026fec1f49eb1226445ec60a948fec12957ca032a16259e40ab19761d01f4 F autoconf/tea/teaish.test.tcl cfe94e1fb79dd078f650295be59843d470125e0cc3a17a1414c1fb8d77f4aea6 F autoconf/tea/teaish.tester.tcl.in 743fd0fe1e667f82fd8fc3ebe0a5c77763e4dbed7bbc8605a9d4b1d0663dac78 F autosetup/LICENSE 41a26aebdd2cd185d1e2b210f71b7ce234496979f6b35aef2cbf6b80cbed4ce4 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 7462b1c66e8b3799ba1d73a1b815993e1c511ac0b7263e747ca0186d263ad001 -R a63487aeced1a079bed4e4ecb736a066 +P 3946a3ad9cd2d03b6940621066a8e5be0bd6fade88cbf6cb2823425a90eba9c9 +R 46ccc202ec9ce5285701d9f13d86d659 U stephan -Z d3640194c58031ae14dcf79915b66d12 +Z c87986dd454c7631e261b8a1b3d6c206 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index e83d5b457b..881ee465f6 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -3946a3ad9cd2d03b6940621066a8e5be0bd6fade88cbf6cb2823425a90eba9c9 +5efb372c9b0d46625cb17aa3e48ead0da2483ca9d04d1507c9d728763f1ee959 From 6b0429676e149b8413847cbb17e614b00b5bb11c Mon Sep 17 00:00:00 2001 From: stephan Date: Sat, 12 Apr 2025 18:37:53 +0000 Subject: [PATCH 092/120] Doc typo fix. FossilOrigin-Name: 10b917040b167de6aba6ee434b4e982580e690bbfe80521e34236b29d8e00b7d --- autoconf/tea/teaish.tcl | 6 +++--- manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/autoconf/tea/teaish.tcl b/autoconf/tea/teaish.tcl index 9b61bf5540..f5b54ef70f 100644 --- a/autoconf/tea/teaish.tcl +++ b/autoconf/tea/teaish.tcl @@ -1,4 +1,4 @@ -# teaish.tcl configure script extension for the SQLite TCL extension +# Teaish configure script extension for the SQLite TCL extension define TEAISH_NAME sqlite define TEAISH_PKGNAME sqlite3 @@ -64,8 +64,8 @@ proc teaish-options {} { } # -# Gets called by tea-configure. Must perform any configuration work -# needed for this extension. +# Gets called by tea-configure-core. Must perform any configuration +# work needed for this extension. # proc teaish-configure {} { uplevel 1 {use teaish-feature-tests} diff --git a/manifest b/manifest index d1dc054547..bc69fee407 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Eliminate\sa\sduplicate\s-lz\sflag\sin\sthe\steaish\sbuild. -D 2025-04-12T10:33:12.462 +C Doc\stypo\sfix. +D 2025-04-12T18:37:53.003 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -33,7 +33,7 @@ F autoconf/tea/configure d0b12b984edca6030d1976375b80157ac78b5b90a5b4f0dcee39357 F autoconf/tea/doc/sqlite3.n 4499e2b556710dd4f9ea76a0bb35bd9616769dc4d33858213b075de8f6334872 F autoconf/tea/license.terms 13bd403c9610fd2b76ece0ab50c4c5eda933d523 F autoconf/tea/pkgIndex.tcl.in ea13b90006ef3f1205f46fbd382736fe2f364caa644cc8e958c83a78ac7fa1d1 -F autoconf/tea/teaish.tcl 057026fec1f49eb1226445ec60a948fec12957ca032a16259e40ab19761d01f4 +F autoconf/tea/teaish.tcl 2ef641703ea6ae28c42975bd052c2e2b7ac85f9b688af2c2bb1f4dbfb2fa1bb9 F autoconf/tea/teaish.test.tcl cfe94e1fb79dd078f650295be59843d470125e0cc3a17a1414c1fb8d77f4aea6 F autoconf/tea/teaish.tester.tcl.in 743fd0fe1e667f82fd8fc3ebe0a5c77763e4dbed7bbc8605a9d4b1d0663dac78 F autosetup/LICENSE 41a26aebdd2cd185d1e2b210f71b7ce234496979f6b35aef2cbf6b80cbed4ce4 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 3946a3ad9cd2d03b6940621066a8e5be0bd6fade88cbf6cb2823425a90eba9c9 -R 46ccc202ec9ce5285701d9f13d86d659 +P 5efb372c9b0d46625cb17aa3e48ead0da2483ca9d04d1507c9d728763f1ee959 +R 44757aae6b6ff2b8e259ee9b90838263 U stephan -Z c87986dd454c7631e261b8a1b3d6c206 +Z d92258278db7fc019af802c560356f96 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 881ee465f6..9c76c820b4 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -5efb372c9b0d46625cb17aa3e48ead0da2483ca9d04d1507c9d728763f1ee959 +10b917040b167de6aba6ee434b4e982580e690bbfe80521e34236b29d8e00b7d From 837dc09bce7de8971c7488b70cf5da93c60fbed0 Mon Sep 17 00:00:00 2001 From: stephan Date: Sat, 12 Apr 2025 19:26:18 +0000 Subject: [PATCH 093/120] Move the post-configure dot-in-file validation from sqlite-config.tcl to proj.tcl for reuse in the tea port and other downstream trees. FossilOrigin-Name: 0bac496d5c92c979295e702efc01803f6985b54d3d8ca30dce077c9776f7dcf2 --- autosetup/proj.tcl | 40 ++++++++++++++++++++++++++++--------- autosetup/sqlite-config.tcl | 22 +------------------- manifest | 16 +++++++-------- manifest.uuid | 2 +- 4 files changed, 41 insertions(+), 39 deletions(-) diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl index 75ec46c64c..33daa18347 100644 --- a/autosetup/proj.tcl +++ b/autosetup/proj.tcl @@ -67,7 +67,7 @@ array set proj_ {} # # See: proj-dot-ins-append and proj-dot-ins-process # -set proj_(dot-in-files) {} +set proj_(dot-in-files) [list] set proj_(isatty) [isatty? stdout] ######################################################################## @@ -1542,7 +1542,7 @@ proc proj-tweak-default-env-dirs {} { # processing the file. In the context of that script, the vars # $fileIn and $fileOut will be set to the input and output file # names. This can be used, for example, to make the output file -# executable or perform validation on its. +# executable or perform validation on its contents. # # See [proj-dot-ins-process], [proj-dot-ins-list] proc proj-dot-ins-append {fileIn args} { @@ -1576,32 +1576,54 @@ proc proj-dot-ins-list {} { } ######################################################################## -# @proj-dot-ins-process ?-touch? +# @proj-dot-ins-process ?-touch? ?-validate? ?-clear? # # Each file which has previously been passed to [proj-dot-ins-append] # is processed, with its passing its in-file out-file names to # [proj-make-from-dot-in]. # -# The optional argument may be the -touch flag, which is passed on to -# that [proj-make-from-dot-in]. -# # The intent is that a project accumulate any number of files to # filter and delay their actual filtering until the last stage of the # configure script, calling this function at that time. +# +# Optional flags: +# +# -touch: gets passed on to [proj-make-from-dot-in] +# +# -validate: after processing each file, before running the file's +# associated script, if any, it runs the file through +# proj-validate-no-unresolved-ats, erroring out if that does. +# +# -clear: after processing, empty the dot-ins list. This effectively +# makes proj-dot-ins-append available for re-use. proc proj-dot-ins-process {args} { set flags "" - if {"-touch" eq $args} { - set flags "-touch" + set clear 0 + set validate 0 + foreach arg $args { + switch -exact -- $arg { + -touch {set flags "-touch"} + -clear {incr clear} + -validate {incr validate} + default break + } } foreach f $::proj_(dot-in-files) { - proj-assert {3==[llength $f]} + proj-assert {3==[llength $f]} \ + "Expecting proj-dot-ins-list to be stored in 3-entry lists" lassign $f fIn fOut fScript #puts "DOING $fIn ==> $fOut" proj-make-from-dot-in {*}$flags $fIn $fOut + if {$validate} { + proj-validate-no-unresolved-ats $fOut + } if {"" ne $fScript} { uplevel 1 "set fileIn $fIn; set fileOut $fOut; eval {$fScript}" } } + if {$clear} { + set ::proj_(dot-in-files) [list] + } } ######################################################################## diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl index 0e50f9dd25..3042b7bedb 100644 --- a/autosetup/sqlite-config.tcl +++ b/autosetup/sqlite-config.tcl @@ -526,7 +526,6 @@ proc sqlite-configure-finalize {} { sqlite-handle-common-feature-flags sqlite-finalize-feature-flags sqlite-process-dot-in-files; # do not [define] anything after this - sqlite-post-config-validation sqlite-dump-defines } @@ -1716,7 +1715,7 @@ proc sqlite-process-dot-in-files {} { # (e.g. [proj-check-rpath]) may do so before we "mangle" them here. proj-remap-autoconf-dir-vars - proj-dot-ins-process + proj-dot-ins-process -validate make-config-header sqlite_cfg.h \ -bare {SIZEOF_* HAVE_DECL_*} \ -none {HAVE_CFLAG_* LDFLAGS_* SH_* SQLITE_AUTORECONFIG @@ -1726,25 +1725,6 @@ proc sqlite-process-dot-in-files {} { proj-touch sqlite_cfg.h ; # help avoid frequent unnecessary @SQLITE_AUTORECONFIG@ } -######################################################################## -# Perform some high-level validation on the generated files... -# -# 1) Ensure that no unresolved @VAR@ placeholders are in files which -# use those. -# -# 2) TBD -proc sqlite-post-config-validation {} { - # Check #1: ensure that files which get filtered for @VAR@ do not - # contain any unresolved @VAR@ refs. That may indicate an - # unexported/unused var or a typo. - set srcdir $::autosetup(srcdir) - foreach f [proj-dot-ins-list] { - proj-assert {3==[llength $f]} \ - "Expecting proj-dot-ins-list to be stored in 3-entry lists" - proj-validate-no-unresolved-ats [lindex $f 1] - } -} - ######################################################################## # Handle --with-wasi-sdk[=DIR] # diff --git a/manifest b/manifest index 580bc0184f..3330ee73f4 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\smemory\sleak\sin\ssqlite3session_diff(). -D 2025-04-10T20:52:47.688 +C Move\sthe\spost-configure\sdot-in-file\svalidation\sfrom\ssqlite-config.tcl\sto\sproj.tcl\sfor\sreuse\sin\sthe\stea\sport\sand\sother\sdownstream\strees. +D 2025-04-12T19:26:18.238 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -51,8 +51,8 @@ F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e F autosetup/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1821baf61bc86a7e F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba -F autosetup/proj.tcl e4170f543e417fcc1ae3c8aedcf8d6044221dbdeb880d324579730e0c96a6198 -F autosetup/sqlite-config.tcl a61e86a4033e3a77680bfba45e7950950285beaf756ddc2d14bec5147972d2b1 +F autosetup/proj.tcl c9c72d8a9a5d19b02e19a0be515689469997268d80bc0da75d4e9e9c687eaef2 +F autosetup/sqlite-config.tcl 3f771754b89ae10379bb5d9d48d80921568345618f8f37d4a62a8e1fd9cd916c F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x F contrib/sqlitecon.tcl eb4c6578e08dd353263958da0dc620f8400b869a50d06e271ab0be85a51a08d3 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 0e5e0e2f558a417d57c01a2d62cb2117d2adf6ddbc62e6a0208ae23f19b05347 -R ea8e02173c6f4e7238e9e39c21ec2d22 -U dan -Z fad13ff67cc688b0b5e83e82f9779719 +P a6cbc5db1c4973ea236874bd9c24cd86dc48fbc7a10e424896c0407c7c32ce6a +R 8e3f8640caee9f2a4ad775a5d04c7122 +U stephan +Z 308ff2b4328caec8784b3b3f051198b6 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 97db019baa..5c02aefff7 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a6cbc5db1c4973ea236874bd9c24cd86dc48fbc7a10e424896c0407c7c32ce6a +0bac496d5c92c979295e702efc01803f6985b54d3d8ca30dce077c9776f7dcf2 From 6b4dcad51452319111b4d6b677d311fae7ca55ce Mon Sep 17 00:00:00 2001 From: stephan Date: Sat, 12 Apr 2025 21:47:18 +0000 Subject: [PATCH 094/120] tea build: use autosetup's file-normalize instead of Tcl's (file normalize) because the latter throws on cygwin for names like '.' and './'. Update a doc URL. FossilOrigin-Name: 0fe77341a0f1e869a909623cdd07b03355b90d302b4f8a875e520befab88ce35 --- autoconf/tea/autosetup/teaish-core.tcl | 12 ++++++------ autoconf/tea/doc/sqlite3.n | 4 ++-- manifest | 15 +++++++-------- manifest.uuid | 2 +- 4 files changed, 16 insertions(+), 17 deletions(-) diff --git a/autoconf/tea/autosetup/teaish-core.tcl b/autoconf/tea/autosetup/teaish-core.tcl index 25c17276f9..bee1b35e6e 100644 --- a/autoconf/tea/autosetup/teaish-core.tcl +++ b/autoconf/tea/autosetup/teaish-core.tcl @@ -563,7 +563,7 @@ proc teaish__find-extension {} { set f [file join $f teaish.make.in] } if {[file readable $f]} { - return [file normalize $f] + return [file-normalize $f] } return "" }} @@ -574,7 +574,7 @@ proc teaish__find-extension {} { if {![file readable $f]} { proj-fatal "extension tcl file is not readable: $f" } - return [file normalize $f] + return [file-normalize $f] }} # set gotNonFlag 0 foreach arg $::argv { @@ -584,7 +584,7 @@ proc teaish__find-extension {} { --t-e-d=* - --teaish-extension-dir=* { regexp -- {--[^=]+=(.+)} $arg - extD - set extD [file normalize $extD] + set extD [file-normalize $extD] if {![file isdir $extD]} { proj-fatal "--teaish-extension-dir value is not a directory: $extD" } @@ -607,7 +607,7 @@ proc teaish__find-extension {} { # } else { # incr gotNonFlag # msg-checking "Treating fist non-flag argument as --teaish-extension-dir ... " -# if {[catch [set extD [file normalize $arg]]]} { +# if {[catch [set extD [file-normalize $arg]]]} { # msg-result "dir name not normalizable: $arg" # lappend largv $arg # } else { @@ -697,7 +697,7 @@ use --teaish-extension-dir=/path/to/extension" # THEAISH_OUT_OF_EXT_TREE = 1 if we're building from a dir other # than the extension's home dir. define THEAISH_OUT_OF_EXT_TREE \ - [expr {[file normalize $::autosetup(builddir)] ne [file-normalize [get-define TEAISH_DIR]]}] + [expr {[file-normalize $::autosetup(builddir)] ne [file-normalize [get-define TEAISH_DIR]]}] # # Defines which extensions may optionally make but are not required @@ -936,7 +936,7 @@ proc teaish__create-extension {dir} { set force [opt-bool teaish-force] file mkdir $dir set cwd [pwd] - set dir [file normalize [file join $cwd $dir]] + set dir [file-normalize [file join $cwd $dir]] msg-result "Created dir $dir" cd $dir set flist {teaish.tcl} diff --git a/autoconf/tea/doc/sqlite3.n b/autoconf/tea/doc/sqlite3.n index a19e1811ad..3514046342 100644 --- a/autoconf/tea/doc/sqlite3.n +++ b/autoconf/tea/doc/sqlite3.n @@ -11,5 +11,5 @@ SQLite3 is a self-contains, zero-configuration, transactional SQL database engine. This extension provides an easy to use interface for accessing SQLite database files from Tcl. .PP -For full documentation see \fIhttp://sqlite.org/\fR and -in particular \fIhttp://sqlite.org/tclsqlite.html\fR. +For full documentation see \fIhttps://sqlite.org/\fR and +in particular \fIhttps://sqlite.org/tclsqlite.html\fR. diff --git a/manifest b/manifest index 23e6f5579f..bc5e6b7acd 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Port\sautoconf/tea\sfrom\sthe\sautotools\sto\sautosetup. -D 2025-04-12T21:24:10.947 +C tea\sbuild:\suse\sautosetup's\sfile-normalize\sinstead\sof\sTcl's\s(file\snormalize)\sbecause\sthe\slatter\sthrows\son\scygwin\sfor\snames\slike\s'.'\sand\s'./'.\sUpdate\sa\sdoc\sURL. +D 2025-04-12T21:47:18.323 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -26,11 +26,11 @@ F autoconf/tea/Makefile.in 9ca3a7ccbeda98aaf4d48582905f00b7c3b30c0c2843383dc4424 F autoconf/tea/README.txt 656d4686c509d375f5988ff3deda94f65fe6cd8358cd55d1f1dcc7b6e2ff73aa F autoconf/tea/auto.def 0ee2afbdbf5289fb5ab06d8c4cc9cd6fa8cdd173cf0db962bbb66212c8dc5106 F autoconf/tea/autosetup/README.txt 17dd4cfae6094b3c239c7ad0a437b13162481e72c60243ba482d180e34314024 -F autoconf/tea/autosetup/teaish-core.tcl 3e2ebf01d65e111c57ab0fb5ebad8a74459820976bbff1b609261e52a09388ee +F autoconf/tea/autosetup/teaish-core.tcl f5890a83ba034ad9543bf97c7978359679a178dfaa7f391e4c7b773d80ffd6d9 F autoconf/tea/autosetup/teaish-feature-tests.tcl 4f641aff23eb364d5483dbd2122e070ea279059cab17e24b8108598c2b5f4457 F autoconf/tea/autosetup/teaish-tester.tcl 6ea18f15260db28961581599de6b675b5118e86da1511b5e5bffdcbbc8d3b42c F autoconf/tea/configure d0b12b984edca6030d1976375b80157ac78b5b90a5b4f0dcee39357f63f4a80b x -F autoconf/tea/doc/sqlite3.n 4499e2b556710dd4f9ea76a0bb35bd9616769dc4d33858213b075de8f6334872 +F autoconf/tea/doc/sqlite3.n 9a97f4f717ceab73004ea412af7960625c1cb24b5c25e4ae4c8b5d8fa4300f4e F autoconf/tea/license.terms 13bd403c9610fd2b76ece0ab50c4c5eda933d523 F autoconf/tea/pkgIndex.tcl.in ea13b90006ef3f1205f46fbd382736fe2f364caa644cc8e958c83a78ac7fa1d1 F autoconf/tea/teaish.tcl 2ef641703ea6ae28c42975bd052c2e2b7ac85f9b688af2c2bb1f4dbfb2fa1bb9 @@ -2216,9 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 0bac496d5c92c979295e702efc01803f6985b54d3d8ca30dce077c9776f7dcf2 10b917040b167de6aba6ee434b4e982580e690bbfe80521e34236b29d8e00b7d -R 990c47fadc79721ebe2fb0ef76a8eebb -T +closed 10b917040b167de6aba6ee434b4e982580e690bbfe80521e34236b29d8e00b7d Closed\sby\sintegrate-merge. +P 691708642bf1cac562274a6df427d7c631aa4401dfbe98711963cf89203fb104 +R 9c8fbcf9ab3d161375e30cc0f94dd9d5 U stephan -Z 8d210c963435f769bcb62f43dafa9b61 +Z 75cf9a17534a4e6b26001cae515ab4e2 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index f6cadff132..e74a796925 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -691708642bf1cac562274a6df427d7c631aa4401dfbe98711963cf89203fb104 +0fe77341a0f1e869a909623cdd07b03355b90d302b4f8a875e520befab88ce35 From a5198b2e13d06b87edeaae816ba5faefa05139bc Mon Sep 17 00:00:00 2001 From: stephan Date: Sun, 13 Apr 2025 16:22:58 +0000 Subject: [PATCH 095/120] Latest upstream teaish, which restructures the teaish files a bit. FossilOrigin-Name: 4f54f7d07d31938f271bc5d04a40cb1f7b5e6ea48e78ad06b7cc65483533f54e --- autoconf/tea/auto.def | 2 +- autoconf/tea/autosetup/README.txt | 4 +- .../autosetup/{teaish-core.tcl => core.tcl} | 27 +- autoconf/tea/autosetup/feature-tests.tcl | 480 ++++++++++++++++++ .../tea/autosetup/teaish-feature-tests.tcl | 279 ---------- .../{teaish-tester.tcl => tester.tcl} | 9 +- autoconf/tea/teaish.tcl | 2 +- manifest | 24 +- manifest.uuid | 2 +- tool/mkautoconfamal.sh | 6 +- 10 files changed, 529 insertions(+), 306 deletions(-) rename autoconf/tea/autosetup/{teaish-core.tcl => core.tcl} (97%) create mode 100644 autoconf/tea/autosetup/feature-tests.tcl delete mode 100644 autoconf/tea/autosetup/teaish-feature-tests.tcl rename autoconf/tea/autosetup/{teaish-tester.tcl => tester.tcl} (93%) diff --git a/autoconf/tea/auto.def b/autoconf/tea/auto.def index 98b53382b6..861257cce3 100644 --- a/autoconf/tea/auto.def +++ b/autoconf/tea/auto.def @@ -3,5 +3,5 @@ # # Main configure script entry point for the "TEA-via-autosetup" # framework. -use teaish-core +use teaish/core teaish-configure-core diff --git a/autoconf/tea/autosetup/README.txt b/autoconf/tea/autosetup/README.txt index bc0e0b2b3a..e11519b042 100644 --- a/autoconf/tea/autosetup/README.txt +++ b/autoconf/tea/autosetup/README.txt @@ -1,4 +1,4 @@ The *.tcl files in this directory are part of the SQLite's "autoconf" bundle which are specific to the TEA(-ish) build. During the tarball -generation process, they are copied into /autoconf/autosetup -(which itself is created earlier in that process). +generation process, they are copied into /autoconf/autosetup/teaish +(which itself is created as part of that process). diff --git a/autoconf/tea/autosetup/teaish-core.tcl b/autoconf/tea/autosetup/core.tcl similarity index 97% rename from autoconf/tea/autosetup/teaish-core.tcl rename to autoconf/tea/autosetup/core.tcl index bee1b35e6e..e46d49503b 100644 --- a/autoconf/tea/autosetup/teaish-core.tcl +++ b/autoconf/tea/autosetup/core.tcl @@ -139,10 +139,7 @@ proc teaish-configure-core {} { if {[llength [info proc teaish-options]] > 0} { # teaish-options is assumed to be imported via # TEAISH_TCL - set o [teaish-options] - if {"" ne $o} { - lappend opts {*}$o - } + set opts [teaish-combine-option-lists $opts [teaish-options]] } #lappend opts "soname:=duplicateEntry => {x}"; #just testing @@ -267,7 +264,8 @@ proc teaish__configure-phase1 {} { [join [glob -nocomplain [get-define TEAISH_DIR]/teaish.test.tcl]] #define AS_LIBDIR $::autosetup(libdir) - define TEAISH_TESTER_TCL $::autosetup(libdir)/teaish-tester.tcl + define TEAISH_LIBDIR $::autosetup(libdir)/teaish + define TEAISH_TESTER_TCL [get-define TEAISH_LIBDIR]/tester.tcl teaish__configure-finalize } @@ -914,7 +912,7 @@ proc teaish-feature-cache-set {{depth 0} val} { # @teaish-feature-cache-check ?$depth? tgtVarName # # If the feature-check cache has an entry named [proj-current-scope -# [expr {$depth+1}]] this function assigns its value to tgtVar and +# [expr {$depth+1}]] then this function assigns its value to tgtVar and # returns 1, else it assigns tgtVar to "" and returns 0. # proc teaish-feature-cache-check {{depth 0} tgtVar} { @@ -928,6 +926,23 @@ proc teaish-feature-cache-check {{depth 0} tgtVar} { return 0 } +# @teash-combine-option-lists list1 ?...listN? +# +# Expects each argument to be a list of options compatible with +# autosetup's [options] function. This function concatenates the +# contents of each list into a new top-level list, stripping the outer +# list part of each argument. The intent is that teaish-options +# implementations can use this to combine multiple lists, e.g. from +# functions teaish-check-openssl-options. +proc teaish-combine-option-lists {args} { + set rv [list] + foreach e $args { + foreach x $e { + lappend rv $x + } + } + return $rv +} # # Handles --teaish-create-extension=TARGET-DIR diff --git a/autoconf/tea/autosetup/feature-tests.tcl b/autoconf/tea/autosetup/feature-tests.tcl new file mode 100644 index 0000000000..1ecdc013a4 --- /dev/null +++ b/autoconf/tea/autosetup/feature-tests.tcl @@ -0,0 +1,480 @@ +######################################################################## +# 2025 April 7 +# +# 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. +# +######################################################################## +# ----- @module teaish-checks.tcl ----- +# @section TEA-ish collection of feature tests. +# +# Functions in this file with a prefix of teaish__ are +# private/internal APIs. Those with a prefix of teaish- are +# public APIs. + +# @teaish-check-cached@ ?-flags? msg script +# +# Under construction. +# +# A proxy for feature-test impls which handles chacheing of the +# feature flag check on a per-caller basis, using the calling scope's +# name as the cache key. +# +# The test is performed by $script. This function caches the result +# and checks for a chache hit before running $script. The value stored +# in the cache is the final value of $script (and this routine will +# intercept a 'return' from $script). +# +# Flags: +# +# -nostatus = do not emit "ok" or "no" at the end. This presumes +# that the caller will emit a newline before turning. +proc teaish-check-cached {args} { + set quiet 0 + set xargs {} + foreach arg $args { + switch -exact -- $arg { + -nostatus { + incr quiet + } + default { + lappend xargs $arg + } + } + } + lassign $xargs msg script + if {"" eq $msg} { + set msg [proj-current-scope 1] + } + msg-checking "${msg} ... " + if {[teaish-feature-cache-check 1 check]} { + msg-checking "(cached) " + if {$check} {msg-result "ok"} else {msg-result "no"} + return $check + } else { + set code [catch {uplevel 1 $script} rc xopt] + #puts "***** ::teaish__fCache ="; parray ::teaish__fCache + if {$code in {0 2}} { + teaish-feature-cache-set 1 $rc + if {!$quiet} { + if {$rc} { + msg-result "ok" + } else { + msg-result "no" + } + } + } else { + #puts "**** code=$code rc=$rc xopt=$xopt" + teaish-feature-cache-set 1 0 + } + return -options $xopt $rc + } +} + + +# @teaish-check-libz +# +# Checks for zlib.h and the function deflate in libz. If found, +# prepends -lz to the extension's ldflags and returns 1, else returns +# 0. It also defines LDFLAGS_LIBZ to the libs flag. +# +proc teaish-check-libz {} { + teaish-check-cached "Checking for libz" { + set rc 0 + if {[msg-quiet cc-check-includes zlib.h] && [msg-quiet proj-check-function-in-lib deflate z]} { + teaish-prepend-ldflags [define LDFLAGS_LIBZ [get-define lib_deflate]] + undefine lib_deflate + incr rc + } + expr $rc + } +} + +# @teaish-check-librt ?funclist? +# +# Checks whether -lrt is needed for any of the given functions. If +# so, appends -lrt via [teaish-prepend-ldflags] and returns 1, else +# returns 0. It also defines LDFLAGS_LIBRT to the libs flag or an +# empty string. +# +# Some systems (ex: SunOS) require -lrt in order to use nanosleep. +# +proc teaish-check-librt {{funclist {fdatasync nanosleep}}} { + teaish-check-cached -nostatus "Checking whether ($funclist) need librt" { + define LDFLAGS_LIBRT "" + foreach func $funclist { + if {[msg-quiet proj-check-function-in-lib $func rt]} { + set ldrt [get-define lib_${func}] + undefine lib_${func} + if {"" ne $ldrt} { + teaish-prepend-ldflags -r [define LDFLAGS_LIBRT $ldrt] + msg-result $ldrt + return 1 + } else { + msg-result "no lib needed" + return 1 + } + } + } + msg-result "not found" + return 0 + } +} + +# @teaish-check-stdint +# +# A thin proxy for [cc-with] which checks for and the +# various fixed-size int types it declares. It defines HAVE_STDINT_T +# to 0 or 1 and (if it's 1) defines HAVE_XYZ_T for each XYZ int type +# to 0 or 1, depending on whether its available. +proc teaish-check-stdint {} { + teaish-check-cached "Checking for stdint.h" { + msg-quiet cc-with {-includes stdint.h} \ + {cc-check-types int8_t int16_t int32_t int64_t intptr_t \ + uint8_t uint16_t uint32_t uint64_t uintptr_t} + } +} + +# @teaish-is-mingw +# +# Returns 1 if building for mingw, else 0. +proc teaish-is-mingw {} { + return [expr { + [string match *mingw* [get-define host]] && + ![file exists /dev/null] + }] +} + +# @teaish-check-libdl +# +# Checks for whether dlopen() can be found and whether it requires +# -ldl for linking. If found, returns 1, defines LDFLAGS_DLOPEN to the +# linker flags (if any), and passes those flags to +# teaish-prepend-ldflags. It unconditionally defines HAVE_DLOPEN to 0 +# or 1 (the its return result value). +proc teaish-check-dlopen {} { + teaish-check-cached -nostatus "Checking for dlopen()" { + set rc 0 + set lfl "" + if {[cc-with {-includes dlfcn.h} { + cctest -link 1 -declare "extern char* dlerror(void);" -code "dlerror();"}]} { + msg-result "-ldl not needed" + incr rc + } elseif {[cc-check-includes dlfcn.h]} { + incr rc + if {[cc-check-function-in-lib dlopen dl]} { + set lfl [get-define lib_dlopen] + undefine lib_dlopen + msg-result " dlopen() needs $lfl" + } else { + msg-result " - dlopen() not found in libdl. Assuming dlopen() is built-in." + } + } else { + msg-result "not found" + } + teaish-prepend-ldflags [define LDFLAGS_DLOPEN $lfl] + define HAVE_DLOPEN $rc + } +} + +######################################################################## +# Handles the --enable-math flag. +proc teaish-check-libmath {} { + teaish-check-cached "Checking for libc math library" { + set lfl "" + set rc 0 + if {[msg-quiet proj-check-function-in-lib ceil m]} { + incr rc + set lfl [get-define lib_ceil] + undefine lib_ceil + teaish-prepend-ldflags $lfl + msg-checking "$lfl " + } + define LDFLAGS_LIBMATH $lfl + expr $rc + } +} + +# @teaish-check-pkg-config-openssl +# +# Returns 1 if openssl is found via pkg-config, else 0. If found, +# passes its link flags to teaish-prepend-ldflags. +# +# It defines LDFLAGS_OPENSSL to the linker flags and CFLAGS_OPENSSL to +# the CFLAGS, or "" if it's not found. +# +# Defines HAVE_OPENSSL to 0 or 1 (its return value). +# +# If it returns true, the underlying pkg-config test will set several +# defines named PKG_OPENSSL_... (see the docs for [pkg-config] for +# details). +proc teaish-check-pkg-config-openssl {} { + use pkg-config + teaish-check-cached -nostatus "Checking for openssl via pkg-config" { + set rc 0 + if {[msg-quiet pkg-config-init 0] && [msg-quiet pkg-config openssl]} { + incr rc + set lfl [string trim "[get-define PKG_OPENSSL_LDFLAGS] [get-define PKG_OPENSSL_LIBS]"] + define CFLAGS_OPENSSL [get-define PKG_OPENSSL_CFLAGS] + define LDFLAGS_OPENSSL $lfl + teaish-prepend-ldflags $lfl + msg-result "ok ($lfl)" + } else { + define CFLAGS_OPENSSL "" + define LDFLAGS_OPENSSL "" + msg-result "no" + } + define HAVE_OPENSSL $rc + return [teaish-feature-cache-set $rc] + } +} + +# Internal helper for OpenSSL checking using cc-with to check if the +# given $cflags, $ldflags, and list of -l libs can link an +# application. +# +# For a system-level check, use empty $cflags and $ldflags. +# +# On success, it defines CFLAGS_OPENSSL to $cflags and LDFLAGS_OPENSSL +# to a combination of $ldflags and any required libs (which may be +# amended beyond those provided in $libs). It then returns 1. +# +# On failure it defines the above-mentioned flags to "" +# and returns 0. +# +# Defines HAVE_OPENSSL to its return value. +# +# Derived from https://fossil-scm.org/file/auto.def +proc teaish__check-openssl {msg cflags ldflags {libs {-lssl -lcrypto -lpthread}}} { + msg-checking "$msg ... " + set rc 0 + set isMinGw [teaish-is-mingw] + if {$isMinGw} { + lappend libs -lgdi32 -lwsock32 -lcrypt32 + } + set prefix msg-quiet + #set prefix "" + set lz "" + if {[{*}$prefix teaish-check-libz]} { + set lz [get-define LDFLAGS_LIBZ] + } + set libs2 $libs + if {$lz ne ""} { + lappend libs2 $lz + } + {*}$prefix cc-with [list -link 1 -cflags "$cflags $ldflags" -libs $libs2] { + if {[cc-check-includes openssl/ssl.h] && \ + [cc-check-functions SSL_new]} { + incr rc + } + } + if {!$rc && !$isMinGw} { + # On some systems, OpenSSL appears to require -ldl to link. + if {[{*}$prefix teaish-check-dlopen]} { + lappend libs2 [get-define LDFLAGS_DLOPEN ""] + {*}$prefix cc-with [list -link 1 -cflags "$cflags $ldflags" -libs $libs2] { + if {[cc-check-includes openssl/ssl.h] && \ + [cc-check-functions SSL_new]} { + incr rc + } + } + } + } + #puts "*???? cflags=$cflags ldflags=$ldflags libs2=$libs2" + if {$rc} { + msg-result "ok" + define CFLAGS_OPENSSL "$cflags" + define LDFLAGS_OPENSSL "$ldflags $libs2" + } else { + define CFLAGS_OPENSSL "" + define LDFLAGS_OPENSSL "" + msg-result "no" + } + define HAVE_OPENSSL $rc + return $rc +} + +# @teaish-check-openssl +# +# Jumps through some provierbial hoops to look for OpenSSL dev pieces. +# +# $where must be one of the following: +# +# - "pkg-config": check only pkg-config for it, but also verify that +# the results from pkg-config seem to work. +# +# - "system": look in standard(ish) system paths, starting with +# a lookup requiring no -L flag. +# +# - "auto" or "": try (pkg-config, system), in that order. +# +# - "none": do no lookup, define vars (see below), and return 0. +# +# - Any other value is assumed to be a directory name suitable for +# finding OpenSSL, but how this lookup is run is not currently +# well-defined. +# +# It defines LDFLAGS_OPENSSL and CFLAGS_OPENSSL to ldflags +# resp. cflags needed for compiling and linking, and updates teaish's +# internal ldflags/cflags lists. If OpenSSL is not found, they're +# defined to "". +# +# It defines HAVE_OPENSSL to 0 or 1 (its return value). +# +# If $where is empty then it defaults to auto. If $where is not empty +# _and_ OpenSSL is not found +# +# If the --with-openssl=... config flag is defined (see +# teaish-check-openssl-options) then an empty $where value will use +# the value of the --with-openssl flag, defaulting to "auto" if that +# flag also has an empty value. If that flag is provided, and has a +# value other than "none", then failure to find the library is +# considered fatal. +# +# Derived from https://fossil-scm.org/file/auto.def +proc teaish-check-openssl {{where ""}} { + teaish-check-cached -nostatus "Looking for openssl" { + if {$where eq ""} { + if {[proj-opt-exists with-openssl]} { + set where [join [opt-val with-openssl auto]] + } + } + + set notfound {{checkWithFlag msg} { + if {$checkWithFlag && [proj-opt-was-provided with-openssl]} { + proj-fatal "--with-openssl " \ + "found no working installation. Try --with-openssl=none" + } + define LDFLAGS_OPENSSL "" + define CFLAGS_OPENSSL "" + define HAVE_OPENSSL 0 + msg-result $msg + }} + + switch -exact -- $where { + none { + apply $notfound 0 none + return 0 + } + "" { + set where auto + } + } + if {$where in {pkg-config auto}} { + # Check pkg-config + if {[teaish-check-pkg-config-openssl]} { + set cflags [get-define PKG_OPENSSL_CFLAGS ""] + set ldflags [get-define LDFLAGS_OPENSSL ""] + if {[teaish__check-openssl "Verifying openssl pkg-config values" \ + "$cflags $ldflags"]} { + teaish-prepend-ldflags $ldflags + return 1 + } + } + if {$where eq "pkg-config"} { + apply $notfound 1 "not found" + return 0 + } + } + + # Determine which dirs to search... + set ssldirs {} + if {$where in {auto system}} { + set ssldirs { + {} /usr/sfw /usr/local/ssl /usr/lib/ssl /usr/ssl + /usr/pkg /usr/local /usr /usr/local/opt/openssl + /opt/homebrew/opt/openssl + } + } elseif {$where ne ""} { + lappend ssldirs $where + } + + foreach dir $ssldirs { + set msg "in $dir" + set cflags "-I$dir/include" + if {$dir eq ""} { + set msg "without -L/path" + set ldflags "" + set cflags "" + } elseif {![file isdir $dir]} { + continue + } elseif {[file readable $dir/libssl.a]} { + set ldflags -L$dir + } elseif {[file readable $dir/lib/libssl.a]} { + set ldflags -L$dir/lib + } elseif {[file isdir $dir/lib]} { + set ldflags [list -L$dir -L$dir/lib] + } else { + set ldflags -L$dir + } + if {[teaish__check-openssl $msg $cflags $ldflags]} { + teaish-add-cflags [get-define CFLAGS_OPENSSL] + teaish-prepend-ldflags [get-define LDFLAGS_OPENSSL] + return 1 + } + if {$dir ne ""} { + # Look for a static build under $dir... + set ldflags "" + set libs [list $dir/libssl.a $dir/libcrypto.a] + set foundLibs 0 + foreach x $libs { + if {![file readlable $x]} break; + incr foundLibs + } + if {$foundLibs != [llength $libs]} { + continue + } + set cflags "-I$dir/include" + lappend libs -lpthread + if {[teaish__check-openssl "Checking for static openssl build in $dir" \ + $cflags $ldflags $libs]} { + teaish-add-cflags [get-define CFLAGS_OPENSSL] + teaish-prepend-ldflags [get-define LDFLAGS_OPENSSL] + return 1 + } + } + } + + apply $notfound 1 no + return 0 + } +}; # teaish-check-openssl + +# @teaish-check-openssl-options +# +# teaish.tcl files which use teaish-check-openssl should +# include this function's result from their teaish-options +# impl, so that configure --help can include the --with-openssl +# flag that check exposes. +# +# Returns a list of options for the teaish-check-openssl feature test. +# +# Example usage: +# +# proc teaish-options {} { +# use teaish-feature-tests +# return [teaish-combine-option-lists \ +# [teaish-check-openssl-options] \ +# { hell-world => {just testing} } \ +# ] +# } +proc teaish-check-openssl-options {} { + return { + with-openssl:see-the-help => + {Checks for OpenSSL development libraries in a variety of ways. + "pkg-config" only checks the system's pkg-config. + "system" checks only for a system-level copy. + "auto" checks the prior options and a list of + likely candidate locations. "none" disables the check + altogether and causes the check to not fail if it's + not found. Any other value is a directory in which a + _static_ copy of libssl.a can be found, e.g. a locally-built + copy of the OpenSSL source tree. If this flag is explicitly provided, + and has a value other than "none", failure to find OpenSSL + is fatal.} + } +} diff --git a/autoconf/tea/autosetup/teaish-feature-tests.tcl b/autoconf/tea/autosetup/teaish-feature-tests.tcl deleted file mode 100644 index fe5464151f..0000000000 --- a/autoconf/tea/autosetup/teaish-feature-tests.tcl +++ /dev/null @@ -1,279 +0,0 @@ -######################################################################## -# 2025 April 7 -# -# 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. -# -######################################################################## -# ----- @module teaish-checks.tcl ----- -# @section TEA-ish collection of feature tests. -# -# Functions in this file with a prefix of teaish__ are -# private/internal APIs. Those with a prefix of teaish- are -# public APIs. - -use pkg-config - -# @teaish-check-cached@ ?-flags? msg script -# -# Under construction. -# -# A proxy for feature-test impls which handles chacheing of the -# feature flag check on a per-caller basis, using the calling scope's -# name as the cache key. -# -# The test is performed by $script. This function caches the result -# and checks for a chache hit before running $script. The value stored -# in the cache is the final value of $script (and this routine will -# intercept a 'return' from $script). -# -# Flags: -# -# -nostatus = do not emit "ok" or "no" at the end. This presumes -# that the caller will emit a newline before turning. -proc teaish-check-cached {args} { - set quiet 0 - set xargs {} - foreach arg $args { - switch -exact -- $arg { - -nostatus { - incr quiet - } - default { - lappend xargs $arg - } - } - } - lassign $xargs msg script - if {"" eq $msg} { - set msg [proj-current-scope 1] - } - if {[teaish-feature-cache-check 1 check]} { - msg-checking "${msg} ... (cached) " - if {$check} {msg-result "ok"} else {msg-result "no"} - return $check - } else { - msg-checking "${msg} ... " - set code [catch {uplevel 1 $script} rc xopt] - #puts "***** ::teaish__fCache ="; parray ::teaish__fCache - if {$code in {0 2}} { - teaish-feature-cache-set 1 $rc - if {!$quiet} { - if {$rc} { - msg-result "ok" - } else { - msg-result "no" - } - } - #puts "**** code=$code rc=$rc xopt=$xopt" - } else { - return -options $xopt $rc - } - } -} - - -# @teaish-check-libz -# -# Checks for zlib.h and the function deflate in libz. If found, -# prepends -lz to the extension's ldflags and returns 1, else returns -# 0. It also defines LDFLAGS_LIBZ to the libs flag. -# -proc teaish-check-libz {} { - teaish-check-cached "Checking for libz" { - set rc 0 - if {[msg-quiet cc-check-includes zlib.h] && [msg-quiet proj-check-function-in-lib deflate z]} { - teaish-prepend-ldflags [define LDFLAGS_LIBZ [get-define lib_deflate]] - undefine lib_deflate - incr rc - } - expr $rc - } -} - -# @teaish-check-librt ?funclist? -# -# Checks whether -lrt is needed for any of the given functions. If -# so, appends -lrt via [teaish-prepend-ldflags] and returns 1, else -# returns 0. It also defines LDFLAGS_LIBRT to the libs flag or an -# empty string. -# -# Some systems (ex: SunOS) require -lrt in order to use nanosleep. -# -proc teaish-check-librt {{funclist {fdatasync nanosleep}}} { - teaish-check-cached -nostatus "Checking whether ($funclist) need librt" { - define LDFLAGS_LIBRT "" - foreach func $funclist { - if {[msg-quiet proj-check-function-in-lib $func rt]} { - set ldrt [get-define lib_${func}] - undefine lib_${func} - if {"" ne $ldrt} { - teaish-prepend-ldflags -r [define LDFLAGS_LIBRT $ldrt] - msg-result $ldrt - return 1 - } else { - msg-result "no lib needed" - return 1 - } - } - } - msg-result "not found" - return 0 - } -} - -# @teaish-check-stdint -# -# A thin proxy for [cc-with] which checks for and the -# various fixed-size int types it declares. It defines HAVE_STDINT_T -# to 0 or 1 and (if it's 1) defines HAVE_XYZ_T for each XYZ int type -# to 0 or 1, depending on whether its available. -proc teaish-check-stdint {} { - teaish-check-cached "Checking for stdint.h" { - msg-quiet cc-with {-includes stdint.h} \ - {cc-check-types int8_t int16_t int32_t int64_t intptr_t \ - uint8_t uint16_t uint32_t uint64_t uintptr_t} - } -} - -# @teaish-is-mingw -# -# Returns 1 if building for mingw, else 0. -proc teaish-is-mingw {} { - return [expr { - [string match *mingw* [get-define host]] && - ![file exists /dev/null] - }] -} - -# @teaish-check-libdl -# -# Checks for whether dlopen() can be found and whether it requires -ldl -# for linking. If found, returns 1, defines LDFLAGS_DLOPEN to the linker flags -# (if any), and passes those flags to teaish-prepend-ldflags. -proc teaish-check-dlopen {} { - teaish-check-cached -nostatus "Checking for dlopen()" { - set rc 0 - set lfl "" - if {[cc-with {-includes dlfcn.h} { - cctest -link 1 -declare "extern char* dlerror(void);" -code "dlerror();"}]} { - msg-result "-ldl not needed" - incr rc - } elseif {[cc-check-includes dlfcn.h]} { - incr rc - if {[cc-check-function-in-lib dlopen dl]} { - set lfl [get-define lib_dlopen] - undefine lib_dlopen - msg-result " dlopen() needs $lfl" - } else { - msg-result " - dlopen() not found in libdl. Assuming dlopen() is built-in." - } - } else { - msg-result "not found" - } - teaish-prepend-ldflags [define LDFLAGS_DLOPEN $lfl] - define HAVE_DLOPEN $rc - } -} - -######################################################################## -# Handles the --enable-math flag. -proc teaish-check-libmath {} { - teaish-check-cached "Checking for libc math library" { - set lfl "" - set rc 0 - if {[msg-quiet proj-check-function-in-lib ceil m]} { - incr rc - set lfl [get-define lib_ceil] - undefine lib_ceil - teaish-prepend-ldflags $lfl - msg-checking "$lfl " - } - define LDFLAGS_LIBMATH $lfl - expr $rc - } -} - - -# @teaish-check-pkg-config-libssl -# -# Returns 1 if libssl is found via pkg-config, else 0. If found, -# passes its link flags to teaish-prepend-ldflags. Defines LDFLAGS_SSL -# to the linker flags, if found, else "". -# -# If it returns true, the underlying pkg-config test will set several -# defines named PKG_LIBSSL_... (see the docs for [pkg-config] for -# details). -proc teaish-check-pkg-config-libssl {} { - teaish-check-cached -nostatus "Checking for libssl via pkg-config" { - msg-result "Looking for libssl ..." - set lfl {} - set rc 0 - if {[msg-quiet pkg-config-init 0] && [msg-quiet pkg-config libssl]} { - lappend lfl [get-define PKG_LIBSSL_LDFLAGS] \ - [get-define PKG_LIBSSL_LIBS] - incr rc - } else { - # TODO: port over the more elaborate checks from fossil. - } - if {$rc} { - set lfl [string trim [join $lfl]] - define LDFLAGS_SSL $lfl - teaish-prepend-ldflags $lfl - } - define HAVE_LIBSSL $rc - return [teaish-feature-cache-set $rc] - } -} - -# Under construction -# -# Helper for OpenSSL checking -proc teaish__check-openssl {msg {cflags {}} {libs {-lssl -lcrypto -lpthread}}} { - msg-checking "Checking for $msg..." - set rc 0 - set isMinGw [teaish-is-mingw] - if {$isMinGw} { - lappend libs -lgdi32 -lwsock32 -lcrypt32 - } - if {[teaish-check-libz]} { - lappend libs [get-define LDFLAGS_LIBZ] - } - msg-quiet cc-with [list -cflags $cflags -libs $libs] { - if {[cc-check-includes openssl/ssl.h] && \ - [cc-check-functions SSL_new]} { - incr rc - } - } - # TODO - if {!$rc && !$isMinGw} { - # On some systems, OpenSSL appears to require -ldl to link. - if {[teaish-check-dlopen]} { - lappend libs [get-define LDFLAGS_DLOPEN ""] - msg-quiet cc-with [list -cflags $cflags -libs $libs] { - if {[cc-check-includes openssl/ssl.h] && \ - [cc-check-functions SSL_new]} { - incr rc - } - } - } - } - if {$rc} { - msg-result "ok" - } else { - msg-result "no" - } - return $rc -} - -# Under construction -proc teaish-check-libssl {} { - # Goal: port in fossil's handle-with-openssl. It's a bit of a beast. - if {![teaish-check-pkg-config-libssl]} { - #teaish__check-openssl - } -} diff --git a/autoconf/tea/autosetup/teaish-tester.tcl b/autoconf/tea/autosetup/tester.tcl similarity index 93% rename from autoconf/tea/autosetup/teaish-tester.tcl rename to autoconf/tea/autosetup/tester.tcl index 7e50394842..f464c85a2d 100644 --- a/autoconf/tea/autosetup/teaish-tester.tcl +++ b/autoconf/tea/autosetup/tester.tcl @@ -14,7 +14,12 @@ # ######################################################################## # ----- @module teaish-tester.tcl ----- -# @section TEA-ish Testing APIs +# +# @section TEA-ish Testing APIs. +# +# Though these are part of the autosup dir hierarchy, they are not +# intended to be run from autosetup code. Rather, they're for +# use with/via teaish.tester.tcl. ######################################################################## # @test-current-scope ?lvl? @@ -97,7 +102,7 @@ proc test-catch {cmd args} { if {[catch { $cmd {*}$args } rc xopts]} { - puts "[test-current-scope] ignoring failure of: $cmd [lindex $args 0]" + puts "[test-current-scope] ignoring failure of: $cmd [lindex $args 0]: $rc" #how to extract just the message text from $xopts? } } diff --git a/autoconf/tea/teaish.tcl b/autoconf/tea/teaish.tcl index f5b54ef70f..56aeb9362a 100644 --- a/autoconf/tea/teaish.tcl +++ b/autoconf/tea/teaish.tcl @@ -68,7 +68,7 @@ proc teaish-options {} { # work needed for this extension. # proc teaish-configure {} { - uplevel 1 {use teaish-feature-tests} + use teaish/feature-tests set srcdir [get-define TEAISH_DIR] teaish-add-src -dist -dir generic/tclsqlite3.c diff --git a/manifest b/manifest index bc5e6b7acd..0bb1038ed2 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C tea\sbuild:\suse\sautosetup's\sfile-normalize\sinstead\sof\sTcl's\s(file\snormalize)\sbecause\sthe\slatter\sthrows\son\scygwin\sfor\snames\slike\s'.'\sand\s'./'.\sUpdate\sa\sdoc\sURL. -D 2025-04-12T21:47:18.323 +C Latest\supstream\steaish,\swhich\srestructures\sthe\steaish\sfiles\sa\sbit. +D 2025-04-13T16:22:58.217 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -24,16 +24,16 @@ F autoconf/README.txt b749816b8452b3af994dc6d607394bef3df1736d7e09359f1087de8439 F autoconf/auto.def 3d994f3a9cc9b712dbce92a5708570ddcf3b988141b6eb738f2ed16127a9f0ac F autoconf/tea/Makefile.in 9ca3a7ccbeda98aaf4d48582905f00b7c3b30c0c2843383dc4424d1e57969c44 F autoconf/tea/README.txt 656d4686c509d375f5988ff3deda94f65fe6cd8358cd55d1f1dcc7b6e2ff73aa -F autoconf/tea/auto.def 0ee2afbdbf5289fb5ab06d8c4cc9cd6fa8cdd173cf0db962bbb66212c8dc5106 -F autoconf/tea/autosetup/README.txt 17dd4cfae6094b3c239c7ad0a437b13162481e72c60243ba482d180e34314024 -F autoconf/tea/autosetup/teaish-core.tcl f5890a83ba034ad9543bf97c7978359679a178dfaa7f391e4c7b773d80ffd6d9 -F autoconf/tea/autosetup/teaish-feature-tests.tcl 4f641aff23eb364d5483dbd2122e070ea279059cab17e24b8108598c2b5f4457 -F autoconf/tea/autosetup/teaish-tester.tcl 6ea18f15260db28961581599de6b675b5118e86da1511b5e5bffdcbbc8d3b42c +F autoconf/tea/auto.def 81e2617cfb90d53c19b53b3ec632cd2893bf32f2e5dd272b1116fadf2ea86c2d +F autoconf/tea/autosetup/README.txt b40071e6f8506500a2f7f71d5fc69e0bf87b9d7678dd9da1e5b4d0acbf40b1ca +F autoconf/tea/autosetup/core.tcl a3b4e4521aec05ed53ce382b6fa16a49cba3636e211909d97872263b97919258 w autoconf/tea/autosetup/teaish-core.tcl +F autoconf/tea/autosetup/feature-tests.tcl 0e2893c787edb26d2d4302ea5178d4c0a6878f396905bf8fa485afb7a6fad5f0 w autoconf/tea/autosetup/teaish-feature-tests.tcl +F autoconf/tea/autosetup/tester.tcl 91beb9e26916cdb54400446e2890105cdea4186789141d5748c72b2f73b26ed0 w autoconf/tea/autosetup/teaish-tester.tcl F autoconf/tea/configure d0b12b984edca6030d1976375b80157ac78b5b90a5b4f0dcee39357f63f4a80b x F autoconf/tea/doc/sqlite3.n 9a97f4f717ceab73004ea412af7960625c1cb24b5c25e4ae4c8b5d8fa4300f4e F autoconf/tea/license.terms 13bd403c9610fd2b76ece0ab50c4c5eda933d523 F autoconf/tea/pkgIndex.tcl.in ea13b90006ef3f1205f46fbd382736fe2f364caa644cc8e958c83a78ac7fa1d1 -F autoconf/tea/teaish.tcl 2ef641703ea6ae28c42975bd052c2e2b7ac85f9b688af2c2bb1f4dbfb2fa1bb9 +F autoconf/tea/teaish.tcl f629718e52538031162dd8d74ce014a3d7d9c9f5428f59d4978da08549bdf09b F autoconf/tea/teaish.test.tcl cfe94e1fb79dd078f650295be59843d470125e0cc3a17a1414c1fb8d77f4aea6 F autoconf/tea/teaish.tester.tcl.in 743fd0fe1e667f82fd8fc3ebe0a5c77763e4dbed7bbc8605a9d4b1d0663dac78 F autosetup/LICENSE 41a26aebdd2cd185d1e2b210f71b7ce234496979f6b35aef2cbf6b80cbed4ce4 @@ -2152,7 +2152,7 @@ F tool/logest.c c34e5944318415de513d29a6098df247a9618c96d83c38d4abd88641fe46e669 F tool/max-limits.c cbb635fbb37ae4d05f240bfb5b5270bb63c54439 F tool/merge-test.tcl de76b62f2de2a92d4c1ca4f976bce0aea6899e0229e250479b229b2a1914b176 F tool/mkamalzip.tcl 8aa5ebe7973c8b8774062d34e15fea9815c4cc2ceea3a9b184695f005910876a -F tool/mkautoconfamal.sh 3e9ff23d3f63ccc82097022208859ff961faf7f171041695b369b9443fb907dc +F tool/mkautoconfamal.sh 07b43da6ef5dfe4c8a119f813b997429e7237ccf537daa14e19af6e6d5a0947f F tool/mkccode.tcl c42a8f8cf78f92e83795d5447460dbce7aaf78a3bbf9082f1507dc71a3665f3c x F tool/mkctimec.tcl f76dbfc74cefad8d126384ba3263677939f077bd184fcdf8c592a1daf64f50c3 x F tool/mkkeywordhash.c 6b0be901c47f9ad42215fc995eb2f4384ac49213b1fba395102ec3e999acf559 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 691708642bf1cac562274a6df427d7c631aa4401dfbe98711963cf89203fb104 -R 9c8fbcf9ab3d161375e30cc0f94dd9d5 +P 0fe77341a0f1e869a909623cdd07b03355b90d302b4f8a875e520befab88ce35 +R 811a32afcc86e700c429419fd06d1b5a U stephan -Z 75cf9a17534a4e6b26001cae515ab4e2 +Z 6864eb9a6caa1acee33b5cc98d2d48ee # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index e74a796925..f52cfd4537 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -0fe77341a0f1e869a909623cdd07b03355b90d302b4f8a875e520befab88ce35 +4f54f7d07d31938f271bc5d04a40cb1f7b5e6ea48e78ad06b7cc65483533f54e diff --git a/tool/mkautoconfamal.sh b/tool/mkautoconfamal.sh index 7c9ee06a7b..35f8dbc8c6 100644 --- a/tool/mkautoconfamal.sh +++ b/tool/mkautoconfamal.sh @@ -73,10 +73,11 @@ rm -f ./*~ # find . -name '*~' -exec rm \{} \; #fi -mkdir -p tea/generic -mv tea/autosetup/*.tcl autosetup/. +mkdir -p autosetup/teaish +mv tea/autosetup/*.tcl autosetup/teaish/. rm -fr tea/autosetup +mkdir -p tea/generic cat < tea/generic/tclsqlite3.c #ifdef USE_SYSTEM_SQLITE # include @@ -87,6 +88,7 @@ EOF cat $TOP/src/tclsqlite.c >> tea/generic/tclsqlite3.c find . -type f -name '*~' -exec rm -f \{} \; +find . -type f -name '#*#' -exec rm -f \{} \; ./configure && make dist tar xzf sqlite-$VERSION.tar.gz From a572bbfc7c7ad4a195aa528ba4b60eb6a266b53b Mon Sep 17 00:00:00 2001 From: stephan Date: Mon, 14 Apr 2025 10:18:40 +0000 Subject: [PATCH 096/120] Minor cleanups and fixes in the autoconf/tea pieces. FossilOrigin-Name: 4d6536bd0ad333854309e825feaca26fdd13ac4458c7ccfbe77fc76cc5a968bc --- autoconf/tea/Makefile.in | 20 +++++++------- autoconf/tea/autosetup/core.tcl | 47 ++++++++++++++++++++++++++------- autoconf/tea/pkgIndex.tcl.in | 16 +++++------ autoconf/tea/teaish.tcl | 1 + manifest | 22 +++++++-------- manifest.uuid | 2 +- 6 files changed, 70 insertions(+), 38 deletions(-) diff --git a/autoconf/tea/Makefile.in b/autoconf/tea/Makefile.in index cb16c54473..eae30567e9 100644 --- a/autoconf/tea/Makefile.in +++ b/autoconf/tea/Makefile.in @@ -205,13 +205,13 @@ tclsh: $(teaish.makefile) config.log # simply loads the DLL and success if it can. # # -tx.tester.args = $(tx.dll) $(tx.loadPrefix) @TEAISH_TESTER_TCL@ +tx.tester.args = $(tx.dll) $(tx.loadPrefix) @TEAISH_MODULE_TEST_TCL@ .PHONY: test-pre test-core test test-post test-extension test-extension: # this name is reserved for use by teaish.make test-prepre: $(tx.dll) test-pre: test-prepre test-core: test-pre - $(TCLSH) teaish.tester.tcl $(tx.tester.args) + $(TCLSH) @TEAISH_TESTER_TCL@ $(tx.tester.args) test-post: test-core test: test-post @@ -286,12 +286,7 @@ $(tx.makefile): config.log # # Package archive generation ("dist") rules... # -@if THEAISH_OUT_OF_EXT_TREE -dist: - @echo "'dist' can only be used from an extension's home dir" 1>&2; \ - echo "In this case: @TEAISH_DIR@" 1>&2; exit 1 -undist: -@else +@if TEAISH_ENABLE_DIST @if BIN_ZIP # Temp dir for dist.zip. Must be different than dist.tgz or else # parallel builds may hose the dist. @@ -350,7 +345,14 @@ undist-tgz: rm -f $(dist.tgz) undist: undist-tgz @endif #BIN_TAR -@endif #THEAISH_OUT_OF_EXT_TREE +@else +undist: +dist: +@if TEAISH_OUT_OF_EXT_TREE + @echo "'dist' can only be used from an extension's home dir" 1>&2; \ + echo "In this case: @TEAISH_DIR@" 1>&2; exit 1 +@endif +@endif #TEAISH_ENABLE_DIST @if TEAISH_MAKEFILE # diff --git a/autoconf/tea/autosetup/core.tcl b/autoconf/tea/autosetup/core.tcl index e46d49503b..5cdfd6a14b 100644 --- a/autoconf/tea/autosetup/core.tcl +++ b/autoconf/tea/autosetup/core.tcl @@ -265,7 +265,8 @@ proc teaish__configure-phase1 {} { #define AS_LIBDIR $::autosetup(libdir) define TEAISH_LIBDIR $::autosetup(libdir)/teaish - define TEAISH_TESTER_TCL [get-define TEAISH_LIBDIR]/tester.tcl + define TEAISH_MODULE_TEST_TCL $::autosetup(libdir)/teaish/tester.tcl + define TEAISH_TESTER_TCL $::autosetup(builddir)/teaish.tester.tcl teaish__configure-finalize } @@ -297,6 +298,10 @@ proc teaish__configure-finalize {} { define $f [join [get-define $f]] } + if {[get-define TEAISH_OUT_OF_EXT_TREE]} { + define TEAISH_ENABLE_DIST 0 + } + define TEAISH_AUTOSETUP_DIR $::autosetup(libdir) proj-setup-autoreconfig TEAISH_AUTORECONFIG proj-dot-ins-append $::autosetup(srcdir)/Makefile.in @@ -622,7 +627,7 @@ proc teaish__find-extension {} { set ::argv $largv set dbld $::autosetup(builddir) set dsrc $::autosetup(srcdir) - set dext [get-define TEAISH_DIR $::autosetup(builddir)] + set dext [get-define TEAISH_DIR $dbld] # # teaish.tcl is a TCL script which implements various @@ -631,7 +636,10 @@ proc teaish__find-extension {} { # We use the first one we find in the builddir or srcdir. # if {"" eq $extT} { - set flist [list $dext/teaish.tcl $dsrc/teaish.tcl] + set flist [list $dext/teaish.tcl] + if {[lindex $flist 0] ne "$dsrc/teaish.tcl"} { + lappend flist $dsrc/teaish.tcl + } if {![proj-first-file-found $flist extT]} { if {"--help" in $::argv} { return 0 @@ -663,7 +671,10 @@ use --teaish-extension-dir=/path/to/extension" # the builddir or the srcdir. # if {"" eq $extM} { - set flist [list $dext/teaish.make.in $dsrc/teaish.make.in] + set flist [list $dext/teaish.make.in] + if {[lindex $flist 0] ne "$dsrc/teaish.make.in"} { + lappend flist $dsrc/teaish.make.in + } proj-first-file-found $flist extM } if {"" ne $extM && [file readable $extM]} { @@ -677,10 +688,14 @@ use --teaish-extension-dir=/path/to/extension" #proj-warn "Did not find an teaish.make.in." } - set extI $dext/teaish.pkginit.tcl - if {[file exists $extI]} { - define TEAISH_PKGINIT_TCL $extI + set flist [list $dext/teaish.pkginit.tcl] + if {[lindex $flist 0] ne "$dsrc/teaish.pkginit.in"} { + lappend flist $dsrc/teaish.pkginit.in + } + if {[proj-first-file-found $flist extI]} { msg-result "Extension post-load init = $extI" + define TEAISH_PKGINIT_TCL $extI + define TEAISH_PKGINIT_TCL_TAIL [file tail $extI]; # for use in pkgIndex.tcl #teaish-add-install $extI } @@ -692,9 +707,9 @@ use --teaish-extension-dir=/path/to/extension" define TEAISH_LIBDIR_NAME [get-define TEAISH_PKGNAME] define TEAISH_VERSION 0.0.0 - # THEAISH_OUT_OF_EXT_TREE = 1 if we're building from a dir other + # TEAISH_OUT_OF_EXT_TREE = 1 if we're building from a dir other # than the extension's home dir. - define THEAISH_OUT_OF_EXT_TREE \ + define TEAISH_OUT_OF_EXT_TREE \ [expr {[file-normalize $::autosetup(builddir)] ne [file-normalize [get-define TEAISH_DIR]]}] # @@ -704,9 +719,11 @@ use --teaish-extension-dir=/path/to/extension" foreach {optionalDef dflt} [subst { TEAISH_LOAD_PREFIX "[string totitle [get-define TEAISH_PKGNAME]]" TEAISH_MAKEFILE_CODE "" + TEAISH_ENABLE_DIST 1 }] { define $optionalDef $dflt } + return 1 } @@ -944,6 +961,18 @@ proc teaish-combine-option-lists {args} { return $rv } +# @teaish-enable-dist ?yes? +# +# Explicitly enables or disables the "dist" rules in the default +# Makefile.in. This is equivalent to defining TEAISH_ENABLE_DIST +# to $yes (which must be 0 or 1). +# +# By default, dist creation is enabled. +# +proc teaish-enable-dist {{yes 1}} { + define TEAISH_ENABLE_DIST $yes +} + # # Handles --teaish-create-extension=TARGET-DIR # diff --git a/autoconf/tea/pkgIndex.tcl.in b/autoconf/tea/pkgIndex.tcl.in index 7d6af1b8dd..fe07e10016 100644 --- a/autoconf/tea/pkgIndex.tcl.in +++ b/autoconf/tea/pkgIndex.tcl.in @@ -5,11 +5,11 @@ if {[package vsatisfies [package provide Tcl] 9.0-]} { package ifneeded @TEAISH_PKGNAME@ @TEAISH_VERSION@ [list apply {{dir} { load [file join $dir @TEAISH_DLL9@] @TEAISH_LOAD_PREFIX@ -@if TEAISH_PKGINIT_TCL - set initScript [file join $dir @TEAISH_PKGINIT_TCL@] -# if {[file exists $initScript]} { +@if TEAISH_PKGINIT_TCL_TAIL + set initScript [file join $dir [file tail @TEAISH_PKGINIT_TCL_TAIL@]] + if {[file exists $initScript]} { source -encoding utf-8 $initScript -# } + } @endif }} $dir] } else { @@ -20,11 +20,11 @@ if {[package vsatisfies [package provide Tcl] 9.0-]} { } else { load {} @TEAISH_LOAD_PREFIX@ } -@if TEAISH_PKGINIT_TCL - set initScript [file join $dir @TEAISH_PKGINIT_TCL@] -# if {[file exists $initScript]} { +@if TEAISH_PKGINIT_TCL_TAIL + set initScript [file join $dir [file tail @TEAISH_PKGINIT_TCL_TAIL@]] + if {[file exists $initScript]} { source -encoding utf-8 $initScript -# } + } @endif }} $dir] } diff --git a/autoconf/tea/teaish.tcl b/autoconf/tea/teaish.tcl index 56aeb9362a..e677ab9573 100644 --- a/autoconf/tea/teaish.tcl +++ b/autoconf/tea/teaish.tcl @@ -112,6 +112,7 @@ proc teaish-configure {} { LDFLAGS_LIBRT teaish-add-cflags -define CFLAGS_LIBICU OPT_FEATURE_FLAGS + teaish-enable-dist 0 }; # teaish-configure diff --git a/manifest b/manifest index 0bb1038ed2..125350b96b 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Latest\supstream\steaish,\swhich\srestructures\sthe\steaish\sfiles\sa\sbit. -D 2025-04-13T16:22:58.217 +C Minor\scleanups\sand\sfixes\sin\sthe\sautoconf/tea\spieces. +D 2025-04-14T10:18:40.707 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -22,18 +22,18 @@ F autoconf/Makefile.msc 5bc67d3912444c40c6f96d003e5c90663e51abb83d204a520110b1b2 F autoconf/README.first f1d3876e9a7852c22f275a6f06814e64934cecbc0b5b9617d64849094c1fd136 F autoconf/README.txt b749816b8452b3af994dc6d607394bef3df1736d7e09359f1087de8439a52807 F autoconf/auto.def 3d994f3a9cc9b712dbce92a5708570ddcf3b988141b6eb738f2ed16127a9f0ac -F autoconf/tea/Makefile.in 9ca3a7ccbeda98aaf4d48582905f00b7c3b30c0c2843383dc4424d1e57969c44 +F autoconf/tea/Makefile.in 2a90dfab1e95cb3ec610429c78d88d4a7d26beb080ad45ff6a05928b901e8309 F autoconf/tea/README.txt 656d4686c509d375f5988ff3deda94f65fe6cd8358cd55d1f1dcc7b6e2ff73aa F autoconf/tea/auto.def 81e2617cfb90d53c19b53b3ec632cd2893bf32f2e5dd272b1116fadf2ea86c2d F autoconf/tea/autosetup/README.txt b40071e6f8506500a2f7f71d5fc69e0bf87b9d7678dd9da1e5b4d0acbf40b1ca -F autoconf/tea/autosetup/core.tcl a3b4e4521aec05ed53ce382b6fa16a49cba3636e211909d97872263b97919258 w autoconf/tea/autosetup/teaish-core.tcl -F autoconf/tea/autosetup/feature-tests.tcl 0e2893c787edb26d2d4302ea5178d4c0a6878f396905bf8fa485afb7a6fad5f0 w autoconf/tea/autosetup/teaish-feature-tests.tcl -F autoconf/tea/autosetup/tester.tcl 91beb9e26916cdb54400446e2890105cdea4186789141d5748c72b2f73b26ed0 w autoconf/tea/autosetup/teaish-tester.tcl +F autoconf/tea/autosetup/core.tcl 85d6d484f75d9d2fa02517c20650cc7af50fe216f7848ebd6d0c59782f99ef01 +F autoconf/tea/autosetup/feature-tests.tcl 0e2893c787edb26d2d4302ea5178d4c0a6878f396905bf8fa485afb7a6fad5f0 +F autoconf/tea/autosetup/tester.tcl 91beb9e26916cdb54400446e2890105cdea4186789141d5748c72b2f73b26ed0 F autoconf/tea/configure d0b12b984edca6030d1976375b80157ac78b5b90a5b4f0dcee39357f63f4a80b x F autoconf/tea/doc/sqlite3.n 9a97f4f717ceab73004ea412af7960625c1cb24b5c25e4ae4c8b5d8fa4300f4e F autoconf/tea/license.terms 13bd403c9610fd2b76ece0ab50c4c5eda933d523 -F autoconf/tea/pkgIndex.tcl.in ea13b90006ef3f1205f46fbd382736fe2f364caa644cc8e958c83a78ac7fa1d1 -F autoconf/tea/teaish.tcl f629718e52538031162dd8d74ce014a3d7d9c9f5428f59d4978da08549bdf09b +F autoconf/tea/pkgIndex.tcl.in 2c99a64a0eff5dc2ad8e9657bb564fae2dbdfdb6b77a4c49b4387bd5a25c42ef +F autoconf/tea/teaish.tcl 31efdeaadd4629dd883b7cfb52e18365a6c91bfb91f8b127570876032e920d1c F autoconf/tea/teaish.test.tcl cfe94e1fb79dd078f650295be59843d470125e0cc3a17a1414c1fb8d77f4aea6 F autoconf/tea/teaish.tester.tcl.in 743fd0fe1e667f82fd8fc3ebe0a5c77763e4dbed7bbc8605a9d4b1d0663dac78 F autosetup/LICENSE 41a26aebdd2cd185d1e2b210f71b7ce234496979f6b35aef2cbf6b80cbed4ce4 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 0fe77341a0f1e869a909623cdd07b03355b90d302b4f8a875e520befab88ce35 -R 811a32afcc86e700c429419fd06d1b5a +P 4f54f7d07d31938f271bc5d04a40cb1f7b5e6ea48e78ad06b7cc65483533f54e +R 01a906f212b7ee1ccd4bda790fce8e28 U stephan -Z 6864eb9a6caa1acee33b5cc98d2d48ee +Z 80aac49167f19af66627472602a3ae1a # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index f52cfd4537..efe88d3b0f 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -4f54f7d07d31938f271bc5d04a40cb1f7b5e6ea48e78ad06b7cc65483533f54e +4d6536bd0ad333854309e825feaca26fdd13ac4458c7ccfbe77fc76cc5a968bc From 6964b2f7370a01a297510c41f21c7dd0b26896a1 Mon Sep 17 00:00:00 2001 From: stephan Date: Mon, 14 Apr 2025 10:20:41 +0000 Subject: [PATCH 097/120] Doc/help text tweaks in autoconf/tea. FossilOrigin-Name: d6889f6b9aa70bc90f71883b3e7ba359162477afe5048dacb7dfa11733ad1e5a --- autoconf/tea/teaish.tcl | 6 +++--- manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/autoconf/tea/teaish.tcl b/autoconf/tea/teaish.tcl index e677ab9573..39a51599dc 100644 --- a/autoconf/tea/teaish.tcl +++ b/autoconf/tea/teaish.tcl @@ -1,4 +1,4 @@ -# Teaish configure script extension for the SQLite TCL extension +# Teaish configure script for the SQLite TCL extension define TEAISH_NAME sqlite define TEAISH_PKGNAME sqlite3 @@ -31,8 +31,8 @@ proc teaish-options {} { with-system-sqlite=0 => {Use the system-level sqlite instead of the copy in this tree. WARNING: this extension's version is taken from the in-tree copy - and there is no reliable way to get the version of a system-level copy - without knowing exactly where it lives (which this script does not)} + and there is no reliable way to get the version of a system-level + copy.} override-sqlite-version:VERSION => {For use with --with-system-sqlite to set the version number.} threadsafe=1 => {Disable mutexing} diff --git a/manifest b/manifest index 125350b96b..6e4d082d95 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Minor\scleanups\sand\sfixes\sin\sthe\sautoconf/tea\spieces. -D 2025-04-14T10:18:40.707 +C Doc/help\stext\stweaks\sin\sautoconf/tea. +D 2025-04-14T10:20:41.953 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -33,7 +33,7 @@ F autoconf/tea/configure d0b12b984edca6030d1976375b80157ac78b5b90a5b4f0dcee39357 F autoconf/tea/doc/sqlite3.n 9a97f4f717ceab73004ea412af7960625c1cb24b5c25e4ae4c8b5d8fa4300f4e F autoconf/tea/license.terms 13bd403c9610fd2b76ece0ab50c4c5eda933d523 F autoconf/tea/pkgIndex.tcl.in 2c99a64a0eff5dc2ad8e9657bb564fae2dbdfdb6b77a4c49b4387bd5a25c42ef -F autoconf/tea/teaish.tcl 31efdeaadd4629dd883b7cfb52e18365a6c91bfb91f8b127570876032e920d1c +F autoconf/tea/teaish.tcl 9fc1fb838eabebcda65035178ade8d04daafa6bf07a7f7a01e3b1fbd3df08f6c F autoconf/tea/teaish.test.tcl cfe94e1fb79dd078f650295be59843d470125e0cc3a17a1414c1fb8d77f4aea6 F autoconf/tea/teaish.tester.tcl.in 743fd0fe1e667f82fd8fc3ebe0a5c77763e4dbed7bbc8605a9d4b1d0663dac78 F autosetup/LICENSE 41a26aebdd2cd185d1e2b210f71b7ce234496979f6b35aef2cbf6b80cbed4ce4 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 4f54f7d07d31938f271bc5d04a40cb1f7b5e6ea48e78ad06b7cc65483533f54e -R 01a906f212b7ee1ccd4bda790fce8e28 +P 4d6536bd0ad333854309e825feaca26fdd13ac4458c7ccfbe77fc76cc5a968bc +R 6ce4803c4df253f8753ef98ce71d693c U stephan -Z 80aac49167f19af66627472602a3ae1a +Z ca1e347cc168fc07424b906d637dea8f # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index efe88d3b0f..670161277e 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -4d6536bd0ad333854309e825feaca26fdd13ac4458c7ccfbe77fc76cc5a968bc +d6889f6b9aa70bc90f71883b3e7ba359162477afe5048dacb7dfa11733ad1e5a From 6cabff0c22e94e5f76b64d99eb6598cf99eb03e8 Mon Sep 17 00:00:00 2001 From: stephan Date: Mon, 14 Apr 2025 11:31:10 +0000 Subject: [PATCH 098/120] JNI: part 1 of typos and Java style tweaks suggested in [forum:99ac7961d82f57f3|forum post 99ac7961d82f57f3]. FossilOrigin-Name: ab00af4e48501b0413650df31147866a805c34b7ecf506d1e208bc3ae6c2ef28 --- ext/jni/GNUmakefile | 2 +- ext/jni/src/c/sqlite3-jni.c | 8 ++-- ext/jni/src/c/sqlite3-jni.h | 2 +- .../org/sqlite/jni/annotation/NotNull.java | 4 +- ext/jni/src/org/sqlite/jni/capi/CApi.java | 23 ++++------ .../org/sqlite/jni/capi/CallbackProxy.java | 4 +- .../org/sqlite/jni/capi/OutputPointer.java | 42 +++++++++---------- .../sqlite/jni/capi/PrepareMultiCallback.java | 2 +- .../src/org/sqlite/jni/capi/SQLTester.java | 15 ++++--- manifest | 28 ++++++------- manifest.uuid | 2 +- 11 files changed, 63 insertions(+), 69 deletions(-) diff --git a/ext/jni/GNUmakefile b/ext/jni/GNUmakefile index 668b6e0841..f2fc7fb7bd 100644 --- a/ext/jni/GNUmakefile +++ b/ext/jni/GNUmakefile @@ -429,7 +429,7 @@ $(doc.index): $(JAVA_FILES.main) $(MAKEFILE) .FORCE: doc doc: $(doc.index) javadoc: $(doc.index) -# Force rebild of docs +# Force rebuild of docs redoc: @rm -f $(doc.index) @$(MAKE) doc diff --git a/ext/jni/src/c/sqlite3-jni.c b/ext/jni/src/c/sqlite3-jni.c index 6bd6daaec8..d6723453d0 100644 --- a/ext/jni/src/c/sqlite3-jni.c +++ b/ext/jni/src/c/sqlite3-jni.c @@ -133,7 +133,7 @@ ** Which sqlite3.c we're using needs to be configurable to enable ** building against a custom copy, e.g. the SEE variant. We have to ** include sqlite3.c, as opposed to sqlite3.h, in order to get access -** to some interal details like SQLITE_MAX_... and friends. This +** to some internal details like SQLITE_MAX_... and friends. This ** increases the rebuild time considerably but we need this in order ** to access some internal functionality and keep the to-Java-exported ** values of SQLITE_MAX_... and SQLITE_LIMIT_... in sync with the C @@ -5512,7 +5512,7 @@ static inline jobject new_java_fts5_api(JNIEnv * const env, fts5_api *sv){ ** Returns a per-JNIEnv global ref to the Fts5ExtensionApi singleton ** instance, or NULL on OOM. */ -static jobject s3jni_getFts5ExensionApi(JNIEnv * const env){ +static jobject s3jni_getFts5ExtensionApi(JNIEnv * const env){ if( !SJG.fts5.jExt ){ S3JniGlobal_mutex_enter; if( !SJG.fts5.jExt ){ @@ -5578,7 +5578,7 @@ JniDeclFtsApi(jobject,getInstanceForDb)(JniArgsEnvClass,jobject jDb){ JniDeclFtsXA(jobject,getInstance)(JniArgsEnvClass){ - return s3jni_getFts5ExensionApi(env); + return s3jni_getFts5ExtensionApi(env); } JniDeclFtsXA(jint,xColumnCount)(JniArgsEnvObj,jobject jCtx){ @@ -5641,7 +5641,7 @@ static void s3jni_fts5_extension_function(Fts5ExtensionApi const *pApi, S3JniDeclLocal_env; assert(pAux); - jFXA = s3jni_getFts5ExensionApi(env); + jFXA = s3jni_getFts5ExtensionApi(env); if( !jFXA ) goto error_oom; jpFts = new_java_Fts5Context(env, pFts); if( !jpFts ) goto error_oom; diff --git a/ext/jni/src/c/sqlite3-jni.h b/ext/jni/src/c/sqlite3-jni.h index 082a202122..6f93bf8ab7 100644 --- a/ext/jni/src/c/sqlite3-jni.h +++ b/ext/jni/src/c/sqlite3-jni.h @@ -1342,7 +1342,7 @@ JNIEXPORT jint JNICALL Java_org_sqlite_jni_capi_CApi_sqlite3_1data_1count * Method: sqlite3_db_config * Signature: (Lorg/sqlite/jni/capi/sqlite3;IILorg/sqlite/jni/capi/OutputPointer/Int32;)I */ -JNIEXPORT jint JNICALL Java_org_sqlite_jni_capi_CApi_sqlite3_1db_1config__Lorg_sqlite_jni_capi_sqlite3_2IILorg_sqlite_jni_capi_OutputPointer_Int32_2 +JNIEXPORT jint JNICALL Java_org_sqlite_jni_capi_CApi_sqlite3_1db_1config__Lorg_sqlite_jni_capi_sqlite3_2IILorg_sqlite_jni_capi_OutputPointer_00024Int32_2 (JNIEnv *, jclass, jobject, jint, jint, jobject); /* diff --git a/ext/jni/src/org/sqlite/jni/annotation/NotNull.java b/ext/jni/src/org/sqlite/jni/annotation/NotNull.java index 0c31782f23..2873082446 100644 --- a/ext/jni/src/org/sqlite/jni/annotation/NotNull.java +++ b/ext/jni/src/org/sqlite/jni/annotation/NotNull.java @@ -31,11 +31,11 @@ import java.lang.annotation.*; never pass a null value to the callback for that parameter.

Passing a null, for this annotation's definition of null, for - any parameter marked with this annoation specifically invokes + any parameter marked with this annotation specifically invokes undefined behavior (see below).

Passing 0 (i.e. C NULL) or a negative value for any long-type - parameter marked with this annoation specifically invokes undefined + parameter marked with this annotation specifically invokes undefined behavior (see below). Such values are treated as C pointers in the JNI layer.

diff --git a/ext/jni/src/org/sqlite/jni/capi/CApi.java b/ext/jni/src/org/sqlite/jni/capi/CApi.java index 13367a6102..731fb0ac3b 100644 --- a/ext/jni/src/org/sqlite/jni/capi/CApi.java +++ b/ext/jni/src/org/sqlite/jni/capi/CApi.java @@ -12,14 +12,9 @@ ** This file declares the main JNI bindings for the sqlite3 C API. */ package org.sqlite.jni.capi; -import java.nio.charset.StandardCharsets; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import org.sqlite.jni.annotation.*; import java.util.Arrays; +import java.nio.charset.StandardCharsets; +import org.sqlite.jni.annotation.*; /** This class contains the entire C-style sqlite3 JNI API binding, @@ -169,7 +164,7 @@ public final class CApi {

Like the C API, it returns 0 if allocation fails or if initialize is false and no prior aggregate context was allocated for cx. If initialize is true then it returns 0 only on - allocation error. In all casses, 0 is considered the sentinel + allocation error. In all cases, 0 is considered the sentinel "not a key" value. */ public static native long sqlite3_aggregate_context(sqlite3_context cx, boolean initialize); @@ -563,7 +558,7 @@ public final class CApi { sqlite3_blob_open(db.getNativePointer(), dbName, tableName, columnName, iRow, flags, out); return out.take(); - }; + } private static native int sqlite3_blob_read( @NotNull long ptrToBlob, @NotNull byte[] target, int srcOffset @@ -1298,7 +1293,7 @@ public final class CApi { final OutputPointer.sqlite3 out = new OutputPointer.sqlite3(); sqlite3_open(filename, out); return out.take(); - }; + } public static native int sqlite3_open_v2( @Nullable String filename, @NotNull OutputPointer.sqlite3 ppDb, @@ -1314,7 +1309,7 @@ public final class CApi { final OutputPointer.sqlite3 out = new OutputPointer.sqlite3(); sqlite3_open_v2(filename, out, flags, zVfs); return out.take(); - }; + } /** The sqlite3_prepare() family of functions require slightly @@ -1410,7 +1405,7 @@ public final class CApi { /** Works like the canonical sqlite3_prepare_v2() but its "tail" - output paramter is returned as the index offset into the given + output parameter is returned as the index offset into the given byte array at which SQL parsing stopped. */ public static int sqlite3_prepare_v2( @@ -1462,7 +1457,7 @@ public final class CApi { /** Works like the canonical sqlite3_prepare_v2() but its "tail" - output paramter is returned as the index offset into the given + output parameter is returned as the index offset into the given byte array at which SQL parsing stopped. */ public static int sqlite3_prepare_v3( @@ -1542,7 +1537,7 @@ public final class CApi { int rc = 0; final OutputPointer.sqlite3_stmt outStmt = new OutputPointer.sqlite3_stmt(); while( 0==rc && pos0 ){ sqlChunk = Arrays.copyOfRange(sqlChunk, pos, sqlChunk.length); diff --git a/ext/jni/src/org/sqlite/jni/capi/CallbackProxy.java b/ext/jni/src/org/sqlite/jni/capi/CallbackProxy.java index ffd7761190..04000a3f31 100644 --- a/ext/jni/src/org/sqlite/jni/capi/CallbackProxy.java +++ b/ext/jni/src/org/sqlite/jni/capi/CallbackProxy.java @@ -13,7 +13,7 @@ */ package org.sqlite.jni.capi; /** - This marker interface exists soley for use as a documentation and + This marker interface exists solely for use as a documentation and class-grouping tool. It should be applied to interfaces or classes which have a call() method implementing some specific callback interface on behalf of the C library. @@ -34,7 +34,7 @@ package org.sqlite.jni.capi; proxying for, minus the {@code sqlite3_} prefix, plus a {@code Callback} suffix. e.g. {@code sqlite3_busy_handler()}'s callback is named {@code BusyHandlerCallback}. Exceptions are made where that - would potentially be ambiguous, e.g. {@link ConfigSqllogCallback} + would potentially be ambiguous, e.g. {@link ConfigSqlLogCallback} instead of {@code ConfigCallback} because the {@code sqlite3_config()} interface may need to support more callback types in the future. diff --git a/ext/jni/src/org/sqlite/jni/capi/OutputPointer.java b/ext/jni/src/org/sqlite/jni/capi/OutputPointer.java index 7bf7529da1..f50d0c57cb 100644 --- a/ext/jni/src/org/sqlite/jni/capi/OutputPointer.java +++ b/ext/jni/src/org/sqlite/jni/capi/OutputPointer.java @@ -20,7 +20,7 @@ package org.sqlite.jni.capi; from the native JNI code is unduly quirky due to a lack of autoboxing at that level. -

The usage is similar for all of thes types: +

The usage is similar for all of these types:

{@code
    OutputPointer.sqlite3 out = new OutputPointer.sqlite3();
@@ -55,9 +55,9 @@ public final class OutputPointer {
     /** Sets the current value to null. */
     public void clear(){value = null;}
     /** Returns the current value. */
-    public final org.sqlite.jni.capi.sqlite3 get(){return value;}
+    public org.sqlite.jni.capi.sqlite3 get(){return value;}
     /** Equivalent to calling get() then clear(). */
-    public final org.sqlite.jni.capi.sqlite3 take(){
+    public org.sqlite.jni.capi.sqlite3 take(){
       final org.sqlite.jni.capi.sqlite3 v = value;
       value = null;
       return v;
@@ -76,9 +76,9 @@ public final class OutputPointer {
     /** Sets the current value to null. */
     public void clear(){value = null;}
     /** Returns the current value. */
-    public final org.sqlite.jni.capi.sqlite3_blob get(){return value;}
+    public org.sqlite.jni.capi.sqlite3_blob get(){return value;}
     /** Equivalent to calling get() then clear(). */
-    public final org.sqlite.jni.capi.sqlite3_blob take(){
+    public org.sqlite.jni.capi.sqlite3_blob take(){
       final org.sqlite.jni.capi.sqlite3_blob v = value;
       value = null;
       return v;
@@ -98,9 +98,9 @@ public final class OutputPointer {
     /** Sets the current value to null. */
     public void clear(){value = null;}
     /** Returns the current value. */
-    public final org.sqlite.jni.capi.sqlite3_stmt get(){return value;}
+    public org.sqlite.jni.capi.sqlite3_stmt get(){return value;}
     /** Equivalent to calling get() then clear(). */
-    public final org.sqlite.jni.capi.sqlite3_stmt take(){
+    public org.sqlite.jni.capi.sqlite3_stmt take(){
       final org.sqlite.jni.capi.sqlite3_stmt v = value;
       value = null;
       return v;
@@ -120,9 +120,9 @@ public final class OutputPointer {
     /** Sets the current value to null. */
     public void clear(){value = null;}
     /** Returns the current value. */
-    public final org.sqlite.jni.capi.sqlite3_value get(){return value;}
+    public org.sqlite.jni.capi.sqlite3_value get(){return value;}
     /** Equivalent to calling get() then clear(). */
-    public final org.sqlite.jni.capi.sqlite3_value take(){
+    public org.sqlite.jni.capi.sqlite3_value take(){
       final org.sqlite.jni.capi.sqlite3_value v = value;
       value = null;
       return v;
@@ -144,9 +144,9 @@ public final class OutputPointer {
     /** Initializes with the value v. */
     public Bool(boolean v){value = v;}
     /** Returns the current value. */
-    public final boolean get(){return value;}
+    public boolean get(){return value;}
     /** Sets the current value to v. */
-    public final void set(boolean v){value = v;}
+    public void set(boolean v){value = v;}
   }
 
   /**
@@ -164,9 +164,9 @@ public final class OutputPointer {
     /** Initializes with the value v. */
     public Int32(int v){value = v;}
     /** Returns the current value. */
-    public final int get(){return value;}
+    public int get(){return value;}
     /** Sets the current value to v. */
-    public final void set(int v){value = v;}
+    public void set(int v){value = v;}
   }
 
   /**
@@ -184,9 +184,9 @@ public final class OutputPointer {
     /** Initializes with the value v. */
     public Int64(long v){value = v;}
     /** Returns the current value. */
-    public final long get(){return value;}
+    public long get(){return value;}
     /** Sets the current value. */
-    public final void set(long v){value = v;}
+    public void set(long v){value = v;}
   }
 
   /**
@@ -204,9 +204,9 @@ public final class OutputPointer {
     /** Initializes with the value v. */
     public String(java.lang.String v){value = v;}
     /** Returns the current value. */
-    public final java.lang.String get(){return value;}
+    public java.lang.String get(){return value;}
     /** Sets the current value. */
-    public final void set(java.lang.String v){value = v;}
+    public void set(java.lang.String v){value = v;}
   }
 
   /**
@@ -224,9 +224,9 @@ public final class OutputPointer {
     /** Initializes with the value v. */
     public ByteArray(byte[] v){value = v;}
     /** Returns the current value. */
-    public final byte[] get(){return value;}
+    public byte[] get(){return value;}
     /** Sets the current value. */
-    public final void set(byte[] v){value = v;}
+    public void set(byte[] v){value = v;}
   }
 
   /**
@@ -246,8 +246,8 @@ public final class OutputPointer {
     /** Initializes with the value v. */
     public ByteBuffer(java.nio.ByteBuffer v){value = v;}
     /** Returns the current value. */
-    public final java.nio.ByteBuffer get(){return value;}
+    public java.nio.ByteBuffer get(){return value;}
     /** Sets the current value. */
-    public final void set(java.nio.ByteBuffer v){value = v;}
+    public void set(java.nio.ByteBuffer v){value = v;}
   }
 }
diff --git a/ext/jni/src/org/sqlite/jni/capi/PrepareMultiCallback.java b/ext/jni/src/org/sqlite/jni/capi/PrepareMultiCallback.java
index af242fb3c1..35bb069c49 100644
--- a/ext/jni/src/org/sqlite/jni/capi/PrepareMultiCallback.java
+++ b/ext/jni/src/org/sqlite/jni/capi/PrepareMultiCallback.java
@@ -65,7 +65,7 @@ public interface PrepareMultiCallback extends CallbackProxy {
      A PrepareMultiCallback impl which steps entirely through a result set,
      ignoring all non-error results.
   */
-  public static final class StepAll implements PrepareMultiCallback {
+  final class StepAll implements PrepareMultiCallback {
     public StepAll(){}
     /**
        Calls sqlite3_step() on st until it returns something other than
diff --git a/ext/jni/src/org/sqlite/jni/capi/SQLTester.java b/ext/jni/src/org/sqlite/jni/capi/SQLTester.java
index 634f844c24..5edd3aedb7 100644
--- a/ext/jni/src/org/sqlite/jni/capi/SQLTester.java
+++ b/ext/jni/src/org/sqlite/jni/capi/SQLTester.java
@@ -13,7 +13,6 @@
 ** SQLTester framework.
 */
 package org.sqlite.jni.capi;
-import java.util.List;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.nio.charset.StandardCharsets;
@@ -31,7 +30,7 @@ enum ResultBufferMode {
   ESCAPED,
   //! Append output as-is
   ASIS
-};
+}
 
 /**
    Modes to specify how to emit multi-row output from
@@ -42,7 +41,7 @@ enum ResultRowMode {
   ONELINE,
   //! Add a newline between each result row.
   NEWLINE
-};
+}
 
 /**
    Base exception type for test-related failures.
@@ -278,7 +277,7 @@ public class SQLTester {
   }
 
   private StringBuilder clearBuffer(StringBuilder b){
-    b.setLength(0);;
+    b.setLength(0);
     return b;
   }
 
@@ -780,7 +779,7 @@ abstract class Command {
 class CloseDbCommand extends Command {
   public void process(SQLTester t, TestScript ts, String[] argv) throws Exception{
     argcCheck(ts,argv,0,1);
-    Integer id;
+    int id;
     if(argv.length>1){
       String arg = argv[1];
       if("all".equals(arg)){
@@ -1020,7 +1019,7 @@ class VerbosityCommand extends Command {
 
 class CommandDispatcher {
 
-  private static java.util.Map commandMap =
+  private static final java.util.Map commandMap =
     new java.util.HashMap<>();
 
   /**
@@ -1244,7 +1243,7 @@ class TestScript {
     }
     cur.pos = i;
     final String rv = cur.sb.toString();
-    if( i==cur.src.length && 0==rv.length() ){
+    if( i==cur.src.length && rv.isEmpty() ){
       return null /* EOF */;
     }
     return rv;
@@ -1364,7 +1363,7 @@ class TestScript {
     if( m.find() ){
       throw new IncompatibleDirective(this, m.group(1)+": "+m.group(3));
     }
-    if( line.indexOf("\n|")>=0 ){
+    if( line.contains("\n|") ){
       throw new IncompatibleDirective(this, "newline-pipe combination.");
     }
     return;
diff --git a/manifest b/manifest
index 6e4d082d95..8048857988 100644
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Doc/help\stext\stweaks\sin\sautoconf/tea.
-D 2025-04-14T10:20:41.953
+C JNI:\spart\s1\sof\stypos\sand\sJava\sstyle\stweaks\ssuggested\sin\s[forum:99ac7961d82f57f3|forum\spost\s99ac7961d82f57f3].
+D 2025-04-14T11:31:10.823
 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
@@ -286,13 +286,13 @@ F ext/intck/intckfault.test cff3f75dff74abb3edfcb13f6aa53f6436746ab64b09fe5e2028
 F ext/intck/sqlite3intck.c 0d10df36e2b7b438aa80ecd3f5e584d41b747586b038258fe6b407f66b81e7c5
 F ext/intck/sqlite3intck.h 2b40c38e7063ab822c974c0bd4aed97dabb579ccfe2e180a4639bb3bbef0f1c9
 F ext/intck/test_intck.c 4f9eaadaedccb9df1d26ba41116a0a8e5b0c5556dc3098c8ff68633adcccdea8
-F ext/jni/GNUmakefile 7e3d3ea6571f035d26ed1b82e9bb7811e665ba95e3b9b91005547458417cd311
+F ext/jni/GNUmakefile 8a94e3a1953b88cf117fb2a5380480feada8b4f5316f02572cab425030a720b4
 F ext/jni/README.md e3fbd47c774683539b7fdc95a667eb9cd6e64d8510f3ee327e7fa0c61c8aa787
 F ext/jni/jar-dist.make 030aaa4ae71dd86e4ec5e7c1e6cd86f9dfa47c4592c070d2e35157e42498e1fa
-F ext/jni/src/c/sqlite3-jni.c 4b2cd08c46a649b6369f4f1b63a38f10ef481b7a72e8230bb6c8d63d8c62e0df
-F ext/jni/src/c/sqlite3-jni.h 913ab8e8fee432ae40f0e387c8231118d17053714703f5ded18202912a8a3fbf
+F ext/jni/src/c/sqlite3-jni.c 74c35473c1fb1756ee911468d5027e4f989eea6764dff429b1214f76d78c431d
+F ext/jni/src/c/sqlite3-jni.h cc5fc5cefe2d63f461a4bad90735b34be0d85e5fe6778ae7ba992fae4d223cdf
 F ext/jni/src/org/sqlite/jni/annotation/Experimental.java 8603498634e41d0f7c70f661f64e05df64376562ea8f126829fd1e0cdd47e82b
-F ext/jni/src/org/sqlite/jni/annotation/NotNull.java 38e7e58a69b26dc100e458b31dfa3b2a7d67bc36d051325526ef1987d5bc8a24
+F ext/jni/src/org/sqlite/jni/annotation/NotNull.java be6cc3e8e114485822331630097cc0f816377e8503af2fc02f9305ff2b353917
 F ext/jni/src/org/sqlite/jni/annotation/Nullable.java 56e3dee1f3f703a545dfdeddc1c3d64d1581172b1ad01ffcae95c18547fafd90
 F ext/jni/src/org/sqlite/jni/annotation/package-info.java 977b374aed9d5853cbf3438ba3b0940abfa2ea4574f702a2448ee143b98ac3ca
 F ext/jni/src/org/sqlite/jni/capi/AbstractCollationCallback.java 1afa90d3f236f79cc7fcd2497e111992644f7596fbc8e8bcf7f1908ae00acd6c
@@ -300,22 +300,22 @@ F ext/jni/src/org/sqlite/jni/capi/AggregateFunction.java 0b72cdff61533b564d65b63
 F ext/jni/src/org/sqlite/jni/capi/AuthorizerCallback.java c045a5b47e02bb5f1af91973814a905f12048c428a3504fbc5266d1c1be3de5a
 F ext/jni/src/org/sqlite/jni/capi/AutoExtensionCallback.java 74cc4998a73d6563542ecb90804a3c4f4e828cb4bd69e61226d1a51f4646e759
 F ext/jni/src/org/sqlite/jni/capi/BusyHandlerCallback.java 7b8e19810c42b0ad21a04b5d8c804b32ee5905d137148703f16a75b612c380ca
-F ext/jni/src/org/sqlite/jni/capi/CApi.java 0c199e8e68c25f4b69cc583b73d9f329ed999a37d7a20d11fc4c2c7c0626d5fa
-F ext/jni/src/org/sqlite/jni/capi/CallbackProxy.java 709e41af15ae6523b6b6d4a3a29d64be4fac42d5b2199074a04ddbb42aa92a15
+F ext/jni/src/org/sqlite/jni/capi/CApi.java 09f3a8cf500ecb6fc9df37044bc157d27c17d34db0eec7d9fb7116edeead5a36
+F ext/jni/src/org/sqlite/jni/capi/CallbackProxy.java 1b3baf5b772f266e8baf8f35f0ddc5bd87fc8c4927ec69115c46fd6fba6701c3
 F ext/jni/src/org/sqlite/jni/capi/CollationCallback.java e29bcfc540fdd343e2f5cca4d27235113f2886acb13380686756d5cabdfd065a
 F ext/jni/src/org/sqlite/jni/capi/CollationNeededCallback.java 5bfa226a8e7a92e804fd52d6e42b4c7b875fa7a94f8e2c330af8cc244a8920ab
 F ext/jni/src/org/sqlite/jni/capi/CommitHookCallback.java 482f53dfec9e3ac2a9070d3fceebd56250932aaaf7c4f5bc8de29fc011416e0c
 F ext/jni/src/org/sqlite/jni/capi/ConfigLogCallback.java b995ca412f59b631803b93aa5b3684fce62e335d1e123207084c054abfd488d4
 F ext/jni/src/org/sqlite/jni/capi/ConfigSqlLogCallback.java e5723900b6458bc6288f52187090a78ebe0a20f403ac7c887ec9061dfe51aba7
 F ext/jni/src/org/sqlite/jni/capi/NativePointerHolder.java b7036dcb1ef1b39f1f36ac605dde0ff1a24a9a01ade6aa1a605039443e089a61
-F ext/jni/src/org/sqlite/jni/capi/OutputPointer.java 246b0e66c4603f41c567105a21189d138aaf8c58203ecd4928802333da553e7c
-F ext/jni/src/org/sqlite/jni/capi/PrepareMultiCallback.java 7c96133a1542126374b39a65b2eaf4e01f97000e84b68812c475a7a8095414ed
+F ext/jni/src/org/sqlite/jni/capi/OutputPointer.java 418a82e705ec80b0dabffacfe11b9fab3cb5f2215dcafcfec083eebf5bce9d20
+F ext/jni/src/org/sqlite/jni/capi/PrepareMultiCallback.java 621cd9d887956fb2c99c9be59ee831c00a0b538dbae7313c525cd2936b5d5647
 F ext/jni/src/org/sqlite/jni/capi/PreupdateHookCallback.java efcf57545c5e282d1dd332fa63329b3b218d98f356ef107a9dbe3979be82213a
 F ext/jni/src/org/sqlite/jni/capi/ProgressHandlerCallback.java 01bc0c238eed2d5f93c73522cb7849a445cc9098c2ed1e78248fa20ed1cfde5b
 F ext/jni/src/org/sqlite/jni/capi/ResultCode.java 8141171f1bcf9f46eef303b9d3c5dc2537a25ad1628f3638398d8a60cacefa7f
 F ext/jni/src/org/sqlite/jni/capi/RollbackHookCallback.java e172210a2080e851ebb694c70e9f0bf89284237795e38710a7f5f1b61e3f6787
 F ext/jni/src/org/sqlite/jni/capi/SQLFunction.java 0d1e9afc9ff8a2adb94a155b72385155fa3b8011a5cca0bb3c28468c7131c1a5
-F ext/jni/src/org/sqlite/jni/capi/SQLTester.java e2e63c92992c412b381e5577319c81e4f6c73b185ba15a85931ff5d5c3eb2600
+F ext/jni/src/org/sqlite/jni/capi/SQLTester.java 828ad9e149885a5080be920b5edee11fc43d6603485529da256b19e3581b72cc
 F ext/jni/src/org/sqlite/jni/capi/ScalarFunction.java 93b9700fca4c68075ccab12fe0fbbc76c91cafc9f368e835b9bd7cd7732c8615
 F ext/jni/src/org/sqlite/jni/capi/TableColumnMetadata.java addf120e0e76e5be1ff2260daa7ce305ff9b5fafd64153a7a28e9d8f000a815f
 F ext/jni/src/org/sqlite/jni/capi/Tester1.java e5fa17301b7266c1cbe4bcce67788e08e45871c7c72c153d515abb37e501de0a
@@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350
 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 4d6536bd0ad333854309e825feaca26fdd13ac4458c7ccfbe77fc76cc5a968bc
-R 6ce4803c4df253f8753ef98ce71d693c
+P d6889f6b9aa70bc90f71883b3e7ba359162477afe5048dacb7dfa11733ad1e5a
+R 4fa41ddd47fcd20793ebec54c99f81c8
 U stephan
-Z ca1e347cc168fc07424b906d637dea8f
+Z d553daca30b625c1ccad3f32966884c5
 # Remove this line to create a well-formed Fossil manifest.
diff --git a/manifest.uuid b/manifest.uuid
index 670161277e..6f2c65c185 100644
--- a/manifest.uuid
+++ b/manifest.uuid
@@ -1 +1 @@
-d6889f6b9aa70bc90f71883b3e7ba359162477afe5048dacb7dfa11733ad1e5a
+ab00af4e48501b0413650df31147866a805c34b7ecf506d1e208bc3ae6c2ef28

From d01239f37911304ef1890d217ed7fe62a87b352b Mon Sep 17 00:00:00 2001
From: stephan 
Date: Mon, 14 Apr 2025 12:09:24 +0000
Subject: [PATCH 099/120] JNI: part 2 of typos and Java style tweaks suggested
 in [forum:99ac7961d82f57f3|forum post 99ac7961d82f57f3].

FossilOrigin-Name: 5e6e9aee5b43e6ae98e78293a0da30e82ad18c3c9c03fc6298240233ddadb2a2
---
 ext/jni/src/c/sqlite3-jni.h                   |  2 +-
 .../sqlite/jni/capi/TableColumnMetadata.java  | 10 +-
 ext/jni/src/org/sqlite/jni/capi/Tester1.java  | 21 ++--
 .../org/sqlite/jni/capi/XDestroyCallback.java |  2 +-
 .../org/sqlite/jni/fts5/Fts5ExtensionApi.java |  3 +-
 .../src/org/sqlite/jni/fts5/TesterFts5.java   | 95 +++++++++----------
 .../jni/fts5/fts5_extension_function.java     |  6 +-
 .../org/sqlite/jni/test-script-interpreter.md |  4 +-
 .../sqlite/jni/wrapper1/ScalarFunction.java   |  4 -
 .../org/sqlite/jni/wrapper1/SqlFunction.java  | 22 ++---
 .../src/org/sqlite/jni/wrapper1/Sqlite.java   | 45 +++++----
 manifest                                      | 32 +++----
 manifest.uuid                                 |  2 +-
 13 files changed, 124 insertions(+), 124 deletions(-)

diff --git a/ext/jni/src/c/sqlite3-jni.h b/ext/jni/src/c/sqlite3-jni.h
index 6f93bf8ab7..082a202122 100644
--- a/ext/jni/src/c/sqlite3-jni.h
+++ b/ext/jni/src/c/sqlite3-jni.h
@@ -1342,7 +1342,7 @@ JNIEXPORT jint JNICALL Java_org_sqlite_jni_capi_CApi_sqlite3_1data_1count
  * Method:    sqlite3_db_config
  * Signature: (Lorg/sqlite/jni/capi/sqlite3;IILorg/sqlite/jni/capi/OutputPointer/Int32;)I
  */
-JNIEXPORT jint JNICALL Java_org_sqlite_jni_capi_CApi_sqlite3_1db_1config__Lorg_sqlite_jni_capi_sqlite3_2IILorg_sqlite_jni_capi_OutputPointer_00024Int32_2
+JNIEXPORT jint JNICALL Java_org_sqlite_jni_capi_CApi_sqlite3_1db_1config__Lorg_sqlite_jni_capi_sqlite3_2IILorg_sqlite_jni_capi_OutputPointer_Int32_2
   (JNIEnv *, jclass, jobject, jint, jint, jobject);
 
 /*
diff --git a/ext/jni/src/org/sqlite/jni/capi/TableColumnMetadata.java b/ext/jni/src/org/sqlite/jni/capi/TableColumnMetadata.java
index d8b6226ac9..54808cd1ca 100644
--- a/ext/jni/src/org/sqlite/jni/capi/TableColumnMetadata.java
+++ b/ext/jni/src/org/sqlite/jni/capi/TableColumnMetadata.java
@@ -18,11 +18,11 @@ package org.sqlite.jni.capi;
    They are populated only via that interface.
 */
 public final class TableColumnMetadata {
-  OutputPointer.Bool pNotNull = new OutputPointer.Bool();
-  OutputPointer.Bool pPrimaryKey = new OutputPointer.Bool();
-  OutputPointer.Bool pAutoinc = new OutputPointer.Bool();
-  OutputPointer.String pzCollSeq = new OutputPointer.String();
-  OutputPointer.String pzDataType = new OutputPointer.String();
+  final OutputPointer.Bool pNotNull = new OutputPointer.Bool();
+  final OutputPointer.Bool pPrimaryKey = new OutputPointer.Bool();
+  final OutputPointer.Bool pAutoinc = new OutputPointer.Bool();
+  final OutputPointer.String pzCollSeq = new OutputPointer.String();
+  final OutputPointer.String pzDataType = new OutputPointer.String();
 
   public TableColumnMetadata(){
   }
diff --git a/ext/jni/src/org/sqlite/jni/capi/Tester1.java b/ext/jni/src/org/sqlite/jni/capi/Tester1.java
index 05b1cfeaed..a9b766e9f3 100644
--- a/ext/jni/src/org/sqlite/jni/capi/Tester1.java
+++ b/ext/jni/src/org/sqlite/jni/capi/Tester1.java
@@ -19,7 +19,6 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
 
 /**
    An annotation for Tester1 tests which we do not want to run in
@@ -62,13 +61,13 @@ public class Tester1 implements Runnable {
   //! List of test*() methods to run.
   private static List testMethods = null;
   //! List of exceptions collected by run()
-  private static List listErrors = new ArrayList<>();
+  private static final List listErrors = new ArrayList<>();
   private static final class Metrics {
     //! Number of times createNewDb() (or equivalent) is invoked.
     volatile int dbOpen = 0;
   }
 
-  private Integer tId;
+  private final Integer tId;
 
   Tester1(Integer id){
     tId = id;
@@ -78,7 +77,7 @@ public class Tester1 implements Runnable {
 
   public static synchronized void outln(){
     if( !quietMode ){
-      System.out.println("");
+      System.out.println();
     }
   }
 
@@ -523,7 +522,7 @@ public class Tester1 implements Runnable {
     }
     sqlite3_finalize(stmt);
     affirm(3 == n);
-    affirm("w😃rldhell🤩!🤩".equals(sbuf.toString()));
+    affirm("w😃rldhell🤩!🤩".contentEquals(sbuf));
 
     try( sqlite3_stmt stmt2 = prepare(db, "SELECT ?, ?") ){
       rc = sqlite3_bind_text(stmt2, 1, "");
@@ -668,7 +667,7 @@ public class Tester1 implements Runnable {
     execSql(db, "CREATE TABLE t(a); INSERT INTO t(a) VALUES('a'),('b'),('c')");
     final ValueHolder xDestroyCalled = new ValueHolder<>(0);
     final CollationCallback myCollation = new CollationCallback() {
-        private String myState =
+        private final String myState =
           "this is local state. There is much like it, but this is mine.";
         @Override
         // Reverse-sorts its inputs...
@@ -847,7 +846,7 @@ public class Tester1 implements Runnable {
     SQLFunction funcAgg = new AggregateFunction(){
         @Override public void xStep(sqlite3_context cx, sqlite3_value[] args){
           /** Throwing from here should emit loud noise on stdout or stderr
-              but the exception is supressed because we have no way to inform
+              but the exception is suppressed because we have no way to inform
               sqlite about it from these callbacks. */
           //throw new RuntimeException("Throwing from an xStep");
         }
@@ -1850,7 +1849,7 @@ public class Tester1 implements Runnable {
       "; insert into t(a) values(1),(2),(3);",
       "select a from t;"
     };
-    final List liStmt = new ArrayList();
+    final List liStmt = new ArrayList<>();
     final PrepareMultiCallback proxy = new PrepareMultiCallback.StepAll();
     final ValueHolder toss = new ValueHolder<>(null);
     PrepareMultiCallback m = new PrepareMultiCallback() {
@@ -1984,9 +1983,9 @@ public class Tester1 implements Runnable {
      -v: emit some developer-mode info at the end.
   */
   public static void main(String[] args) throws Exception {
-    Integer nThread = 1;
+    int nThread = 1;
     boolean doSomethingForDev = false;
-    Integer nRepeat = 1;
+    int nRepeat = 1;
     boolean forceFail = false;
     boolean sqlLog = false;
     boolean configLog = false;
@@ -2048,7 +2047,7 @@ public class Tester1 implements Runnable {
       final ConfigLogCallback log = new ConfigLogCallback() {
           @Override public void call(int code, String msg){
             outln("ConfigLogCallback: ",ResultCode.getEntryForInt(code),": ", msg);
-          };
+          }
         };
       int rc = sqlite3_config( log );
       affirm( 0==rc );
diff --git a/ext/jni/src/org/sqlite/jni/capi/XDestroyCallback.java b/ext/jni/src/org/sqlite/jni/capi/XDestroyCallback.java
index 372e4ec8d0..ce6c6a6abf 100644
--- a/ext/jni/src/org/sqlite/jni/capi/XDestroyCallback.java
+++ b/ext/jni/src/org/sqlite/jni/capi/XDestroyCallback.java
@@ -33,5 +33,5 @@ public interface XDestroyCallback {
      each individual reference, leading to memory corruption or a
      crash via duplicate free().
   */
-  public void xDestroy();
+  void xDestroy();
 }
diff --git a/ext/jni/src/org/sqlite/jni/fts5/Fts5ExtensionApi.java b/ext/jni/src/org/sqlite/jni/fts5/Fts5ExtensionApi.java
index 594f3eaad6..f409f4961d 100644
--- a/ext/jni/src/org/sqlite/jni/fts5/Fts5ExtensionApi.java
+++ b/ext/jni/src/org/sqlite/jni/fts5/Fts5ExtensionApi.java
@@ -12,7 +12,6 @@
 ** This file is part of the JNI bindings for the sqlite3 C API.
 */
 package org.sqlite.jni.fts5;
-import java.nio.charset.StandardCharsets;
 import org.sqlite.jni.capi.*;
 import org.sqlite.jni.annotation.*;
 
@@ -24,7 +23,7 @@ public final class Fts5ExtensionApi extends NativePointerHolder aOut = new ArrayList();
+    List aOut = new ArrayList<>();
 
     /* Iterate through the list of SQL statements. For each, step through
     ** it and add any results to the aOut[] array.  */
@@ -137,14 +136,14 @@ public class TesterFts5 {
   **     fts5_columncount()
   */
   private static void create_test_functions(sqlite3 db){
-    /* 
+    /*
     ** A user-defined-function fts5_rowid() that uses xRowid()
     */
     fts5_extension_function fts5_rowid = new fts5_extension_function(){
       @Override public void call(
-          Fts5ExtensionApi ext, 
+          Fts5ExtensionApi ext,
           Fts5Context fCx,
-          sqlite3_context pCx, 
+          sqlite3_context pCx,
           sqlite3_value argv[]
       ){
         long rowid = ext.xRowid(fCx);
@@ -153,14 +152,14 @@ public class TesterFts5 {
       public void xDestroy(){ }
     };
 
-    /* 
-    ** fts5_columncount() - xColumnCount() 
+    /*
+    ** fts5_columncount() - xColumnCount()
     */
     fts5_extension_function fts5_columncount = new fts5_extension_function(){
       @Override public void call(
-          Fts5ExtensionApi ext, 
+          Fts5ExtensionApi ext,
           Fts5Context fCx,
-          sqlite3_context pCx, 
+          sqlite3_context pCx,
           sqlite3_value argv[]
       ){
         int nCol = ext.xColumnCount(fCx);
@@ -169,14 +168,14 @@ public class TesterFts5 {
       public void xDestroy(){ }
     };
 
-    /* 
-    ** fts5_columnsize() - xColumnSize() 
+    /*
+    ** fts5_columnsize() - xColumnSize()
     */
     fts5_extension_function fts5_columnsize = new fts5_extension_function(){
       @Override public void call(
-          Fts5ExtensionApi ext, 
+          Fts5ExtensionApi ext,
           Fts5Context fCx,
-          sqlite3_context pCx, 
+          sqlite3_context pCx,
           sqlite3_value argv[]
       ){
         if( argv.length!=1 ){
@@ -194,14 +193,14 @@ public class TesterFts5 {
       public void xDestroy(){ }
     };
 
-    /* 
-    ** fts5_columntext() - xColumnText() 
+    /*
+    ** fts5_columntext() - xColumnText()
     */
     fts5_extension_function fts5_columntext = new fts5_extension_function(){
       @Override public void call(
-          Fts5ExtensionApi ext, 
+          Fts5ExtensionApi ext,
           Fts5Context fCx,
-          sqlite3_context pCx, 
+          sqlite3_context pCx,
           sqlite3_value argv[]
       ){
         if( argv.length!=1 ){
@@ -219,14 +218,14 @@ public class TesterFts5 {
       public void xDestroy(){ }
     };
 
-    /* 
-    ** fts5_columntotalsize() - xColumnTotalSize() 
+    /*
+    ** fts5_columntotalsize() - xColumnTotalSize()
     */
     fts5_extension_function fts5_columntsize = new fts5_extension_function(){
       @Override public void call(
-          Fts5ExtensionApi ext, 
+          Fts5ExtensionApi ext,
           Fts5Context fCx,
-          sqlite3_context pCx, 
+          sqlite3_context pCx,
           sqlite3_value argv[]
       ){
         if( argv.length!=1 ){
@@ -251,9 +250,9 @@ public class TesterFts5 {
     */
     class fts5_aux implements fts5_extension_function {
       @Override public void call(
-          Fts5ExtensionApi ext, 
+          Fts5ExtensionApi ext,
           Fts5Context fCx,
-          sqlite3_context pCx, 
+          sqlite3_context pCx,
           sqlite3_value argv[]
       ){
         if( argv.length>1 ){
@@ -268,13 +267,13 @@ public class TesterFts5 {
 
         if( argv.length==1 ){
           String val = sqlite3_value_text16(argv[0]);
-          if( !val.equals("") ){
+          if( !val.isEmpty() ){
             ext.xSetAuxdata(fCx, val);
           }
         }
       }
       public void xDestroy(){ }
-    };
+    }
 
     /*
     ** fts5_inst();
@@ -286,9 +285,9 @@ public class TesterFts5 {
     */
     fts5_extension_function fts5_inst = new fts5_extension_function(){
       @Override public void call(
-          Fts5ExtensionApi ext, 
+          Fts5ExtensionApi ext,
           Fts5Context fCx,
-          sqlite3_context pCx, 
+          sqlite3_context pCx,
           sqlite3_value argv[]
       ){
         if( argv.length!=0 ){
@@ -299,7 +298,7 @@ public class TesterFts5 {
         OutputPointer.Int32 piPhrase = new OutputPointer.Int32();
         OutputPointer.Int32 piCol = new OutputPointer.Int32();
         OutputPointer.Int32 piOff = new OutputPointer.Int32();
-        String ret = new String();
+        String ret = "";
 
         int rc = ext.xInstCount(fCx, pnInst);
         int nInst = pnInst.get();
@@ -327,9 +326,9 @@ public class TesterFts5 {
     */
     fts5_extension_function fts5_pinst = new fts5_extension_function(){
       @Override public void call(
-          Fts5ExtensionApi ext, 
+          Fts5ExtensionApi ext,
           Fts5Context fCx,
-          sqlite3_context pCx, 
+          sqlite3_context pCx,
           sqlite3_value argv[]
       ){
         if( argv.length!=0 ){
@@ -338,7 +337,7 @@ public class TesterFts5 {
 
         OutputPointer.Int32 piCol = new OutputPointer.Int32();
         OutputPointer.Int32 piOff = new OutputPointer.Int32();
-        String ret = new String();
+        String ret = "";
         int rc = SQLITE_OK;
 
         int nPhrase = ext.xPhraseCount(fCx);
@@ -350,7 +349,7 @@ public class TesterFts5 {
               rc==SQLITE_OK && piCol.get()>=0;
               ext.xPhraseNext(fCx, pIter, piCol, piOff)
           ){
-            if( !ret.equals("") ) ret += " ";
+            if( !ret.isEmpty() ) ret += " ";
             ret += "{"+ii+" "+piCol.get()+" "+piOff.get()+"}";
           }
         }
@@ -374,9 +373,9 @@ public class TesterFts5 {
     */
     fts5_extension_function fts5_pcolinst = new fts5_extension_function(){
       @Override public void call(
-          Fts5ExtensionApi ext, 
+          Fts5ExtensionApi ext,
           Fts5Context fCx,
-          sqlite3_context pCx, 
+          sqlite3_context pCx,
           sqlite3_value argv[]
       ){
         if( argv.length!=0 ){
@@ -384,7 +383,7 @@ public class TesterFts5 {
         }
 
         OutputPointer.Int32 piCol = new OutputPointer.Int32();
-        String ret = new String();
+        String ret = "";
         int rc = SQLITE_OK;
 
         int nPhrase = ext.xPhraseCount(fCx);
@@ -396,7 +395,7 @@ public class TesterFts5 {
               rc==SQLITE_OK && piCol.get()>=0;
               ext.xPhraseNextColumn(fCx, pIter, piCol)
           ){
-            if( !ret.equals("") ) ret += " ";
+            if( !ret.isEmpty() ) ret += " ";
             ret += "{"+ii+" "+piCol.get()+"}";
           }
         }
@@ -415,9 +414,9 @@ public class TesterFts5 {
     */
     fts5_extension_function fts5_rowcount = new fts5_extension_function(){
       @Override public void call(
-          Fts5ExtensionApi ext, 
+          Fts5ExtensionApi ext,
           Fts5Context fCx,
-          sqlite3_context pCx, 
+          sqlite3_context pCx,
           sqlite3_value argv[]
       ){
         if( argv.length!=0 ){
@@ -440,9 +439,9 @@ public class TesterFts5 {
     */
     fts5_extension_function fts5_phrasesize = new fts5_extension_function(){
       @Override public void call(
-          Fts5ExtensionApi ext, 
+          Fts5ExtensionApi ext,
           Fts5Context fCx,
-          sqlite3_context pCx, 
+          sqlite3_context pCx,
           sqlite3_value argv[]
       ){
         if( argv.length!=1 ){
@@ -464,9 +463,9 @@ public class TesterFts5 {
     */
     fts5_extension_function fts5_phrasehits = new fts5_extension_function(){
       @Override public void call(
-          Fts5ExtensionApi ext, 
+          Fts5ExtensionApi ext,
           Fts5Context fCx,
-          sqlite3_context pCx, 
+          sqlite3_context pCx,
           sqlite3_value argv[]
       ){
         if( argv.length!=1 ){
@@ -503,9 +502,9 @@ public class TesterFts5 {
     */
     fts5_extension_function fts5_tokenize = new fts5_extension_function(){
       @Override public void call(
-          Fts5ExtensionApi ext, 
+          Fts5ExtensionApi ext,
           Fts5Context fCx,
-          sqlite3_context pCx, 
+          sqlite3_context pCx,
           sqlite3_value argv[]
       ){
         if( argv.length!=1 ){
@@ -515,7 +514,7 @@ public class TesterFts5 {
         int rc = SQLITE_OK;
 
         class MyCallback implements XTokenizeCallback {
-          private List myList = new ArrayList();
+          private List myList = new ArrayList<>();
 
           public String getval() {
             return String.join("+", myList);
@@ -524,7 +523,7 @@ public class TesterFts5 {
           @Override
           public int call(int tFlags, byte[] txt, int iStart, int iEnd){
             try {
-              String str = new String(txt, "UTF-8");
+              String str = new String(txt, StandardCharsets.UTF_8);
               myList.add(str);
             } catch (Exception e) {
             }
diff --git a/ext/jni/src/org/sqlite/jni/fts5/fts5_extension_function.java b/ext/jni/src/org/sqlite/jni/fts5/fts5_extension_function.java
index 5e47633baa..6e98f64ff3 100644
--- a/ext/jni/src/org/sqlite/jni/fts5/fts5_extension_function.java
+++ b/ext/jni/src/org/sqlite/jni/fts5/fts5_extension_function.java
@@ -39,7 +39,11 @@ public interface fts5_extension_function {
   */
   void xDestroy();
 
-  public static abstract class Abstract implements fts5_extension_function {
+  /**
+     A base implementation of fts5_extension_function() which has a
+     no-op xDestroy() method.
+  */
+  abstract class Abstract implements fts5_extension_function {
     @Override public abstract void call(Fts5ExtensionApi ext, Fts5Context fCx,
                                         sqlite3_context pCx, sqlite3_value argv[]);
     @Override public void xDestroy(){}
diff --git a/ext/jni/src/org/sqlite/jni/test-script-interpreter.md b/ext/jni/src/org/sqlite/jni/test-script-interpreter.md
index c10122349e..cc7b7e7f9a 100644
--- a/ext/jni/src/org/sqlite/jni/test-script-interpreter.md
+++ b/ext/jni/src/org/sqlite/jni/test-script-interpreter.md
@@ -4,7 +4,7 @@
 
 The purpose of the Test Script Interpreter is to read and interpret
 script files that contain SQL commands and desired results.  The
-interpreter will check results and report any discrepencies found.
+interpreter will check results and report any discrepancies found.
 
 The test script files are ASCII text files.  The filename always ends with
 ".test".  Each script is evaluated independently; context does not carry
@@ -160,7 +160,7 @@ the result buffer.  This distinction does not matter for the --result
 command itself, but it is important for related commands like --glob
 and --notglob.  Sometimes test cases will contains a bunch of SQL
 followed by multiple --glob and/or --notglob statements.  All of the
-globs should be evaluated agains the result buffer, but the SQL should
+globs should be evaluated against the result buffer, but the SQL should
 only be run once.  This is accomplished by resetting the input buffer
 but not the result buffer.
 
diff --git a/ext/jni/src/org/sqlite/jni/wrapper1/ScalarFunction.java b/ext/jni/src/org/sqlite/jni/wrapper1/ScalarFunction.java
index 067a6983eb..c616ae7393 100644
--- a/ext/jni/src/org/sqlite/jni/wrapper1/ScalarFunction.java
+++ b/ext/jni/src/org/sqlite/jni/wrapper1/ScalarFunction.java
@@ -12,10 +12,6 @@
 ** This file is part of the wrapper1 interface for sqlite3.
 */
 package org.sqlite.jni.wrapper1;
-import org.sqlite.jni.capi.CApi;
-import org.sqlite.jni.annotation.*;
-import org.sqlite.jni.capi.sqlite3_context;
-import org.sqlite.jni.capi.sqlite3_value;
 
 /**
    The SqlFunction type for scalar SQL functions.
diff --git a/ext/jni/src/org/sqlite/jni/wrapper1/SqlFunction.java b/ext/jni/src/org/sqlite/jni/wrapper1/SqlFunction.java
index a700dd7779..bb0fd0ccd4 100644
--- a/ext/jni/src/org/sqlite/jni/wrapper1/SqlFunction.java
+++ b/ext/jni/src/org/sqlite/jni/wrapper1/SqlFunction.java
@@ -22,13 +22,13 @@ import org.sqlite.jni.capi.sqlite3_value;
 */
 public interface SqlFunction  {
 
-  public static final int DETERMINISTIC = CApi.SQLITE_DETERMINISTIC;
-  public static final int INNOCUOUS = CApi.SQLITE_INNOCUOUS;
-  public static final int DIRECTONLY = CApi.SQLITE_DIRECTONLY;
-  public static final int SUBTYPE = CApi.SQLITE_SUBTYPE;
-  public static final int RESULT_SUBTYPE = CApi.SQLITE_RESULT_SUBTYPE;
-  public static final int UTF8 = CApi.SQLITE_UTF8;
-  public static final int UTF16 = CApi.SQLITE_UTF16;
+  int DETERMINISTIC = CApi.SQLITE_DETERMINISTIC;
+  int INNOCUOUS = CApi.SQLITE_INNOCUOUS;
+  int DIRECTONLY = CApi.SQLITE_DIRECTONLY;
+  int SUBTYPE = CApi.SQLITE_SUBTYPE;
+  int RESULT_SUBTYPE = CApi.SQLITE_RESULT_SUBTYPE;
+  int UTF8 = CApi.SQLITE_UTF8;
+  int UTF16 = CApi.SQLITE_UTF16;
 
   /**
      The Arguments type is an abstraction on top of the lower-level
@@ -36,7 +36,7 @@ public interface SqlFunction  {
      of the lower-level interface, insofar as possible without "leaking"
      those types into this API.
   */
-  public final static class Arguments implements Iterable{
+  final class Arguments implements Iterable{
     private final sqlite3_context cx;
     private final sqlite3_value args[];
     public final int length;
@@ -207,7 +207,7 @@ public interface SqlFunction  {
      Internal-use adapter for wrapping this package's ScalarFunction
      for use with the org.sqlite.jni.capi.ScalarFunction interface.
   */
-  static final class ScalarAdapter extends org.sqlite.jni.capi.ScalarFunction {
+  final class ScalarAdapter extends org.sqlite.jni.capi.ScalarFunction {
     private final ScalarFunction impl;
     ScalarAdapter(ScalarFunction impl){
       this.impl = impl;
@@ -234,8 +234,8 @@ public interface SqlFunction  {
      Internal-use adapter for wrapping this package's AggregateFunction
      for use with the org.sqlite.jni.capi.AggregateFunction interface.
   */
-  static /*cannot be final without duplicating the whole body in WindowAdapter*/
   class AggregateAdapter extends org.sqlite.jni.capi.AggregateFunction {
+  /*cannot be final without duplicating the whole body in WindowAdapter*/
     private final AggregateFunction impl;
     AggregateAdapter(AggregateFunction impl){
       this.impl = impl;
@@ -277,7 +277,7 @@ public interface SqlFunction  {
      Internal-use adapter for wrapping this package's WindowFunction
      for use with the org.sqlite.jni.capi.WindowFunction interface.
   */
-  static final class WindowAdapter extends AggregateAdapter {
+  final class WindowAdapter extends AggregateAdapter {
     private final WindowFunction impl;
     WindowAdapter(WindowFunction impl){
       super(impl);
diff --git a/ext/jni/src/org/sqlite/jni/wrapper1/Sqlite.java b/ext/jni/src/org/sqlite/jni/wrapper1/Sqlite.java
index 2855d4c25f..d259e0ce62 100644
--- a/ext/jni/src/org/sqlite/jni/wrapper1/Sqlite.java
+++ b/ext/jni/src/org/sqlite/jni/wrapper1/Sqlite.java
@@ -19,7 +19,6 @@ import org.sqlite.jni.capi.sqlite3_stmt;
 import org.sqlite.jni.capi.sqlite3_backup;
 import org.sqlite.jni.capi.sqlite3_blob;
 import org.sqlite.jni.capi.OutputPointer;
-import java.nio.ByteBuffer;
 
 /**
    This class represents a database connection, analog to the C-side
@@ -388,10 +387,10 @@ public final class Sqlite implements AutoCloseable  {
     return CApi.sqlite3_compileoption_used(optName);
   }
 
-  private static boolean hasNormalizeSql =
+  private static final boolean hasNormalizeSql =
     compileOptionUsed("ENABLE_NORMALIZE");
 
-  private static boolean hasSqlLog =
+  private static final boolean hasSqlLog =
     compileOptionUsed("ENABLE_SQLLOG");
 
   /**
@@ -450,7 +449,7 @@ public final class Sqlite implements AutoCloseable  {
     long current;
     /** The peak value for the requested status() or libStatus() metric. */
     long peak;
-  };
+  }
 
   /**
      As per sqlite3_status64(), but returns its current and high-water
@@ -696,7 +695,7 @@ public final class Sqlite implements AutoCloseable  {
     final org.sqlite.jni.capi.OutputPointer.Int32 oTail =
       new org.sqlite.jni.capi.OutputPointer.Int32();
     while( pos < sqlChunk.length ){
-      sqlite3_stmt stmt = null;
+      sqlite3_stmt stmt;
       if( pos>0 ){
         sqlChunk = java.util.Arrays.copyOfRange(sqlChunk, pos, sqlChunk.length);
       }
@@ -988,15 +987,15 @@ public final class Sqlite implements AutoCloseable  {
           }
         };
     checkRc( CApi.sqlite3_trace_v2(thisDb(), traceMask, tc) );
-  };
+  }
 
   /**
      Corresponds to the sqlite3_stmt class. Use Sqlite.prepare() to
      create new instances.
   */
   public static final class Stmt implements AutoCloseable {
-    private Sqlite _db = null;
-    private sqlite3_stmt stmt = null;
+    private Sqlite _db;
+    private sqlite3_stmt stmt;
 
     /** Only called by the prepare() factory functions. */
     Stmt(Sqlite db, sqlite3_stmt stmt){
@@ -1379,9 +1378,9 @@ public final class Sqlite implements AutoCloseable  {
      Sqlite.initBackup() to create new instances.
   */
   public static final class Backup implements AutoCloseable {
-    private sqlite3_backup b = null;
-    private Sqlite dbTo = null;
-    private Sqlite dbFrom = null;
+    private sqlite3_backup b;
+    private Sqlite dbTo;
+    private Sqlite dbFrom;
 
     Backup(Sqlite dbDest, String schemaDest,Sqlite dbSrc, String schemaSrc){
       this.dbTo = dbDest;
@@ -1491,7 +1490,7 @@ public final class Sqlite implements AutoCloseable  {
        Warning: the SQLite core has no mechanism for reporting errors
        from custom collations and its workflow does not accommodate
        propagation of exceptions from callbacks. Any exceptions thrown
-       from collations will be silently supressed and sorting results
+       from collations will be silently suppressed and sorting results
        will be unpredictable.
     */
     int call(byte[] lhs, byte[] rhs);
@@ -1506,7 +1505,7 @@ public final class Sqlite implements AutoCloseable  {
   */
   public void createCollation(String name, int encoding, Collation c){
     thisDb();
-    if( null==name || 0==name.length()){
+    if( null==name || name.isEmpty()){
       throw new IllegalArgumentException("Collation name may not be null or empty.");
     }
     if( null==c ){
@@ -1599,11 +1598,12 @@ public final class Sqlite implements AutoCloseable  {
   public void setBusyHandler( BusyHandler b ){
     org.sqlite.jni.capi.BusyHandlerCallback bhc = null;
     if( null!=b ){
-      bhc = new org.sqlite.jni.capi.BusyHandlerCallback(){
+      /*bhc = new org.sqlite.jni.capi.BusyHandlerCallback(){
           @Override public int call(int n){
             return b.call(n);
           }
-        };
+        };*/
+      bhc = b::call;
     }
     checkRc( CApi.sqlite3_busy_handler(thisDb(), bhc) );
   }
@@ -1781,9 +1781,10 @@ public final class Sqlite implements AutoCloseable  {
   public void setProgressHandler( int n, ProgressHandler p ){
     org.sqlite.jni.capi.ProgressHandlerCallback phc = null;
     if( null!=p ){
-      phc = new org.sqlite.jni.capi.ProgressHandlerCallback(){
+      /*phc = new org.sqlite.jni.capi.ProgressHandlerCallback(){
           @Override public int call(){ return p.call(); }
-        };
+          };*/
+      phc = p::call;
     }
     CApi.sqlite3_progress_handler( thisDb(), n, phc );
   }
@@ -1808,11 +1809,12 @@ public final class Sqlite implements AutoCloseable  {
   public void setAuthorizer( Authorizer a ) {
     org.sqlite.jni.capi.AuthorizerCallback ac = null;
     if( null!=a ){
-      ac = new org.sqlite.jni.capi.AuthorizerCallback(){
+      /*ac = new org.sqlite.jni.capi.AuthorizerCallback(){
           @Override public int call(int opId, String s1, String s2, String s3, String s4){
             return a.call(opId, s1, s2, s3, s4);
           }
-        };
+          };*/
+      ac = a::call;
     }
     checkRc( CApi.sqlite3_set_authorizer( thisDb(), ac ) );
   }
@@ -1932,11 +1934,12 @@ public final class Sqlite implements AutoCloseable  {
     final org.sqlite.jni.capi.ConfigLogCallback l =
       null==log
       ? null
-      : new org.sqlite.jni.capi.ConfigLogCallback() {
+      /*: new org.sqlite.jni.capi.ConfigLogCallback() {
           @Override public void call(int errCode, String msg){
             log.call(errCode, msg);
           }
-        };
+          };*/
+      : log::call;
       checkRcStatic(CApi.sqlite3_config(l));
   }
 
diff --git a/manifest b/manifest
index 8048857988..85661df252 100644
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C JNI:\spart\s1\sof\stypos\sand\sJava\sstyle\stweaks\ssuggested\sin\s[forum:99ac7961d82f57f3|forum\spost\s99ac7961d82f57f3].
-D 2025-04-14T11:31:10.823
+C JNI:\spart\s2\sof\stypos\sand\sJava\sstyle\stweaks\ssuggested\sin\s[forum:99ac7961d82f57f3|forum\spost\s99ac7961d82f57f3].
+D 2025-04-14T12:09:24.445
 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
@@ -290,7 +290,7 @@ F ext/jni/GNUmakefile 8a94e3a1953b88cf117fb2a5380480feada8b4f5316f02572cab425030
 F ext/jni/README.md e3fbd47c774683539b7fdc95a667eb9cd6e64d8510f3ee327e7fa0c61c8aa787
 F ext/jni/jar-dist.make 030aaa4ae71dd86e4ec5e7c1e6cd86f9dfa47c4592c070d2e35157e42498e1fa
 F ext/jni/src/c/sqlite3-jni.c 74c35473c1fb1756ee911468d5027e4f989eea6764dff429b1214f76d78c431d
-F ext/jni/src/c/sqlite3-jni.h cc5fc5cefe2d63f461a4bad90735b34be0d85e5fe6778ae7ba992fae4d223cdf
+F ext/jni/src/c/sqlite3-jni.h 913ab8e8fee432ae40f0e387c8231118d17053714703f5ded18202912a8a3fbf
 F ext/jni/src/org/sqlite/jni/annotation/Experimental.java 8603498634e41d0f7c70f661f64e05df64376562ea8f126829fd1e0cdd47e82b
 F ext/jni/src/org/sqlite/jni/annotation/NotNull.java be6cc3e8e114485822331630097cc0f816377e8503af2fc02f9305ff2b353917
 F ext/jni/src/org/sqlite/jni/annotation/Nullable.java 56e3dee1f3f703a545dfdeddc1c3d64d1581172b1ad01ffcae95c18547fafd90
@@ -317,13 +317,13 @@ F ext/jni/src/org/sqlite/jni/capi/RollbackHookCallback.java e172210a2080e851ebb6
 F ext/jni/src/org/sqlite/jni/capi/SQLFunction.java 0d1e9afc9ff8a2adb94a155b72385155fa3b8011a5cca0bb3c28468c7131c1a5
 F ext/jni/src/org/sqlite/jni/capi/SQLTester.java 828ad9e149885a5080be920b5edee11fc43d6603485529da256b19e3581b72cc
 F ext/jni/src/org/sqlite/jni/capi/ScalarFunction.java 93b9700fca4c68075ccab12fe0fbbc76c91cafc9f368e835b9bd7cd7732c8615
-F ext/jni/src/org/sqlite/jni/capi/TableColumnMetadata.java addf120e0e76e5be1ff2260daa7ce305ff9b5fafd64153a7a28e9d8f000a815f
-F ext/jni/src/org/sqlite/jni/capi/Tester1.java e5fa17301b7266c1cbe4bcce67788e08e45871c7c72c153d515abb37e501de0a
+F ext/jni/src/org/sqlite/jni/capi/TableColumnMetadata.java 9133bb7685901d2edf07801191284975e33b5583ce09dce1c05202ff91e7bb99
+F ext/jni/src/org/sqlite/jni/capi/Tester1.java 9f4f0041e30712b92a86ddb7e1faf956a0c89a7fb0d5daf88cbae9ec263d8453
 F ext/jni/src/org/sqlite/jni/capi/TraceV2Callback.java 0a25e117a0daae3394a77f24713e36d7b44c67d6e6d30e9e1d56a63442eef723
 F ext/jni/src/org/sqlite/jni/capi/UpdateHookCallback.java c8bdf7848e6599115d601bcc9427ff902cb33129b9be32870ac6808e04b6ae56
 F ext/jni/src/org/sqlite/jni/capi/ValueHolder.java 2ce069f3e007fdbbe1f4e507a5a407fc9679da31a0aa40985e6317ed4d5ec7b5
 F ext/jni/src/org/sqlite/jni/capi/WindowFunction.java caf4396f91b2567904cf94bc538a069fd62260d975bd037d15a02a890ed1ef9e
-F ext/jni/src/org/sqlite/jni/capi/XDestroyCallback.java f3abb8dd7381f53ebba909437090caf68200f06717b8a7d6aa96fa3e8133117d
+F ext/jni/src/org/sqlite/jni/capi/XDestroyCallback.java 9c8cc33995a3df385feaf476a8306d29dbab611ed4f55da736597357bde68620
 F ext/jni/src/org/sqlite/jni/capi/package-info.java 08ff986a65d2be9162442c82d28a65ce431d826f188520717c2ecb1484d0a50e
 F ext/jni/src/org/sqlite/jni/capi/sqlite3.java c6a5c555d163d76663534f2b2cce7cab15325b9852d0f58c6688a85e73ae52f0
 F ext/jni/src/org/sqlite/jni/capi/sqlite3_backup.java 6742b431cd4d77e8000c1f92ec66265a58414c86bf3b0b5fbcb1164e08477227
@@ -333,19 +333,19 @@ F ext/jni/src/org/sqlite/jni/capi/sqlite3_stmt.java 293b5fa7d5b5724c87de544654ac
 F ext/jni/src/org/sqlite/jni/capi/sqlite3_value.java e1d62a257c13504b46d39d5c21c49cf157ad73fda00cc5f34c931aa008c37049
 F ext/jni/src/org/sqlite/jni/fts5/Fts5.java e94681023785f1eff5399f0ddc82f46b035977d350f14838db659236ebdf6b41
 F ext/jni/src/org/sqlite/jni/fts5/Fts5Context.java 338637e6e5a2cc385d962b220f3c1f475cc371d12ae43d18ef27327b6e6225f7
-F ext/jni/src/org/sqlite/jni/fts5/Fts5ExtensionApi.java 7da0fbb5728f7c056a43e6407f13dd0c7c9c445221267786a109b987f5fc8a9d
+F ext/jni/src/org/sqlite/jni/fts5/Fts5ExtensionApi.java 2de029b3a12b16f779f4df6381c5f0cd358dd82bdaf99ec837504a1110b829f3
 F ext/jni/src/org/sqlite/jni/fts5/Fts5PhraseIter.java 28045042d593a1f1b9b80d54ec77cbf1d8a1bc95e442eceefa9a3a6f56600b0e
 F ext/jni/src/org/sqlite/jni/fts5/Fts5Tokenizer.java 3c8f677ffb85b8782f865d6fcbc16200b3375d0e3c29ed541a494fde3011bf49
-F ext/jni/src/org/sqlite/jni/fts5/TesterFts5.java 51e16bf9050af7cb246d17d6a19c001cfc916bf20f425c96625aaccaf74688e8
+F ext/jni/src/org/sqlite/jni/fts5/TesterFts5.java 793a5f6f2f581034dc3b503d5023b05e7e38558a80542148b82527dc2a7bf209
 F ext/jni/src/org/sqlite/jni/fts5/XTokenizeCallback.java 1efd1220ea328a32f2d2a1b16c735864159e929480f71daad4de9d5944839167
 F ext/jni/src/org/sqlite/jni/fts5/fts5_api.java a8e88c3783d21cec51b0748568a96653fead88f8f4953376178d9c7385b197ea
-F ext/jni/src/org/sqlite/jni/fts5/fts5_extension_function.java 9e2b954d210d572552b28aca523b272fae14bd41e318921b22f65b728d5bf978
+F ext/jni/src/org/sqlite/jni/fts5/fts5_extension_function.java 1e721873c62df2eb79f45bbf55b8662625365885b02d1d51915f773de16a90e3
 F ext/jni/src/org/sqlite/jni/fts5/fts5_tokenizer.java 92bdaa3893bd684533004d64ade23d329843f809cd0d0f4f1a2856da6e6b4d90
-F ext/jni/src/org/sqlite/jni/test-script-interpreter.md 620754d59d97022198d0dcdd366b8c56dca07b080880a7618b33620cfd3d4a56
+F ext/jni/src/org/sqlite/jni/test-script-interpreter.md d7987b432870d23f7c72a7804d099fe5ccfb945f519ac90a33e189297fbbfa1c
 F ext/jni/src/org/sqlite/jni/wrapper1/AggregateFunction.java d5c108b02afd3c63c9e5e53f71f85273c1bfdc461ae526e0a0bb2b25e4df6483
-F ext/jni/src/org/sqlite/jni/wrapper1/ScalarFunction.java 43c43adfb7866098aadaaca1620028a6ec82d5193149970019b1cce9eb59fb03
-F ext/jni/src/org/sqlite/jni/wrapper1/SqlFunction.java b424faf3bbcc9ae13f72ca87ca9bc9d34c6f0dd797f1f4ddf854a00e8d6b2241
-F ext/jni/src/org/sqlite/jni/wrapper1/Sqlite.java 1d6fbdb7bd875e861f0c52ae131c087ff09804face19587c3971ac72af626196
+F ext/jni/src/org/sqlite/jni/wrapper1/ScalarFunction.java 326ffba29aab836a6ea189703c3d7fb573305fd93da2d14b0f9e9dcf314c8290
+F ext/jni/src/org/sqlite/jni/wrapper1/SqlFunction.java e920f7a031e04975579240d4a07ac5e4a9d0f8de31b0aa7a4be753c98ae596c9
+F ext/jni/src/org/sqlite/jni/wrapper1/Sqlite.java c82bc00c1988f86246a89f721d3c41f0d952f33f934aa6677ec87f7ca42519a0
 F ext/jni/src/org/sqlite/jni/wrapper1/SqliteException.java 982538ddb4c0719ef87dfa664cd137b09890b546029a7477810bd64d4c47ee35
 F ext/jni/src/org/sqlite/jni/wrapper1/Tester2.java ce45f2ec85facbb73690096547ed166e7be82299e3d92eaa206f82b60a6ec969
 F ext/jni/src/org/sqlite/jni/wrapper1/ValueHolder.java a84e90c43724a69c2ecebd601bc8e5139f869b7d08cb705c77ef757dacdd0593
@@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350
 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P d6889f6b9aa70bc90f71883b3e7ba359162477afe5048dacb7dfa11733ad1e5a
-R 4fa41ddd47fcd20793ebec54c99f81c8
+P ab00af4e48501b0413650df31147866a805c34b7ecf506d1e208bc3ae6c2ef28
+R eccaa5625295ba78582e7b3d93247920
 U stephan
-Z d553daca30b625c1ccad3f32966884c5
+Z 952342e6ebff8b006b1487bc23287d99
 # Remove this line to create a well-formed Fossil manifest.
diff --git a/manifest.uuid b/manifest.uuid
index 6f2c65c185..b2c27defa2 100644
--- a/manifest.uuid
+++ b/manifest.uuid
@@ -1 +1 @@
-ab00af4e48501b0413650df31147866a805c34b7ecf506d1e208bc3ae6c2ef28
+5e6e9aee5b43e6ae98e78293a0da30e82ad18c3c9c03fc6298240233ddadb2a2

From c801f8954e8d5f61585fee3de472b2b259444150 Mon Sep 17 00:00:00 2001
From: stephan 
Date: Mon, 14 Apr 2025 13:31:18 +0000
Subject: [PATCH 100/120] JNI: part 3 (of 3) of typos and Java style tweaks
 suggested in [forum:99ac7961d82f57f3|forum post 99ac7961d82f57f3]. Tested
 with jdk v8 and v21.

FossilOrigin-Name: 914d4c9d6c26536ca14be80eee6c54af4311eac6bf88b327738075275f4b77da
---
 ext/jni/src/c/sqlite3-jni.h                   |  2 +-
 .../src/org/sqlite/jni/capi/SQLTester.java    | 38 +++++++++----------
 .../src/org/sqlite/jni/wrapper1/Tester2.java  | 17 ++++-----
 manifest                                      | 16 ++++----
 manifest.uuid                                 |  2 +-
 5 files changed, 37 insertions(+), 38 deletions(-)

diff --git a/ext/jni/src/c/sqlite3-jni.h b/ext/jni/src/c/sqlite3-jni.h
index 082a202122..6f93bf8ab7 100644
--- a/ext/jni/src/c/sqlite3-jni.h
+++ b/ext/jni/src/c/sqlite3-jni.h
@@ -1342,7 +1342,7 @@ JNIEXPORT jint JNICALL Java_org_sqlite_jni_capi_CApi_sqlite3_1data_1count
  * Method:    sqlite3_db_config
  * Signature: (Lorg/sqlite/jni/capi/sqlite3;IILorg/sqlite/jni/capi/OutputPointer/Int32;)I
  */
-JNIEXPORT jint JNICALL Java_org_sqlite_jni_capi_CApi_sqlite3_1db_1config__Lorg_sqlite_jni_capi_sqlite3_2IILorg_sqlite_jni_capi_OutputPointer_Int32_2
+JNIEXPORT jint JNICALL Java_org_sqlite_jni_capi_CApi_sqlite3_1db_1config__Lorg_sqlite_jni_capi_sqlite3_2IILorg_sqlite_jni_capi_OutputPointer_00024Int32_2
   (JNIEnv *, jclass, jobject, jint, jint, jobject);
 
 /*
diff --git a/ext/jni/src/org/sqlite/jni/capi/SQLTester.java b/ext/jni/src/org/sqlite/jni/capi/SQLTester.java
index 5edd3aedb7..bc2e75f8be 100644
--- a/ext/jni/src/org/sqlite/jni/capi/SQLTester.java
+++ b/ext/jni/src/org/sqlite/jni/capi/SQLTester.java
@@ -333,7 +333,7 @@ public class SQLTester {
     return this;
   }
 
-  sqlite3 setCurrentDb(int n) throws Exception{
+  sqlite3 setCurrentDb(int n){
     affirmDbId(n);
     iCurrentDb = n;
     return this.aDb[n];
@@ -341,7 +341,7 @@ public class SQLTester {
 
   sqlite3 getCurrentDb(){ return aDb[iCurrentDb]; }
 
-  sqlite3 getDbById(int id) throws Exception{
+  sqlite3 getDbById(int id){
     return affirmDbId(id).aDb[id];
   }
 
@@ -362,7 +362,7 @@ public class SQLTester {
     }
   }
 
-  sqlite3 openDb(String name, boolean createIfNeeded) throws DbException {
+  sqlite3 openDb(String name, boolean createIfNeeded) {
     closeDb();
     int flags = SQLITE_OPEN_READWRITE;
     if( createIfNeeded ) flags |= SQLITE_OPEN_CREATE;
@@ -754,7 +754,7 @@ abstract class Command {
      fall in the inclusive range (min,max) then this function throws. Use
      a max value of -1 to mean unlimited.
   */
-  protected final void argcCheck(TestScript ts, String[] argv, int min, int max) throws Exception{
+  protected final void argcCheck(TestScript ts, String[] argv, int min, int max){
     int argc = argv.length-1;
     if(argc=0 && argc>max)){
       if( min==max ){
@@ -770,14 +770,14 @@ abstract class Command {
   /**
      Equivalent to argcCheck(argv,argc,argc).
   */
-  protected final void argcCheck(TestScript ts, String[] argv, int argc) throws Exception{
+  protected final void argcCheck(TestScript ts, String[] argv, int argc){
     argcCheck(ts, argv, argc, argc);
   }
 }
 
 //! --close command
 class CloseDbCommand extends Command {
-  public void process(SQLTester t, TestScript ts, String[] argv) throws Exception{
+  public void process(SQLTester t, TestScript ts, String[] argv){
     argcCheck(ts,argv,0,1);
     int id;
     if(argv.length>1){
@@ -800,7 +800,7 @@ class CloseDbCommand extends Command {
 class ColumnNamesCommand extends Command {
   public void process(
     SQLTester st, TestScript ts, String[] argv
-  ) throws Exception{
+  ){
     argcCheck(ts,argv,1);
     st.outputColumnNames( Integer.parseInt(argv[1])!=0 );
   }
@@ -808,7 +808,7 @@ class ColumnNamesCommand extends Command {
 
 //! --db command
 class DbCommand extends Command {
-  public void process(SQLTester t, TestScript ts, String[] argv) throws Exception{
+  public void process(SQLTester t, TestScript ts, String[] argv){
     argcCheck(ts,argv,1);
     t.setCurrentDb( Integer.parseInt(argv[1]) );
   }
@@ -820,7 +820,7 @@ class GlobCommand extends Command {
   public GlobCommand(){}
   protected GlobCommand(boolean negate){ this.negate = negate; }
 
-  public void process(SQLTester t, TestScript ts, String[] argv) throws Exception{
+  public void process(SQLTester t, TestScript ts, String[] argv){
     argcCheck(ts,argv,1,-1);
     t.incrementTestCounter();
     final String sql = t.takeInputBuffer();
@@ -850,7 +850,7 @@ class JsonBlockCommand extends TableResultCommand {
 //! --new command
 class NewDbCommand extends OpenDbCommand {
   public NewDbCommand(){ super(true); }
-  public void process(SQLTester t, TestScript ts, String[] argv) throws Exception{
+  public void process(SQLTester t, TestScript ts, String[] argv){
     if(argv.length>1){
       Util.unlink(argv[1]);
     }
@@ -866,7 +866,7 @@ class NoopCommand extends Command {
     this.verbose = verbose;
   }
   public NoopCommand(){}
-  public void process(SQLTester t, TestScript ts, String[] argv) throws Exception{
+  public void process(SQLTester t, TestScript ts, String[] argv){
     if( this.verbose ){
       t.outln("Skipping unhandled command: "+argv[0]);
     }
@@ -884,7 +884,7 @@ class NotGlobCommand extends GlobCommand {
 class NullCommand extends Command {
   public void process(
     SQLTester st, TestScript ts, String[] argv
-  ) throws Exception{
+  ){
     argcCheck(ts,argv,1);
     st.setNullValue( argv[1] );
   }
@@ -895,7 +895,7 @@ class OpenDbCommand extends Command {
   private boolean createIfNeeded = false;
   public OpenDbCommand(){}
   protected OpenDbCommand(boolean c){createIfNeeded = c;}
-  public void process(SQLTester t, TestScript ts, String[] argv) throws Exception{
+  public void process(SQLTester t, TestScript ts, String[] argv){
     argcCheck(ts,argv,1);
     t.openDb(argv[1], createIfNeeded);
   }
@@ -905,7 +905,7 @@ class OpenDbCommand extends Command {
 class PrintCommand extends Command {
   public void process(
     SQLTester st, TestScript ts, String[] argv
-  ) throws Exception{
+  ){
     st.out(ts.getOutputPrefix(),": ");
     if( 1==argv.length ){
       st.out( st.getInputText() );
@@ -920,7 +920,7 @@ class ResultCommand extends Command {
   private final ResultBufferMode bufferMode;
   protected ResultCommand(ResultBufferMode bm){ bufferMode = bm; }
   public ResultCommand(){ this(ResultBufferMode.ESCAPED); }
-  public void process(SQLTester t, TestScript ts, String[] argv) throws Exception{
+  public void process(SQLTester t, TestScript ts, String[] argv){
     argcCheck(ts,argv,0,-1);
     t.incrementTestCounter();
     final String sql = t.takeInputBuffer();
@@ -938,7 +938,7 @@ class ResultCommand extends Command {
 
 //! --run command
 class RunCommand extends Command {
-  public void process(SQLTester t, TestScript ts, String[] argv) throws Exception{
+  public void process(SQLTester t, TestScript ts, String[] argv){
     argcCheck(ts,argv,0,1);
     final sqlite3 db = (1==argv.length)
       ? t.getCurrentDb() : t.getDbById( Integer.parseInt(argv[1]) );
@@ -958,7 +958,7 @@ class TableResultCommand extends Command {
   private final boolean jsonMode;
   protected TableResultCommand(boolean jsonMode){ this.jsonMode = jsonMode; }
   public TableResultCommand(){ this(false); }
-  public void process(SQLTester t, TestScript ts, String[] argv) throws Exception{
+  public void process(SQLTester t, TestScript ts, String[] argv){
     argcCheck(ts,argv,0);
     t.incrementTestCounter();
     String body = ts.fetchCommandBody(t);
@@ -1001,7 +1001,7 @@ class TableResultCommand extends Command {
 
 //! --testcase command
 class TestCaseCommand extends Command {
-  public void process(SQLTester t, TestScript ts, String[] argv) throws Exception{
+  public void process(SQLTester t, TestScript ts, String[] argv){
     argcCheck(ts,argv,1);
     ts.setTestCaseName(argv[1]);
     t.clearResultBuffer();
@@ -1011,7 +1011,7 @@ class TestCaseCommand extends Command {
 
 //! --verbosity command
 class VerbosityCommand extends Command {
-  public void process(SQLTester t, TestScript ts, String[] argv) throws Exception{
+  public void process(SQLTester t, TestScript ts, String[] argv){
     argcCheck(ts,argv,1);
     ts.setVerbosity( Integer.parseInt(argv[1]) );
   }
diff --git a/ext/jni/src/org/sqlite/jni/wrapper1/Tester2.java b/ext/jni/src/org/sqlite/jni/wrapper1/Tester2.java
index 5ac41323cb..528e1f61c6 100644
--- a/ext/jni/src/org/sqlite/jni/wrapper1/Tester2.java
+++ b/ext/jni/src/org/sqlite/jni/wrapper1/Tester2.java
@@ -13,7 +13,6 @@
 */
 package org.sqlite.jni.wrapper1;
 import java.nio.charset.StandardCharsets;
-import java.util.Arrays;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.ExecutorService;
@@ -53,14 +52,14 @@ public class Tester2 implements Runnable {
   //! List of test*() methods to run.
   private static List testMethods = null;
   //! List of exceptions collected by run()
-  private static List listErrors = new ArrayList<>();
+  private static final List listErrors = new ArrayList<>();
   private static final class Metrics {
     //! Number of times createNewDb() (or equivalent) is invoked.
     volatile int dbOpen = 0;
   }
 
   //! Instance ID.
-  private Integer tId;
+  private final Integer tId;
 
   Tester2(Integer id){
     tId = id;
@@ -70,7 +69,7 @@ public class Tester2 implements Runnable {
 
   public static synchronized void outln(){
     if( !quietMode ){
-      System.out.println("");
+      System.out.println();
     }
   }
 
@@ -547,7 +546,7 @@ public class Tester2 implements Runnable {
       err = e;
     }
     affirm( err!=null );
-    affirm( err.getMessage().indexOf(toss.value)>=0 );
+    affirm( err.getMessage().contains(toss.value) );
     toss.value = null;
 
     val.value = 0;
@@ -616,7 +615,7 @@ public class Tester2 implements Runnable {
     final Sqlite db = openDb();
     execSql(db, "CREATE TABLE t(a); INSERT INTO t(a) VALUES('a'),('b'),('c')");
     final Sqlite.Collation myCollation = new Sqlite.Collation() {
-        private String myState =
+        private final String myState =
           "this is local state. There is much like it, but this is mine.";
         @Override
         // Reverse-sorts its inputs...
@@ -1038,9 +1037,9 @@ public class Tester2 implements Runnable {
      -v: emit some developer-mode info at the end.
   */
   public static void main(String[] args) throws Exception {
-    Integer nThread = 1;
+    int nThread = 1;
+    int nRepeat = 1;
     boolean doSomethingForDev = false;
-    Integer nRepeat = 1;
     boolean forceFail = false;
     boolean sqlLog = false;
     boolean configLog = false;
@@ -1097,7 +1096,7 @@ public class Tester2 implements Runnable {
       Sqlite.libConfigLog( new Sqlite.ConfigLog() {
           @Override public void call(int code, String msg){
             outln("ConfigLog: ",Sqlite.errstr(code),": ", msg);
-          };
+          }
         }
       );
     }
diff --git a/manifest b/manifest
index 85661df252..5b3894978a 100644
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C JNI:\spart\s2\sof\stypos\sand\sJava\sstyle\stweaks\ssuggested\sin\s[forum:99ac7961d82f57f3|forum\spost\s99ac7961d82f57f3].
-D 2025-04-14T12:09:24.445
+C JNI:\spart\s3\s(of\s3)\sof\stypos\sand\sJava\sstyle\stweaks\ssuggested\sin\s[forum:99ac7961d82f57f3|forum\spost\s99ac7961d82f57f3].\sTested\swith\sjdk\sv8\sand\sv21.
+D 2025-04-14T13:31:18.787
 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
@@ -290,7 +290,7 @@ F ext/jni/GNUmakefile 8a94e3a1953b88cf117fb2a5380480feada8b4f5316f02572cab425030
 F ext/jni/README.md e3fbd47c774683539b7fdc95a667eb9cd6e64d8510f3ee327e7fa0c61c8aa787
 F ext/jni/jar-dist.make 030aaa4ae71dd86e4ec5e7c1e6cd86f9dfa47c4592c070d2e35157e42498e1fa
 F ext/jni/src/c/sqlite3-jni.c 74c35473c1fb1756ee911468d5027e4f989eea6764dff429b1214f76d78c431d
-F ext/jni/src/c/sqlite3-jni.h 913ab8e8fee432ae40f0e387c8231118d17053714703f5ded18202912a8a3fbf
+F ext/jni/src/c/sqlite3-jni.h cc5fc5cefe2d63f461a4bad90735b34be0d85e5fe6778ae7ba992fae4d223cdf
 F ext/jni/src/org/sqlite/jni/annotation/Experimental.java 8603498634e41d0f7c70f661f64e05df64376562ea8f126829fd1e0cdd47e82b
 F ext/jni/src/org/sqlite/jni/annotation/NotNull.java be6cc3e8e114485822331630097cc0f816377e8503af2fc02f9305ff2b353917
 F ext/jni/src/org/sqlite/jni/annotation/Nullable.java 56e3dee1f3f703a545dfdeddc1c3d64d1581172b1ad01ffcae95c18547fafd90
@@ -315,7 +315,7 @@ F ext/jni/src/org/sqlite/jni/capi/ProgressHandlerCallback.java 01bc0c238eed2d5f9
 F ext/jni/src/org/sqlite/jni/capi/ResultCode.java 8141171f1bcf9f46eef303b9d3c5dc2537a25ad1628f3638398d8a60cacefa7f
 F ext/jni/src/org/sqlite/jni/capi/RollbackHookCallback.java e172210a2080e851ebb694c70e9f0bf89284237795e38710a7f5f1b61e3f6787
 F ext/jni/src/org/sqlite/jni/capi/SQLFunction.java 0d1e9afc9ff8a2adb94a155b72385155fa3b8011a5cca0bb3c28468c7131c1a5
-F ext/jni/src/org/sqlite/jni/capi/SQLTester.java 828ad9e149885a5080be920b5edee11fc43d6603485529da256b19e3581b72cc
+F ext/jni/src/org/sqlite/jni/capi/SQLTester.java 3c0babc067d8560627a9ed1b07979f9d4393464e2282c2fca4832052e982c7bc
 F ext/jni/src/org/sqlite/jni/capi/ScalarFunction.java 93b9700fca4c68075ccab12fe0fbbc76c91cafc9f368e835b9bd7cd7732c8615
 F ext/jni/src/org/sqlite/jni/capi/TableColumnMetadata.java 9133bb7685901d2edf07801191284975e33b5583ce09dce1c05202ff91e7bb99
 F ext/jni/src/org/sqlite/jni/capi/Tester1.java 9f4f0041e30712b92a86ddb7e1faf956a0c89a7fb0d5daf88cbae9ec263d8453
@@ -347,7 +347,7 @@ F ext/jni/src/org/sqlite/jni/wrapper1/ScalarFunction.java 326ffba29aab836a6ea189
 F ext/jni/src/org/sqlite/jni/wrapper1/SqlFunction.java e920f7a031e04975579240d4a07ac5e4a9d0f8de31b0aa7a4be753c98ae596c9
 F ext/jni/src/org/sqlite/jni/wrapper1/Sqlite.java c82bc00c1988f86246a89f721d3c41f0d952f33f934aa6677ec87f7ca42519a0
 F ext/jni/src/org/sqlite/jni/wrapper1/SqliteException.java 982538ddb4c0719ef87dfa664cd137b09890b546029a7477810bd64d4c47ee35
-F ext/jni/src/org/sqlite/jni/wrapper1/Tester2.java ce45f2ec85facbb73690096547ed166e7be82299e3d92eaa206f82b60a6ec969
+F ext/jni/src/org/sqlite/jni/wrapper1/Tester2.java 08f92d52be2cec28a7b4555479cc54b7ebeeb94985256144eeb727154ec3f85b
 F ext/jni/src/org/sqlite/jni/wrapper1/ValueHolder.java a84e90c43724a69c2ecebd601bc8e5139f869b7d08cb705c77ef757dacdd0593
 F ext/jni/src/org/sqlite/jni/wrapper1/WindowFunction.java c7d1452f9ff26175b3c19bbf273116cc2846610af68e01756d755f037fe7319f
 F ext/jni/src/tests/000-000-sanity.test c3427a0e0ac84d7cbe4c95fdc1cd4b61f9ddcf43443408f3000139478c4dc745
@@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350
 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P ab00af4e48501b0413650df31147866a805c34b7ecf506d1e208bc3ae6c2ef28
-R eccaa5625295ba78582e7b3d93247920
+P 5e6e9aee5b43e6ae98e78293a0da30e82ad18c3c9c03fc6298240233ddadb2a2
+R 78446db09ad20d0a658adecb52899e38
 U stephan
-Z 952342e6ebff8b006b1487bc23287d99
+Z 221b4fcdf4c37393a995132b1f7d661d
 # Remove this line to create a well-formed Fossil manifest.
diff --git a/manifest.uuid b/manifest.uuid
index b2c27defa2..300d1235d2 100644
--- a/manifest.uuid
+++ b/manifest.uuid
@@ -1 +1 @@
-5e6e9aee5b43e6ae98e78293a0da30e82ad18c3c9c03fc6298240233ddadb2a2
+914d4c9d6c26536ca14be80eee6c54af4311eac6bf88b327738075275f4b77da

From 483e1181c5a1e3f62d24161bcad34a6d8fb797fe Mon Sep 17 00:00:00 2001
From: drh <>
Date: Mon, 14 Apr 2025 19:43:30 +0000
Subject: [PATCH 101/120] Improved estimate on the number of output rows in a
 recursive common table expression that uses the UNION operator.  Follow-up to
 [f911f1c4977fbcae] and it's output row estimate changes associated with
 DISTINCT queries.

FossilOrigin-Name: 92513f6bce7ecc778e78af3a77bc66ff65585fffa2e3138f8acb9e617121eeb0
---
 manifest           | 18 +++++++++---------
 manifest.uuid      |  2 +-
 src/select.c       |  6 ++++++
 src/where.c        |  3 ++-
 test/subquery.test | 38 ++++++++++++++++++++++++++++++++++++++
 5 files changed, 56 insertions(+), 11 deletions(-)

diff --git a/manifest b/manifest
index 5b3894978a..8dba5dbc75 100644
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C JNI:\spart\s3\s(of\s3)\sof\stypos\sand\sJava\sstyle\stweaks\ssuggested\sin\s[forum:99ac7961d82f57f3|forum\spost\s99ac7961d82f57f3].\sTested\swith\sjdk\sv8\sand\sv21.
-D 2025-04-14T13:31:18.787
+C Improved\sestimate\son\sthe\snumber\sof\soutput\srows\sin\sa\srecursive\scommon\stable\sexpression\nthat\suses\sthe\sUNION\soperator.\s\sFollow-up\sto\s[f911f1c4977fbcae]\sand\sit's\soutput\srow\nestimate\schanges\sassociated\swith\sDISTINCT\squeries.
+D 2025-04-14T19:43:30.136
 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
@@ -785,7 +785,7 @@ F src/printf.c 33fc0d7643c848a098afdcb6e1db6de12379d47084b1cd0912cfce1d09345e44
 F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c
 F src/resolve.c 20e1fbe8f840ffc0cd835e33f68a802a22e34faa918d7a269f3de242fda02f99
 F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97
-F src/select.c 716a49f7f6348771442b8dae47863bad8ddbd8d5ae9a0d82d0eeb1852aea1cf7
+F src/select.c 1a5956231f7c57571288eaad61e5c37aaf0f3acb5c8a5ea0b896938166b62fa2
 F src/shell.c.in 1e8b9bf369e80cdf9b029142e773038bc12bd38aea1c56df4af6bf7b46cae955
 F src/sqlite.h.in 22882ddd3a70751aa8864c81993ee4562ed54c2c508b6270f75e223ffee38e1b
 F src/sqlite3.rc 015537e6ac1eec6c7050e17b616c2ffe6f70fca241835a84a4f0d5937383c479
@@ -869,7 +869,7 @@ F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9
 F src/wal.c bcf40795a09b699ad7e42624dd6282b13335164fbabcd5a98a717758cebef451
 F src/wal.h ba252daaa94f889f4b2c17c027e823d9be47ce39da1d3799886bbd51f0490452
 F src/walker.c d5006d6b005e4ea7302ad390957a8d41ed83faa177e412f89bc5600a7462a014
-F src/where.c e80177e452b4e436abc6ece0cb0249631000434f2a7425cc1df709015fce74ad
+F src/where.c 85690096a475ace0a2f5154be5341e3367f4ad8fda349a213702d2aff2d41d88
 F src/whereInt.h ecdbfb5551cf394f04ec7f0bc7ad963146d80eee3071405ac29aa84950128b8e
 F src/wherecode.c 6a3749575bcd02c7243ed89bde8a222525a60b56ae12ab78d997d64de346465c
 F src/whereexpr.c 2415c8eee5ff89a8b709d7d83d71c1ff986cd720d0520057e1d8a5371339012a
@@ -1705,7 +1705,7 @@ F test/stmtvtab1.test 6873dfb24f8e79cbb5b799b95c2e4349060eb7a3b811982749a84b3594
 F test/strict1.test 4d2b492152b984fd7e8196d23eb88e2ccb0ef9e46ca2f96c2ce7147ceef9d168
 F test/strict2.test b22c7a98b5000aef937f1990776497f0e979b1a23bc4f63e2d53b00e59b20070
 F test/subjournal.test 8d4e2572c0ee9a15549f0d8e40863161295107e52f07a3e8012a2e1fdd093c49
-F test/subquery.test 903abf41049f8404256f7be24b3151328304a5b25162e17ab0079460237382fc
+F test/subquery.test 23087f9b1c15ab9cc5231d04946bdebc51db527c95eb9d7434a2222127e17a84
 F test/subquery2.test 5f06ec2dbce42a3f595ab1b73b146592f9ce001cd4ff023d887d643d3560c281
 F test/subselect.test 0966aa8e720224dbd6a5e769a3ec2a723e332303
 F test/substr.test a673e3763e247e9b5e497a6cacbaf3da2bd8ec8921c0677145c109f2e633f36b
@@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350
 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 5e6e9aee5b43e6ae98e78293a0da30e82ad18c3c9c03fc6298240233ddadb2a2
-R 78446db09ad20d0a658adecb52899e38
-U stephan
-Z 221b4fcdf4c37393a995132b1f7d661d
+P 914d4c9d6c26536ca14be80eee6c54af4311eac6bf88b327738075275f4b77da
+R fee16bedc2936fcf762a590910cd0015
+U drh
+Z cac2b67ac54b69b59bd81ffa4eaf41eb
 # Remove this line to create a well-formed Fossil manifest.
diff --git a/manifest.uuid b/manifest.uuid
index 300d1235d2..d4ba1305b2 100644
--- a/manifest.uuid
+++ b/manifest.uuid
@@ -1 +1 @@
-914d4c9d6c26536ca14be80eee6c54af4311eac6bf88b327738075275f4b77da
+92513f6bce7ecc778e78af3a77bc66ff65585fffa2e3138f8acb9e617121eeb0
diff --git a/src/select.c b/src/select.c
index 91690c3273..6e8ee58bc6 100644
--- a/src/select.c
+++ b/src/select.c
@@ -8119,6 +8119,12 @@ int sqlite3Select(
     if( pWInfo==0 ) goto select_end;
     if( sqlite3WhereOutputRowCount(pWInfo) < p->nSelectRow ){
       p->nSelectRow = sqlite3WhereOutputRowCount(pWInfo);
+      if( pDest->eDest<=SRT_DistQueue && pDest->eDest>=SRT_DistFifo ){
+        /* TUNING: For a UNION CTE, because UNION is implies DISTINCT,
+        ** reduce the estimated output row count by 8 (LogEst 30). 
+        ** Search for tag-20250414a to see other cases */
+        p->nSelectRow -= 30;
+      }
     }
     if( sDistinct.isTnct && sqlite3WhereIsDistinct(pWInfo) ){
       sDistinct.eTnctType = sqlite3WhereIsDistinct(pWInfo);
diff --git a/src/where.c b/src/where.c
index ed63203495..3320f68554 100644
--- a/src/where.c
+++ b/src/where.c
@@ -6934,7 +6934,8 @@ WhereInfo *sqlite3WhereBegin(
     }
 
     /* TUNING:  Assume that a DISTINCT clause on a subquery reduces
-    ** the output size by a factor of 8 (LogEst -30).
+    ** the output size by a factor of 8 (LogEst -30).  Search for
+    ** tag-20250414a to see other cases.
     */
     if( (pWInfo->wctrlFlags & WHERE_WANT_DISTINCT)!=0 ){
       WHERETRACE(0x0080,("nRowOut reduced from %d to %d due to DISTINCT\n",
diff --git a/test/subquery.test b/test/subquery.test
index 17061d4b60..898c8f7560 100644
--- a/test/subquery.test
+++ b/test/subquery.test
@@ -650,6 +650,44 @@ do_eqp_test subquery-10.2 {
 # |--SCAN v2
 # `--SEARCH t1 USING INDEX x12 (aa=?)
 #
+#---------------------------------------------------------------------------
+# Follow-up on 2025-04-14.  Performance issue found while working
+# on Fossil (Fossil check-in 2025-04-13T19:54).
+#
+do_execsql_test 10.3 {
+  CREATE TABLE blob(
+    rid INTEGER PRIMARY KEY,
+    size INT,
+    uuid TEXT
+  );
+  CREATE TABLE delta(
+    rid INTEGER PRIMARY KEY,
+    srcid INT
+  );
+  CREATE INDEX delta_i1 ON delta(srcid);
+}
+do_eqp_test subquery-10.4 {
+  WITH RECURSIVE deltasof(rid) AS (
+    SELECT rid FROM delta WHERE srcid=125020
+    UNION
+    SELECT delta.rid FROM deltasof, delta
+     WHERE delta.srcid=deltasof.rid)
+  SELECT deltasof.rid, blob.uuid FROM deltasof, blob
+   WHERE blob.rid=deltasof.rid;
+} {
+  QUERY PLAN
+  |--CO-ROUTINE deltasof
+  |  |--SETUP
+  |  |  `--SEARCH delta USING COVERING INDEX delta_i1 (srcid=?)
+  |  `--RECURSIVE STEP
+  |     |--SCAN deltasof
+  |     `--SEARCH delta USING COVERING INDEX delta_i1 (srcid=?)
+  |--SCAN deltasof
+  `--SEARCH blob USING INTEGER PRIMARY KEY (rowid=?)
+}
+# ^^^^^^^^^^^^^^^^^^
+# deltasof should be the outer loop and blob the inner loop
+# Prior to the fix, SQLite was doing it the other way around.
 
 #-----------------------------------------------------------------------------
 # 2024-04-25 Column affinities for columns of compound subqueries

From 5950eb8aa7b3510aa4896f87472b1f9e141777ab Mon Sep 17 00:00:00 2001
From: stephan 
Date: Mon, 14 Apr 2025 23:52:11 +0000
Subject: [PATCH 102/120] Update teaish to the latest upstream copy. Move some
 of its utility code into proj.tcl for reuse in the top-level configure bits.

FossilOrigin-Name: 921c5ea76925be911222ac5f2887b8a967ff47b1aa43e196231e6168a3f9cb88
---
 autoconf/tea/autosetup/core.tcl          | 503 ++++++++++++++++-------
 autoconf/tea/autosetup/feature-tests.tcl | 330 +++------------
 autoconf/tea/autosetup/tester.tcl        | 111 ++++-
 autoconf/tea/teaish.tcl                  |  15 +-
 autosetup/proj.tcl                       |  70 +++-
 manifest                                 |  22 +-
 manifest.uuid                            |   2 +-
 7 files changed, 577 insertions(+), 476 deletions(-)

diff --git a/autoconf/tea/autosetup/core.tcl b/autoconf/tea/autosetup/core.tcl
index 5cdfd6a14b..8b781793f2 100644
--- a/autoconf/tea/autosetup/core.tcl
+++ b/autoconf/tea/autosetup/core.tcl
@@ -29,12 +29,28 @@ if {"--help" ni $::argv} {
   proj-tweak-default-env-dirs
   msg-result "Source dir  = $::autosetup(srcdir)"
   msg-result "Build dir   = $::autosetup(builddir)"
-  msg-result "TEA-ish Version = [get-define TEAISH_VERSION]"
+  msg-result "TEA(ish) Version = [get-define TEAISH_VERSION]"
 }
 
-array set teaishConfig [proj-strip-hash-comments {
+#
+# API-internal settings and shared state.
+array set teaish__Config [proj-strip-hash-comments {
   # set to 1 to enable some internal debugging output
   debug-enabled 0
+  #
+  # 0    = default
+  # 0x01 = teaish__find-extension found input in TEAISH_DIR
+  # 0x02 = teaish__find-extension found input in srcdir
+  # 0x04 = teaish__find-extension found output file but no input
+  # 0x10 = teaish-pragma was called: use their pkgIndex.tcl
+  #
+  pkgindex-policy 0
+
+  #
+  # A list of lists of Autosetup [options]-format --flags definitions.
+  # Append to this using [teaish-append-options].
+  #
+  extra-options {}
 }]
 
 #
@@ -58,18 +74,20 @@ proc teaish-configure-core {} {
   #
   # "Declare" some defines for potential later use.
   #
-  foreach f {
-    TEAISH_MAKEFILE
-    TEAISH_MAKEFILE_IN
-    TEAISH_TCL
-    TEAISH_CFLAGS
-    TEAISH_LDFLAGS
-    TEAISH_SRC
-    TEAISH_DIST_FILES
-    TEAISH_PKGINIT_TCL
-    EXTRA_CFLAGS
+  foreach {f v} {
+    TEAISH_MAKEFILE ""
+    TEAISH_MAKEFILE_IN ""
+    TEAISH_TCL ""
+    TEAISH_CFLAGS ""
+    TEAISH_LDFLAGS ""
+    TEAISH_SRC ""
+    TEAISH_DIST_FILES ""
+    TEAISH_PKGINIT_TCL ""
+    TEAISH_PKGINDEX_TCL_IN ""
+    TEAISH_PKGINDEX_TCL ""
+    EXTRA_CFLAGS ""
   } {
-    define $f {}
+    define $f $v
   }
 
   set gotExt 0; # True if an extension config is found
@@ -78,18 +96,20 @@ proc teaish-configure-core {} {
   }
 
   if {$gotExt} {
-    proj-assert {[file exists [get-define TEAISH_TCL]]}
-    uplevel 1 {
-      source [get-define TEAISH_TCL]
-    }
-
+    set ttcl [get-define TEAISH_TCL]
+    proj-assert {[file exists $ttcl]} "Expecting to have found teaish.tcl by now"
+    uplevel 1 "source $ttcl"
     if {"" eq [get-define TEAISH_NAME ""]} {
-      proj-fatal "[get-define TEAISH_TCL] did not define TEAISH_NAME"
+      proj-fatal "$ttcl did not define TEAISH_NAME"
     } elseif {"" eq [get-define TEAISH_VERSION ""]} {
-      proj-fatal "[get-define TEAISH_TCL] did not define TEAISH_VERSION"
+      proj-fatal "$ttcl did not define TEAISH_VERSION"
     }
-  }
+    unset ttcl
+  }; # sourcing extension's teaish.tcl
 
+  #
+  # Set up the --flags...
+  #
   set opts [proj-strip-hash-comments {
     with-tcl:DIR
       => {Directory containing tclConfig.sh or a directory one level up from
@@ -116,7 +136,7 @@ proc teaish-configure-core {} {
     # As of this spontaneous moment, we'll formalize using using
     # --t-X-Y to abbreviate teaish flags when doing so is
     # unambiguous...
-    t-e-d:
+    ted: t-e-d:
     teaish-extension-dir:DIR
       => {Looks for an extension in the given directory instead of the current dir.}
 
@@ -136,13 +156,22 @@ proc teaish-configure-core {} {
     teaish-debug => {Enable teaish-specific debug output}
   }]; # $opts
 
+  #
+  # Create the full options list from:
+  # 1) $opts
+  # 2) [teaish-options], if defined
+  # 3) $::teaish__Config(exta-options)
+  #
+  set optLists [list $opts]
   if {[llength [info proc teaish-options]] > 0} {
-    # teaish-options is assumed to be imported via
-    # TEAISH_TCL
-    set opts [teaish-combine-option-lists $opts [teaish-options]]
+    # teaish-options is assumed to be imported via TEAISH_TCL.
+    lappend optLists [teaish-options]
   }
+  lappend optLists {*}$::teaish__Config(extra-options)
+  set opts [teaish-combine-option-lists {*}$optLists]
+  unset optLists
 
-  #lappend opts "soname:=duplicateEntry => {x}"; #just testing
+  #lappend opts teaish-debug => {x}; #testing dupe entry handling
   if {[catch {options $opts} msg xopts]} {
     # Workaround for 
     # where [options] behaves oddly on _some_ TCL builds when it's
@@ -160,7 +189,7 @@ proc teaish-configure-core {} {
     t-f    => teaish-force
   }
 
-  set ::teaishConfig(debug-enabled) [opt-bool teaish-debug]
+  set ::teaish__Config(debug-enabled) [opt-bool teaish-debug]
 
   if {[proj-opt-was-provided teaish-create-extension]} {
     teaish__create-extension [opt-val teaish-create-extension]
@@ -176,7 +205,7 @@ proc teaish-configure-core {} {
 # Internal config-time debugging output routine. It is not legal to
 # call this from the global scope.
 proc teaish-debug {msg} {
-  if {$::teaishConfig(debug-enabled)} {
+  if {$::teaish__Config(debug-enabled)} {
     puts stderr [proj-bold "** DEBUG: \[[proj-current-scope 1]\]: $msg"]
   }
 }
@@ -242,11 +271,17 @@ proc teaish__configure-phase1 {} {
     define TEAISH_DLL9 [get-define TEAISH_DLL9_BASENAME]$ext
   }}
 
+#  foreach ft [glob -nocomplain [get-define TEAISH_AUTOSETUP_DIR]/featuretest-*.tcl] {
+#    puts "Loading external feature test: $ft"
+#    upscope 1 "source $ft"
+#  }
+
   if {[llength [info proc teaish-configure]] > 0} {
     # teaish-options is assumed to be imported via
     # TEAISH_TCL
     teaish-configure
   }
+
   if {[proj-looks-like-windows]} {
     # Without this, linking of an extension will not work on Cygwin or
     # Msys2.
@@ -254,17 +289,11 @@ proc teaish__configure-phase1 {} {
     teaish-add-cflags -DUSE_TCL_STUBS=1
   }
 
-  #
-  # Ensure we don't have a stale pkgIndex.tcl when rebuilding for different
-  # --with-tcl=... values.
-  #
-  file delete -force pkgIndex.tcl
-
   define TEAISH_TEST_TCL \
     [join [glob -nocomplain [get-define TEAISH_DIR]/teaish.test.tcl]]
 
   #define AS_LIBDIR $::autosetup(libdir)
-  define TEAISH_LIBDIR $::autosetup(libdir)/teaish
+  define TEAISH_CORE_DIR $::autosetup(libdir)/teaish
   define TEAISH_MODULE_TEST_TCL $::autosetup(libdir)/teaish/tester.tcl
   define TEAISH_TESTER_TCL $::autosetup(builddir)/teaish.tester.tcl
   teaish__configure-finalize
@@ -279,7 +308,6 @@ proc teaish__configure-finalize {} {
       TEAISH_TCL
       TEAISH_MAKEFILE_IN
       TEAISH_TEST_TCL
-      TEAISH_PKGINIT_TCL
     } {
       set x [get-define $d ""]
       if {"" ne $x} {
@@ -289,6 +317,46 @@ proc teaish__configure-finalize {} {
     teaish-add-dist {*}$df
   }}
 
+  #
+  # Ensure we have a pkgIndex.tcl and don't have a stale generated one
+  # when rebuilding for different --with-tcl=... values. Also take
+  # care not to nuke it if pkgindex-policy is 1.
+  #
+  apply {{} {
+    set policy $::teaish__Config(pkgindex-policy);
+    set src ""; # input source for pkgIndex.tcl
+    if {$policy & 0x10} {
+      # teaish-pragma --have-own-pkgIndex.tcl override. This means
+      # we have a static/non-generated pkgIndex.tcl.
+      define TEAISH_PKGINDEX_TCL_IN ""
+      set tpt [get-define TEAISH_PKGINDEX_TCL ""]
+      if {"" eq $tpt} {
+        set tpt [file join [get-define TEAISH_DIR] pkgIndex.tcl]
+        define TEAISH_PKGINDEX_TCL $tpt
+      }
+      set src $tpt
+    } elseif {$policy & 0x04} {
+      # Found output file in TEAISH_DIR but no input file, so
+      # assume it's a hand-written one.
+      set src [get-define TEAISH_PKGINDEX_TCL]
+    } elseif {$policy} {
+      # Found input pkgIndex.tcl.in TEAISH_DIR or srcdir
+      set src [get-define TEAISH_PKGINDEX_TCL_IN]
+    } else {
+      proj-fatal "Cannot determine the pkgIndex.tcl to use"
+    }
+    msg-result "Using pkgIndex from $src"
+  }}; # $::teaish__Config(pkgindex-policy)
+
+  proj-dot-ins-append $::autosetup(srcdir)/Makefile.in
+  proj-dot-ins-append $::autosetup(srcdir)/teaish.tester.tcl.in
+
+  if {[get-define TEAISH_OUT_OF_EXT_TREE]} {
+    define TEAISH_ENABLE_DIST 0
+  }
+
+  define TEAISH_AUTOSETUP_DIR $::autosetup(libdir)/teaish
+  proj-setup-autoreconfig TEAISH_AUTORECONFIG
   foreach f {
     TEAISH_CFLAGS
     TEAISH_LDFLAGS
@@ -297,26 +365,11 @@ proc teaish__configure-finalize {} {
   } {
     define $f [join [get-define $f]]
   }
-
-  if {[get-define TEAISH_OUT_OF_EXT_TREE]} {
-    define TEAISH_ENABLE_DIST 0
-  }
-
-  define TEAISH_AUTOSETUP_DIR $::autosetup(libdir)
-  proj-setup-autoreconfig TEAISH_AUTORECONFIG
-  proj-dot-ins-append $::autosetup(srcdir)/Makefile.in
-  proj-dot-ins-append $::autosetup(srcdir)/pkgIndex.tcl.in
-  proj-dot-ins-append $::autosetup(srcdir)/teaish.tester.tcl.in
-
-  set dotIns [proj-dot-ins-list]
-  #puts "*** dotIns = $dotIns"
-  proj-dot-ins-process; # do not [define] after this point
-  foreach e $dotIns {
-    proj-validate-no-unresolved-ats [lindex $e 1]
-  }
-
+  define TEAISH__DEFINES_MAP [teaish__dump_defs_to_list]
+  proj-dot-ins-process -validate; # do not [define] after this point
   proj-if-opt-truthy teaish-dump-defines {
     make-config-header config.defines.txt \
+      -none {TEAISH__*} \
       -str {BIN_* CC LD AR INSTALL LDFLAG*} \
       -bare {HAVE_*} \
       -str {TEAISH_DIST_FILES} \
@@ -546,9 +599,15 @@ proc teaish__check-tcl {} {
 
 #
 # Searches $::argv and/or the build dir and/or the source dir for
-# teaish.make and teaish.tcl. Fails if it cannot find one of
-# them. If it returns 0 then it did not find an extension but the
-# --help flag was seen, in which case that's not an error.
+# teaish.tcl and friends. Fails if it cannot find teaish.tcl or if
+# there are other irreconcilable problems. If it returns 0 then it did
+# not find an extension but the --help flag was seen, in which case
+# that's not an error.
+#
+# This does not _load_ the extension, it simply locates the files
+# which make up an extension.
+#
+# This sets up lots of defines, e.g. TEAISH_DIR.
 #
 proc teaish__find-extension {} {
 
@@ -625,9 +684,10 @@ proc teaish__find-extension {} {
     }
   }
   set ::argv $largv
-  set dbld $::autosetup(builddir)
-  set dsrc $::autosetup(srcdir)
-  set dext [get-define TEAISH_DIR $dbld]
+  set dbld $::autosetup(builddir); # dir we're configuring under
+  set dsrc $::autosetup(srcdir);   # where teaish's configure script lives
+  set dext [get-define TEAISH_DIR $dbld] ; # dir with the extension
+  set extEqSrc [expr {$dext eq $dsrc}]   ; # are we building in-tree vis-a-vis teaish core?
 
   #
   # teaish.tcl is a TCL script which implements various
@@ -637,7 +697,7 @@ proc teaish__find-extension {} {
   #
   if {"" eq $extT} {
     set flist [list $dext/teaish.tcl]
-    if {[lindex $flist 0] ne "$dsrc/teaish.tcl"} {
+    if {!$extEqSrc} {
       lappend flist $dsrc/teaish.tcl
     }
     if {![proj-first-file-found $flist extT]} {
@@ -654,13 +714,14 @@ use --teaish-extension-dir=/path/to/extension"
   if {![file readable $extT]} {
     proj-fatal "extension tcl file is not readable: $extT"
   }
-  msg-result "Extension config         = $extT"
+  msg-result "Extension config           = $extT"
   define TEAISH_TCL $extT
   if {"" eq [get-define TEAISH_DIR ""]} {
-    # If this wasn't set via --teaish.dir then derive it from
-    # --teaish.tcl.
-    #puts "extT=$extT"
-    define TEAISH_DIR [file dirname $extT]
+    # If this wasn't set via --teaish-extension-dir then derive it from
+    # $extT.
+    #puts "extT=$extT dext=$dext"
+    set dext [file dirname $extT]
+    define TEAISH_DIR $dext
   }
 
   #
@@ -672,7 +733,7 @@ use --teaish-extension-dir=/path/to/extension"
   #
   if {"" eq $extM} {
     set flist [list $dext/teaish.make.in]
-    if {[lindex $flist 0] ne "$dsrc/teaish.make.in"} {
+    if {!$extEqSrc} {
       lappend flist $dsrc/teaish.make.in
     }
     proj-first-file-found $flist extM
@@ -681,24 +742,60 @@ use --teaish-extension-dir=/path/to/extension"
     define TEAISH_MAKEFILE_IN $extM
     define TEAISH_MAKEFILE [file rootname [file tail $extM]]
     proj-dot-ins-append $extM [get-define TEAISH_MAKEFILE]
-    msg-result "Extension makefile       = $extM"
+    msg-result "Extension makefile         = $extM"
   } else {
     define TEAISH_MAKEFILE_IN ""
     define TEAISH_MAKEFILE ""
     #proj-warn "Did not find an teaish.make.in."
   }
 
-  set flist [list $dext/teaish.pkginit.tcl]
-  if {[lindex $flist 0] ne "$dsrc/teaish.pkginit.in"} {
-    lappend flist $dsrc/teaish.pkginit.in
-  }
+  # Look for teaish.pkginit.tcl
+  set flist [list $dext/teaish.pkginit.tcl.in $dext/teaish.pkginit.tcl]
   if {[proj-first-file-found $flist extI]} {
-    msg-result "Extension post-load init = $extI"
-    define TEAISH_PKGINIT_TCL $extI
-    define TEAISH_PKGINIT_TCL_TAIL [file tail $extI]; # for use in pkgIndex.tcl
-    #teaish-add-install $extI
+    if {[string match *.in $extI]} {
+      proj-dot-ins-append $extI
+      define TEAISH_PKGINIT_TCL_IN $extI
+      define TEAISH_PKGINIT_TCL [file tail [file rootname $extI]]
+    } else {
+      define TEAISH_PKGINIT_TCL_IN ""
+      define TEAISH_PKGINIT_TCL $extI
+    }
+    teaish-add-dist [file tail $extI]
+    msg-result "Extension post-load init   = $extI"
+    define TEAISH_PKGINIT_TCL_TAIL [file tail [get-define TEAISH_PKGINIT_TCL]]; # for use in pkgIndex.tcl
   }
 
+  # Look for pkgIndex.tcl[.in]...
+  set piPolicy 0
+  if {[proj-first-file-found $dext/pkgIndex.tcl.in extPI]} {
+    # If $dext/pkgIndex.tcl.in exists, generate ./pkgIndex.tcl from
+    # it.
+    define TEAISH_PKGINDEX_TCL_IN $extPI
+    define TEAISH_PKGINDEX_TCL [file rootname [file tail $extPI]]
+    proj-dot-ins-append $extPI
+    teaish-add-dist [file tail $extPI]
+    set piPolicy 0x01
+  } elseif {!$extEqSrc && [proj-first-file-found $dsrc/pkgIndex.tcl.in extPI]} {
+    # If $dsrc/pkgIndex.tcl.in exists, generate ./pkgIndex.tcl from
+    # it.
+    define TEAISH_PKGINDEX_TCL_IN $extPI
+    define TEAISH_PKGINDEX_TCL [file rootname [file tail $extPI]]
+    proj-dot-ins-append $extPI
+    set piPolicy 0x02
+  }
+  if {!$piPolicy } {
+    if {[proj-first-file-found $dext/pkgIndex.tcl extPI]} {
+      # if TEAISH_DIR/pkgIndex.tcl exists, assume it's a static file
+      # and use it.
+      define TEAISH_PKGINDEX_TCL_IN ""
+      define TEAISH_PKGINDEX_TCL $extPI
+      proj-dot-ins-append $extPI
+      set piPolicy 0x04
+    }
+  }
+
+  set ::teaish__Config(pkgindex-policy) $piPolicy
+
   #
   # Set some sane defaults...
   #
@@ -709,8 +806,9 @@ use --teaish-extension-dir=/path/to/extension"
 
   # TEAISH_OUT_OF_EXT_TREE = 1 if we're building from a dir other
   # than the extension's home dir.
+  set dteaish [file-normalize [get-define TEAISH_DIR]]
   define TEAISH_OUT_OF_EXT_TREE \
-    [expr {[file-normalize $::autosetup(builddir)] ne [file-normalize [get-define TEAISH_DIR]]}]
+    [expr {[file-normalize $::autosetup(builddir)] ne $dteaish}]
 
   #
   # Defines which extensions may optionally make but are not required
@@ -727,42 +825,16 @@ use --teaish-extension-dir=/path/to/extension"
   return 1
 }
 
-# Internal helper to append $args to [define-append] $def
-proc teaish__append_stuff {def args} {
-  foreach a $args {
-    if {"" ne $a} {
-      define-append $def {*}$a
-    }
-  }
-}
-
-# @teaish-add-cflags ?-define? cflags...
+# @teaish-add-cflags ?-p|prepend? ?-define? cflags...
 #
-# Appends all non-empty $args to TEAISH_CFLAGS
-#
-# If -define is used then each flag is assumed to be a [define]'d
-# symbol name and [get-define X ""] used to fetch it.
+# Equivalent to [proj-define-amend TEAISH_CFLAGS {*}$args].
 proc teaish-add-cflags {args} {
-  set isdefs 0
-  if {[lindex $args 0] in {-d -define}} {
-    set args [lassign $args -]
-    set xargs [list]
-    foreach arg $args {
-      lappend xargs [get-define $arg ""]
-    }
-    set args $xargs
-  }
-  teaish__append_stuff TEAISH_CFLAGS {*}$args
+  proj-define-amend TEAISH_CFLAGS {*}$args
 }
 
-# @teaish-add-cflags ?-p|-prepend? ?-define? ldflags...
+# @teaish-add-ldflags ?-p|-prepend? ?-define? ldflags...
 #
-# Appends all non-empty $args to TEAISH_LDFLAGS unless the first
-# argument is one of (-p | -prepend), in which case it prepends all
-# arguments, in their given order, to TEAISH_LDFLAGS.
-#
-# If -define is used then each argument is assumed to be a [define]'d
-# flag and [get-define X ""] is used to fetch it.
+# Equivalent to [proj-define-amend TEAISH_LDFLAGS {*}$args].
 #
 # Typically, -lXYZ flags need to be in "reverse" order, with each -lY
 # resolving symbols for -lX's to its left. This order is largely
@@ -771,34 +843,7 @@ proc teaish-add-cflags {args} {
 #
 # See: teaish-prepend-ldflags
 proc teaish-add-ldflags {args} {
-  set prepend 0
-  set isdefs 0
-  set xargs [list]
-  foreach arg $args {
-    switch -exact -- $arg {
-      -p - -prepend { set prepend 1 }
-      -d - -define {
-        set isdefs 1
-      }
-      default {
-        lappend xargs $arg
-      }
-    }
-  }
-  set args $xargs
-  if {$isdefs} {
-    set xargs [list]
-    foreach arg $args {
-      lappend xargs [get-define $arg ""]
-    }
-    set args $xargs
-  }
-  if {$prepend} {
-    lappend args {*}[get-define TEAISH_LDFLAGS ""]
-    define TEAISH_LDFLAGS [join $args]; # join to eliminate {} entries
-  } else {
-    teaish__append_stuff TEAISH_LDFLAGS {*}$args
-  }
+  proj-define-amend TEAISH_LDFLAGS {*}$args
 }
 
 # @teaish-prepend-ldflags args...
@@ -808,7 +853,7 @@ proc teaish-prepend-ldflags {args} {
   teaish-add-ldflags -p {*}$args
 }
 
-# @teaish-add-cflags ?-dist? ?-dir? src-files...
+# @teaish-add-src ?-dist? ?-dir? src-files...
 #
 # Appends all non-empty $args to TEAISH_SRC.
 #
@@ -835,7 +880,6 @@ proc teaish-add-src {args} {
         set args [lassign $args -]
       }
       default {
-        #lappend xargs $arg
         break;
       }
     }
@@ -847,23 +891,26 @@ proc teaish-add-src {args} {
     set xargs {}
     set d [get-define TEAISH_DIR]
     foreach arg $args {
-      lappend xargs $d/$arg
+      if {"" ne $arg} {
+        lappend xargs $d/$arg
+      }
     }
     set args $xargs
   }
-  teaish__append_stuff TEAISH_SRC {*}$args
+  proj-define-append TEAISH_SRC {*}$args
 }
 
 # @teaish-add-dist files-or-dirs...
-# Appends all non-empty $args to TEAISH_DIST_FILES
+#
+# Equivalent to [proj-define-apend TEAISH_DIST_FILES ...].
 proc teaish-add-dist {args} {
-  teaish__append_stuff TEAISH_DIST_FILES {*}$args
+  proj-define-amend TEAISH_DIST_FILES {*}$args
 }
 
 # teaish-add-install files...
-# Appends all non-empty $args to TEAISH_INSTALL_FILES
+# Equivalent to [proj-define-apend TEAISH_INSTALL_FILES ...].
 #proc teaish-add-install {args} {
-#  teaish__append_stuff TEAISH_INSTALL_FILES {*}$args
+#  proj-define-amend TEAISH_INSTALL_FILES {*}$args
 #}
 
 # @teash-append-make args...
@@ -922,8 +969,9 @@ array set teaish__fCache {}
 # Sets a feature-check cache entry with a key equal to
 # [proj-current-scope [expr {$depth+1}]] and the given value.
 proc teaish-feature-cache-set {{depth 0} val} {
-  array set ::teaish__fCache [list [proj-current-scope [expr {$depth + 1}]] $val]
-  return $val
+  set key [proj-current-scope [expr {$depth + 1}]]
+  #puts "** fcheck set key=$key = $val"
+  set ::teaish__fCache($key) $val
 }
 
 # @teaish-feature-cache-check ?$depth? tgtVarName
@@ -934,15 +982,32 @@ proc teaish-feature-cache-set {{depth 0} val} {
 #
 proc teaish-feature-cache-check {{depth 0} tgtVar} {
   upvar $tgtVar tgt
-  set scope [proj-current-scope [expr {$depth + 1}]]
-  if {[info exists ::teaish__fCache($scope)]} {
-    set tgt $::teaish__fCache($scope)
+  set key [proj-current-scope [expr {$depth + 1}]]
+  #puts "** fcheck get key=$key"
+  if {[info exists ::teaish__fCache($key)]} {
+    set tgt $::teaish__fCache($key)
     return 1
   }
   set tgtVar ""
   return 0
 }
 
+# @teach-append-options list
+#
+# Adds a list of options to the pending --flag processing.  It must be
+# in the format used by Autosetup's [options] function.
+#
+# This will have no effect if called from [teaish-configure],
+# as the flags processing is done by the time that is called.
+#
+# This may be used from the top scope of teaish.tcl or from
+# [teaish-options]. When used in conjunction with [teaish-options],
+# [teaish-options] will appear first in the --help list.
+#
+proc teaish-append-options {list} {
+  lappend ::teaish__Config(extra-options) $list
+}
+
 # @teash-combine-option-lists list1 ?...listN?
 #
 # Expects each argument to be a list of options compatible with
@@ -961,6 +1026,145 @@ proc teaish-combine-option-lists {args} {
   return $rv
 }
 
+########################################################################
+# Internal helper for teaish__defs-format_: returns a JSON-ish quoted
+# form of the given string-type values. It only performs the most
+# basic of escaping. The input must not contain any control
+# characters.
+proc teaish__quote-str {value} {
+  return \"[string map [list \\ \\\\ \" \\\"] $value]\"
+}
+
+########################################################################
+# Internal helper for teaish__dump-defs-json. Expects to be passed a
+# [define] name and the variadic $args which are passed to
+# teaish__dump-defs-json. If it finds a pattern match for the given
+# $name in the various $args, it returns the type flag for that $name,
+# e.g. "-str" or "-bare", else returns an empty string.
+proc teaish__defs-type {name spec} {
+  foreach {type patterns} $spec {
+    foreach pattern $patterns {
+      if {[string match $pattern $name]} {
+        return $type
+      }
+    }
+  }
+  return ""
+}
+
+########################################################################
+# An internal impl detail. Requires a data type specifier, as used by
+# make-config-header, and a value. Returns the formatted value or the
+# value $::teaish__Config(defs-skip) if the caller should skip
+# emitting that value.
+set teaish__Config(defs-skip) "-teaish__defs-format sentinel"
+proc teaish__defs-format {type value} {
+  switch -exact -- $type {
+    -bare {
+      # Just output the value unchanged
+    }
+    -none {
+      set value $::teaish__Config(defs-skip)
+    }
+    -str {
+      set value [teaish__quote-str_ $value]
+    }
+    -auto {
+      # Automatically determine the type
+      if {![string is integer -strict $value]} {
+        set value [teaish__quote-str $value]
+      }
+    }
+    -array {
+      set ar {}
+      foreach v $value {
+        set v [teaish__defs-format -auto $v]
+        if {$::teaish__Config(defs-skip) ne $v} {
+          lappend ar $v
+        }
+      }
+      set value "\[ [join $ar {, }] \]"
+    }
+    "" {
+      set value $::teaish__Config(defs-skip)
+    }
+    default {
+      proj-fatal "Unknown type in [proj-current-scope 1]: $type"
+    }
+  }
+  return $value
+}
+
+#
+# Returns Tcl code in the form of code which evaluates to a list of
+# configure-time DEFINEs in the form {key val key2 val...}. It will
+# misbehave for values which are not numeric or simple strings.
+#
+proc teaish__dump_defs_to_list {args} {
+  set lines {}
+  lappend lines "\{"
+  set skipper $::teaish__Config(defs-skip)
+  lappend args \
+    -none {
+      TEAISH__*
+      TEAISH_MAKEFILE_CODE
+      TEAISH_AUTORECONFIGURE
+      AM_* AS_*
+    } \
+    -bare {SIZEOF_* HAVE_DECL_*} \
+    -auto *
+  foreach n [lsort [dict keys [all-defines]]] {
+    set type [teaish__defs-type $n $args]
+    set value [teaish__defs-format $type [get-define $n]]
+    if {$skipper ne $value} {
+      lappend lines "$n $value"
+    }
+  }
+  lappend lines "\}"
+  return [join $lines "\n"]
+}
+
+# @teaish-pragma ...flags
+#
+# Offers a way to tweak how teaish's core behaves in some cases, in
+# particular those which require changing how the core looks for an
+# extension and its files.
+#
+# Accepts the following flags:
+#
+#   --have-own-pkgIndex.tcl: Tells teaish that ./pkgIndex.tcl is not a
+#    generated file, so it will not try to overwrite or delete it.
+#    May be used during initial loading of teaish.tcl.
+#
+#   --disable-dist: disables the "dist" parts of the filtered
+#     Makefile.  May be used during initial loading of teaish.tcl.
+#
+# Emits a warning message for unknown arguments.
+proc teaish-pragma {args} {
+  foreach arg $args {
+    switch -exact -- $arg {
+
+      --disable-dist {
+        define TEAISH_ENABLE_DIST 0
+      }
+
+      --have-own-pkgIndex.tcl {
+        set pi [file join [get-define TEAISH_DIR] pkgIndex.tcl]
+        if {![file exists $pi]} {
+          proj-fatal "teaish-pragmas $arg found no pkgIndex.tcl"
+        }
+        define TEAISH_PKGINDEX_TCL $pi
+        set ::teaish__Config(pkgindex-policy) 0x10
+      }
+
+      default {
+        proj-warn "Unknown [proj-current-scope] flag: $arg"
+      }
+    }
+  }
+}
+
+
 # @teaish-enable-dist ?yes?
 #
 # Explicitly enables or disables the "dist" rules in the default
@@ -973,6 +1177,7 @@ proc teaish-enable-dist {{yes 1}} {
   define TEAISH_ENABLE_DIST $yes
 }
 
+
 #
 # Handles --teaish-create-extension=TARGET-DIR
 #
diff --git a/autoconf/tea/autosetup/feature-tests.tcl b/autoconf/tea/autosetup/feature-tests.tcl
index 1ecdc013a4..63da9cd4fa 100644
--- a/autoconf/tea/autosetup/feature-tests.tcl
+++ b/autoconf/tea/autosetup/feature-tests.tcl
@@ -9,7 +9,7 @@
 #  * May you share freely, never taking more than you give.
 #
 ########################################################################
-# ----- @module teaish-checks.tcl -----
+# ----- @module feature-tests.tcl -----
 # @section TEA-ish collection of feature tests.
 #
 # Functions in this file with a prefix of teaish__ are
@@ -18,21 +18,19 @@
 
 # @teaish-check-cached@ ?-flags? msg script
 #
-# Under construction.
+# A proxy for feature-test impls which handles caching of a feature
+# flag check on per-function basis, using the calling scope's name as
+# the cache key.
 #
-# A proxy for feature-test impls which handles chacheing of the
-# feature flag check on a per-caller basis, using the calling scope's
-# name as the cache key.
-#
-# The test is performed by $script. This function caches the result
-# and checks for a chache hit before running $script. The value stored
+# The test is performed by $script. This function checks for a chache
+# hit before running $script and caching the result. The value stored
 # in the cache is the final value of $script (and this routine will
 # intercept a 'return' from $script).
 #
 # Flags:
 #
 #   -nostatus = do not emit "ok" or "no" at the end. This presumes
-#    that the caller will emit a newline before turning.
+#    that the caller will emit at least one newline before turning.
 proc teaish-check-cached {args} {
   set quiet 0
   set xargs {}
@@ -58,6 +56,7 @@ proc teaish-check-cached {args} {
   } else {
     set code [catch {uplevel 1 $script} rc xopt]
     #puts "***** ::teaish__fCache ="; parray ::teaish__fCache
+    #puts "***** cached-check got code=$code rc=$rc"
     if {$code in {0 2}} {
       teaish-feature-cache-set 1 $rc
       if {!$quiet} {
@@ -71,7 +70,8 @@ proc teaish-check-cached {args} {
       #puts "**** code=$code rc=$rc xopt=$xopt"
       teaish-feature-cache-set 1 0
     }
-    return -options $xopt $rc
+    #puts "**** code=$code rc=$rc"
+    return {*}$xopt $rc
   }
 }
 
@@ -181,8 +181,11 @@ proc teaish-check-dlopen {} {
   }
 }
 
-########################################################################
-# Handles the --enable-math flag.
+#
+# @teaish-check-libmath
+#
+# Handles the --enable-math flag. Returns 1 if found, else 0.
+# If found, it prepends -lm (if needed) to the linker flags.
 proc teaish-check-libmath {} {
   teaish-check-cached "Checking for libc math library" {
     set lfl ""
@@ -199,282 +202,41 @@ proc teaish-check-libmath {} {
   }
 }
 
-# @teaish-check-pkg-config-openssl
+# @teaish-import-features ?-no-options? feature-names...
 #
-# Returns 1 if openssl is found via pkg-config, else 0.  If found,
-# passes its link flags to teaish-prepend-ldflags.
+# For each $name in feature-names... it invokes:
 #
-# It defines LDFLAGS_OPENSSL to the linker flags and CFLAGS_OPENSSL to
-# the CFLAGS, or "" if it's not found.
+#   use teaish/feature/$name
 #
-# Defines HAVE_OPENSSL to 0 or 1 (its return value).
+# to load $::autosetup(libdir)/teaish/feature/$name.tcl.
 #
-# If it returns true, the underlying pkg-config test will set several
-# defines named PKG_OPENSSL_... (see the docs for [pkg-config] for
-# details).
-proc teaish-check-pkg-config-openssl {} {
-  use pkg-config
-  teaish-check-cached -nostatus "Checking for openssl via pkg-config" {
-    set rc 0
-    if {[msg-quiet pkg-config-init 0] && [msg-quiet pkg-config openssl]} {
-      incr rc
-      set lfl [string trim "[get-define PKG_OPENSSL_LDFLAGS] [get-define PKG_OPENSSL_LIBS]"]
-      define CFLAGS_OPENSSL [get-define PKG_OPENSSL_CFLAGS]
-      define LDFLAGS_OPENSSL $lfl
-      teaish-prepend-ldflags $lfl
-      msg-result "ok ($lfl)"
-    } else {
-      define CFLAGS_OPENSSL ""
-      define LDFLAGS_OPENSSL ""
-      msg-result "no"
+# By default, if a proc named teaish-check-${name}-options is defined
+# after sourcing a file, it is called and its result is passed to
+# teaish-append-options. This can be suppressed with the -no-options
+# flag.
+proc teaish-import-features {args} {
+  set doOpt 1
+  if {1} {
+    set xopt [list]
+    foreach arg $args {
+      switch -exact -- $arg {
+        -no-options {
+          set doOpt 0
+        }
+        default {
+          lappend xopt $arg
+        }
+      }
+    }
+    set args $xopt
+  }
+  foreach arg $args {
+    uplevel "use teaish/feature/$arg"
+    if {$doOpt} {
+      set n "teaish-check-${arg}-options"
+      if {[llength [info proc $n]] > 0} {
+        teaish-append-options [$n]
+      }
     }
-    define HAVE_OPENSSL $rc
-    return [teaish-feature-cache-set $rc]
-  }
-}
-
-# Internal helper for OpenSSL checking using cc-with to check if the
-# given $cflags, $ldflags, and list of -l libs can link an
-# application.
-#
-# For a system-level check, use empty $cflags and $ldflags.
-#
-# On success, it defines CFLAGS_OPENSSL to $cflags and LDFLAGS_OPENSSL
-# to a combination of $ldflags and any required libs (which may be
-# amended beyond those provided in $libs). It then returns 1.
-#
-# On failure it defines the above-mentioned flags to ""
-# and returns 0.
-#
-# Defines HAVE_OPENSSL to its return value.
-#
-# Derived from https://fossil-scm.org/file/auto.def
-proc teaish__check-openssl {msg cflags ldflags {libs {-lssl -lcrypto -lpthread}}} {
-  msg-checking "$msg ... "
-  set rc 0
-  set isMinGw [teaish-is-mingw]
-  if {$isMinGw} {
-    lappend libs -lgdi32 -lwsock32 -lcrypt32
-  }
-  set prefix msg-quiet
-  #set prefix ""
-  set lz ""
-  if {[{*}$prefix teaish-check-libz]} {
-    set lz [get-define LDFLAGS_LIBZ]
-  }
-  set libs2 $libs
-  if {$lz ne ""} {
-    lappend libs2 $lz
-  }
-  {*}$prefix cc-with [list -link 1 -cflags "$cflags $ldflags" -libs $libs2] {
-    if {[cc-check-includes openssl/ssl.h] && \
-          [cc-check-functions SSL_new]} {
-      incr rc
-    }
-  }
-  if {!$rc && !$isMinGw} {
-    # On some systems, OpenSSL appears to require -ldl to link.
-    if {[{*}$prefix teaish-check-dlopen]} {
-      lappend libs2 [get-define LDFLAGS_DLOPEN ""]
-      {*}$prefix cc-with [list  -link 1 -cflags "$cflags $ldflags" -libs $libs2] {
-        if {[cc-check-includes openssl/ssl.h] && \
-              [cc-check-functions SSL_new]} {
-          incr rc
-        }
-      }
-    }
-  }
-  #puts "*???? cflags=$cflags ldflags=$ldflags libs2=$libs2"
-  if {$rc} {
-    msg-result "ok"
-    define CFLAGS_OPENSSL "$cflags"
-    define LDFLAGS_OPENSSL "$ldflags $libs2"
-  } else {
-    define CFLAGS_OPENSSL ""
-    define LDFLAGS_OPENSSL ""
-    msg-result "no"
-  }
-  define HAVE_OPENSSL $rc
-  return $rc
-}
-
-# @teaish-check-openssl
-#
-# Jumps through some provierbial hoops to look for OpenSSL dev pieces.
-#
-# $where must be one of the following:
-#
-# - "pkg-config": check only pkg-config for it, but also verify that
-#   the results from pkg-config seem to work.
-#
-# - "system": look in standard(ish) system paths, starting with
-#   a lookup requiring no -L flag.
-#
-# - "auto" or "": try (pkg-config, system), in that order.
-#
-# - "none": do no lookup, define vars (see below), and return 0.
-#
-# - Any other value is assumed to be a directory name suitable for
-#   finding OpenSSL, but how this lookup is run is not currently
-#   well-defined.
-#
-# It defines LDFLAGS_OPENSSL and CFLAGS_OPENSSL to ldflags
-# resp. cflags needed for compiling and linking, and updates teaish's
-# internal ldflags/cflags lists. If OpenSSL is not found, they're
-# defined to "".
-#
-# It defines HAVE_OPENSSL to 0 or 1 (its return value).
-#
-# If $where is empty then it defaults to auto. If $where is not empty
-# _and_ OpenSSL is not found
-#
-# If the --with-openssl=... config flag is defined (see
-# teaish-check-openssl-options) then an empty $where value will use
-# the value of the --with-openssl flag, defaulting to "auto" if that
-# flag also has an empty value. If that flag is provided, and has a
-# value other than "none", then failure to find the library is
-# considered fatal.
-#
-# Derived from https://fossil-scm.org/file/auto.def
-proc teaish-check-openssl {{where ""}} {
-  teaish-check-cached -nostatus "Looking for openssl" {
-    if {$where eq ""} {
-      if {[proj-opt-exists with-openssl]} {
-        set where [join [opt-val with-openssl auto]]
-      }
-    }
-
-    set notfound {{checkWithFlag msg} {
-      if {$checkWithFlag && [proj-opt-was-provided with-openssl]} {
-        proj-fatal "--with-openssl " \
-          "found no working installation. Try --with-openssl=none"
-      }
-      define LDFLAGS_OPENSSL ""
-      define CFLAGS_OPENSSL ""
-      define HAVE_OPENSSL 0
-      msg-result $msg
-    }}
-
-    switch -exact -- $where {
-      none {
-        apply $notfound 0 none
-        return 0
-      }
-      "" {
-        set where auto
-      }
-    }
-    if {$where in {pkg-config auto}} {
-      # Check pkg-config
-      if {[teaish-check-pkg-config-openssl]} {
-        set cflags [get-define PKG_OPENSSL_CFLAGS ""]
-        set ldflags [get-define LDFLAGS_OPENSSL ""]
-        if {[teaish__check-openssl "Verifying openssl pkg-config values" \
-               "$cflags $ldflags"]} {
-          teaish-prepend-ldflags $ldflags
-          return 1
-        }
-      }
-      if {$where eq "pkg-config"} {
-        apply $notfound 1 "not found"
-        return 0
-      }
-    }
-
-    # Determine which dirs to search...
-    set ssldirs {}
-    if {$where in {auto system}} {
-      set ssldirs {
-        {} /usr/sfw /usr/local/ssl /usr/lib/ssl /usr/ssl
-        /usr/pkg /usr/local /usr /usr/local/opt/openssl
-        /opt/homebrew/opt/openssl
-      }
-    } elseif {$where ne ""} {
-      lappend ssldirs $where
-    }
-
-    foreach dir $ssldirs {
-      set msg "in $dir"
-      set cflags "-I$dir/include"
-      if {$dir eq ""} {
-        set msg "without -L/path"
-        set ldflags ""
-        set cflags ""
-      } elseif {![file isdir $dir]} {
-        continue
-      } elseif {[file readable $dir/libssl.a]} {
-        set ldflags -L$dir
-      } elseif {[file readable $dir/lib/libssl.a]} {
-        set ldflags -L$dir/lib
-      } elseif {[file isdir $dir/lib]} {
-        set ldflags [list -L$dir -L$dir/lib]
-      } else {
-        set ldflags -L$dir
-      }
-      if {[teaish__check-openssl $msg $cflags $ldflags]} {
-        teaish-add-cflags [get-define CFLAGS_OPENSSL]
-        teaish-prepend-ldflags [get-define LDFLAGS_OPENSSL]
-        return 1
-      }
-      if {$dir ne ""} {
-        # Look for a static build under $dir...
-        set ldflags ""
-        set libs [list $dir/libssl.a $dir/libcrypto.a]
-        set foundLibs 0
-        foreach x $libs {
-          if {![file readlable $x]} break;
-          incr foundLibs
-        }
-        if {$foundLibs != [llength $libs]} {
-          continue
-        }
-        set cflags "-I$dir/include"
-        lappend libs -lpthread
-        if {[teaish__check-openssl "Checking for static openssl build in $dir" \
-               $cflags $ldflags $libs]} {
-          teaish-add-cflags [get-define CFLAGS_OPENSSL]
-          teaish-prepend-ldflags [get-define LDFLAGS_OPENSSL]
-          return 1
-        }
-      }
-    }
-
-    apply $notfound 1 no
-    return 0
-  }
-}; # teaish-check-openssl
-
-# @teaish-check-openssl-options
-#
-# teaish.tcl files which use teaish-check-openssl should
-# include this function's result from their teaish-options
-# impl, so that configure --help can include the --with-openssl
-# flag that check exposes.
-#
-# Returns a list of options for the teaish-check-openssl feature test.
-#
-# Example usage:
-#
-# proc teaish-options {} {
-#  use teaish-feature-tests
-#  return [teaish-combine-option-lists \
-#            [teaish-check-openssl-options] \
-#            { hell-world => {just testing} } \
-#          ]
-# }
-proc teaish-check-openssl-options {} {
-  return {
-    with-openssl:see-the-help =>
-    {Checks for OpenSSL development libraries in a variety of ways.
-      "pkg-config" only checks the system's pkg-config.
-      "system" checks only for a system-level copy.
-      "auto" checks the prior options and a list of
-      likely candidate locations. "none" disables the check
-      altogether and causes the check to not fail if it's
-      not found. Any other value is a directory in which a
-      _static_ copy of libssl.a can be found, e.g. a locally-built
-      copy of the OpenSSL source tree. If this flag is explicitly provided,
-      and has a value other than "none", failure to find OpenSSL
-      is fatal.}
   }
 }
diff --git a/autoconf/tea/autosetup/tester.tcl b/autoconf/tea/autosetup/tester.tcl
index f464c85a2d..d0d8024474 100644
--- a/autoconf/tea/autosetup/tester.tcl
+++ b/autoconf/tea/autosetup/tester.tcl
@@ -42,18 +42,45 @@ proc test-current-scope {{lvl 0}} {
   }
 }
 
+# @test-msg
+#
+# Emits all arugments to stdout.
 proc test-msg {args} {
-  puts "{*}$args"
+  puts "$args"
+}
+
+# @test-warn
+#
+# Emits all arugments to stderr.
+proc test-warn {args} {
+  puts stderr "WARNING: $args"
 }
 
 ########################################################################
 # @test-error msg
 #
-# Emits an error message to stderr and exits with non-0.
+# Triggers a test-failed error with a string describing the calling
+# scope and the provided message.
 proc test-fail {msg} {
   #puts stderr "ERROR: \[[test-current-scope 1]]: $msg"
   #exit 1
-  error "ERROR: \[[test-current-scope 1]]: $msg"
+  error "FAIL: \[[test-current-scope 1]]: $msg"
+}
+
+# Internal impl for assert-likes. Should not be called directly by
+# client code.
+proc test__assert {lvl script {msg ""}} {
+  set src "expr \{ $script \}"
+  # puts "XXXX evalling $src";
+  if {![uplevel $lvl $src]} {
+    if {"" eq $msg} {
+      set msg $script
+    }
+    set caller1 [test-current-scope $lvl]
+    incr lvl
+    set caller2 [test-current-scope $lvl]
+    error "Assertion failed in: \[$caller2 -> $caller1]]: $msg"
+  }
 }
 
 ########################################################################
@@ -64,13 +91,16 @@ proc test-fail {msg} {
 # includes the body of the failed assertion, but if $msg is set then
 # that is used instead.
 proc assert {script {msg ""}} {
-  set x "expr \{ $script \}"
-  if {![uplevel 1 $x]} {
-    if {"" eq $msg} {
-      set msg $script
-    }
-    test-fail "Assertion failed in \[[test-current-scope 1]]: $msg"
-  }
+  test__assert 1 $script $msg
+}
+
+########################################################################
+# @test-assert testId script ?msg?
+#
+# Works like [assert] but emits $testId to stdout first.
+proc test-assert {testId script {msg ""}} {
+  puts "test $testId"
+  test__assert 2 $script $msg
 }
 
 ########################################################################
@@ -81,28 +111,65 @@ proc assert {script {msg ""}} {
 proc test-expect {testId script result} {
   puts "test $testId"
   set x [uplevel 1 $script]
-  assert {$x eq $result} "\nEXPECTED: <<$result>>\nGOT:      <<$x>>"
-}
-
-########################################################################
-# @test-assert testId script ?msg?
-#
-# Works like [assert] but emits $testId to stdout first.
-proc test-assert {testId script {msg ""}} {
-  puts "test $testId"
-  assert $script $msg
+  test__assert 1 {$x eq $result} "\nEXPECTED: <<$result>>\nGOT:      <<$x>>"
 }
 
 ########################################################################
 # @test-catch cmd ?...args?
 #
 # Runs [cmd ...args], repressing any exception except to possibly log
-# the failure.
+# the failure. Returns 1 if it caught anything, 0 if it didn't.
 proc test-catch {cmd args} {
   if {[catch {
     $cmd {*}$args
   } rc xopts]} {
     puts "[test-current-scope] ignoring failure of: $cmd [lindex $args 0]: $rc"
-    #how to extract just the message text from $xopts?
+    return 1
   }
+  return 0
+}
+
+array set teaish__BuildFlags {}
+
+# @teaish-build-flag2 flag tgtVar ?dflt?
+#
+# Caveat #1: only valid when called in the context of teaish's default
+# "make test" recipe, e.g. from teaish.test.tcl. It is not valid from
+# a teaish.tcl configure script because (A) the state it relies on
+# doesn't fully exist at that point and (B) that level of the API has
+# more direct access to the build state. This function requires that
+# an external script have populated its internal state, which is
+# normally handled via teaish.tester.tcl.in.
+#
+# If the current build has the configure-time flag named $flag set
+# then tgtVar is assigned its value and 1 is returned, else tgtVal is
+# assigned $dflt and 0 is returned.
+#
+# Caveat #2: defines in the style of HAVE_FEATURENAME with a value of
+# 0 are, by long-standing configure script conventions, treated as
+# _undefined_ here.
+#
+proc teaish-build-flag2 {flag tgtVar {dflt ""}} {
+  upvar $tgtVar tgt
+  if {[info exists ::teaish__BuildFlags($flag)]} {
+    set tgt $::teaish__BuildFlags($flag)
+    return 1;
+  } elseif {0==[array size ::teaish__BuildFlags]} {
+    test-warn \
+      "\[[test-current-scope]] was called from " \
+      "[test-current-scope 1] without the build flags imported."
+  }
+  set tgt $dflt
+  return 0
+}
+
+# @teaish-build-flag flag ?dflt?
+#
+# Convenience form of teaish-build-flag2 which returns the
+# configure-time-defined value of $flag or "" if it's not defined (or
+# if it's an empty string).
+proc teaish-build-flag {flag {dflt ""}} {
+  set tgt ""
+  teaish-build-flag2 $flag tgt $dflt
+  return $tgt
 }
diff --git a/autoconf/tea/teaish.tcl b/autoconf/tea/teaish.tcl
index 39a51599dc..30c8714ad4 100644
--- a/autoconf/tea/teaish.tcl
+++ b/autoconf/tea/teaish.tcl
@@ -29,10 +29,9 @@ array set sqliteConfig [subst [proj-strip-hash-comments {
 proc teaish-options {} {
   return [proj-strip-hash-comments [subst -nocommands -nobackslashes {
     with-system-sqlite=0
-      => {Use the system-level sqlite instead of the copy in this tree.
-          WARNING: this extension's version is taken from the in-tree copy
-          and there is no reliable way to get the version of a system-level
-          copy.}
+      => {Use the system-level SQLite instead of the copy in this tree.
+          Also requires use of --override-sqlite-version so that the build
+          knows what version number to associate with the system-level SQLite.}
     override-sqlite-version:VERSION
       => {For use with --with-system-sqlite to set the version number.}
     threadsafe=1         => {Disable mutexing}
@@ -72,10 +71,14 @@ proc teaish-configure {} {
 
   set srcdir [get-define TEAISH_DIR]
   teaish-add-src -dist -dir generic/tclsqlite3.c
-  teaish-add-cflags -I${srcdir}/.. ; # for sqlite3.c
+  teaish-add-cflags -I${srcdir}/.. ; # for sqlite3.[ch]
   if {[proj-opt-was-provided override-sqlite-version]} {
     define TEAISH_VERSION [opt-val override-sqlite-version]
-    msg-result "NOTICE: overriding version number: [get-define TEAISH_VERSION]"
+    proj-warn "overriding sqlite version number: [get-define TEAISH_VERSION]"
+  } elseif {[proj-opt-was-provided with-system-sqlite]
+            && [opt-val with-system-sqlite] ne "0"} {
+    proj-fatal "when using --with-system-sqlite also use"\
+      "--override-sqlite-version to specify a library version number."
   }
 
   define CFLAGS [proj-get-env CFLAGS {-O2}]
diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl
index 80b0e95b8b..296652279f 100644
--- a/autosetup/proj.tcl
+++ b/autosetup/proj.tcl
@@ -73,7 +73,8 @@ set proj_(isatty) [isatty? stdout]
 ########################################################################
 # @proj-warn msg
 #
-# Emits a warning message to stderr.
+# Emits a warning message to stderr. All args are appended with a
+# space between each.
 proc proj-warn {args} {
   show-notices
   puts stderr [join [list "WARNING:" {*}$args] " "]
@@ -82,10 +83,11 @@ proc proj-warn {args} {
 ########################################################################
 # @proj-error msg
 #
-# Emits an error message to stderr and exits with non-0.
+# Emits an error message to stderr and exits with non-0. All args are
+# appended with a space between each.
 proc proj-fatal {args} {
   show-notices
-  puts stderr "ERROR: \[[proj-current-scope 1]]: $args"
+  puts stderr [join [list "ERROR: \[[proj-current-scope 1]]:" {*}$args] " "]
   exit 1
 }
 
@@ -1691,3 +1693,65 @@ proc proj-setup-autoreconfig {defName} {
     define-append $defName [apply $squote $arg]
   }
 }
+
+########################################################################
+# @prop-append-to defineName args...
+#
+# A proxy for Autosetup's [define-append]. Appends all non-empty $args
+# to [define-append $defineName].
+proc proj-define-append {defineName args} {
+  foreach a $args {
+    if {"" ne $a} {
+      define-append $defineName {*}$a
+    }
+  }
+}
+
+########################################################################
+# @prod-define-amend ?-p|-prepend? ?-define? FLAG args...
+#
+# A proxy for Autosetup's [define-append].
+#
+# Appends all non-empty $args to the define named by $FLAG unless.  If
+# one of (-p | -prepend) are used it instead prepends them, in their
+# given order, to $FLAG.
+#
+# If -define is used then each argument is assumed to be a [define]'d
+# flag and [get-define X ""] is used to fetch it.
+#
+# Typically, -lXYZ flags need to be in "reverse" order, with each -lY
+# resolving symbols for -lX's to its left. This order is largely
+# historical, and not relevant on all environments, but it is
+# technically correct and still relevant on some environments.
+#
+# See: proj-append-to
+proc proj-define-amend {defName args} {
+  set prepend 0
+  set isdefs 0
+  set xargs [list]
+  foreach arg $args {
+    switch -exact -- $arg {
+      -p - -prepend { set prepend 1 }
+      -d - -define {
+        set isdefs 1
+      }
+      default {
+        lappend xargs $arg
+      }
+    }
+  }
+  if {$isdefs} {
+    set args $xargs
+    set xargs [list]
+    foreach arg $args {
+      lappend xargs [get-define $arg ""]
+    }
+  }
+  set args $xargs
+  if {$prepend} {
+    lappend args {*}[get-define $defName ""]
+    define $defName [join $args]; # join to eliminate {} entries
+  } else {
+    proj-define-append $defName {*}$args
+  }
+}
diff --git a/manifest b/manifest
index 8dba5dbc75..b613f66bd2 100644
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Improved\sestimate\son\sthe\snumber\sof\soutput\srows\sin\sa\srecursive\scommon\stable\sexpression\nthat\suses\sthe\sUNION\soperator.\s\sFollow-up\sto\s[f911f1c4977fbcae]\sand\sit's\soutput\srow\nestimate\schanges\sassociated\swith\sDISTINCT\squeries.
-D 2025-04-14T19:43:30.136
+C Update\steaish\sto\sthe\slatest\supstream\scopy.\sMove\ssome\sof\sits\sutility\scode\sinto\sproj.tcl\sfor\sreuse\sin\sthe\stop-level\sconfigure\sbits.
+D 2025-04-14T23:52:11.230
 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
@@ -26,14 +26,14 @@ F autoconf/tea/Makefile.in 2a90dfab1e95cb3ec610429c78d88d4a7d26beb080ad45ff6a059
 F autoconf/tea/README.txt 656d4686c509d375f5988ff3deda94f65fe6cd8358cd55d1f1dcc7b6e2ff73aa
 F autoconf/tea/auto.def 81e2617cfb90d53c19b53b3ec632cd2893bf32f2e5dd272b1116fadf2ea86c2d
 F autoconf/tea/autosetup/README.txt b40071e6f8506500a2f7f71d5fc69e0bf87b9d7678dd9da1e5b4d0acbf40b1ca
-F autoconf/tea/autosetup/core.tcl 85d6d484f75d9d2fa02517c20650cc7af50fe216f7848ebd6d0c59782f99ef01
-F autoconf/tea/autosetup/feature-tests.tcl 0e2893c787edb26d2d4302ea5178d4c0a6878f396905bf8fa485afb7a6fad5f0
-F autoconf/tea/autosetup/tester.tcl 91beb9e26916cdb54400446e2890105cdea4186789141d5748c72b2f73b26ed0
+F autoconf/tea/autosetup/core.tcl 2738997421c4fdcf52528af36db716993bb00425b10340a1e50143fe94048c46
+F autoconf/tea/autosetup/feature-tests.tcl 57bc056df24f7b5d54006598ee2cbdf234fea55e0d17f8c5f2b52a8d90095dbc
+F autoconf/tea/autosetup/tester.tcl d94aa9d51d2a22062e61db97310c2502ca0df50ca87108482c3bccf8f41db127
 F autoconf/tea/configure d0b12b984edca6030d1976375b80157ac78b5b90a5b4f0dcee39357f63f4a80b x
 F autoconf/tea/doc/sqlite3.n 9a97f4f717ceab73004ea412af7960625c1cb24b5c25e4ae4c8b5d8fa4300f4e
 F autoconf/tea/license.terms 13bd403c9610fd2b76ece0ab50c4c5eda933d523
 F autoconf/tea/pkgIndex.tcl.in 2c99a64a0eff5dc2ad8e9657bb564fae2dbdfdb6b77a4c49b4387bd5a25c42ef
-F autoconf/tea/teaish.tcl 9fc1fb838eabebcda65035178ade8d04daafa6bf07a7f7a01e3b1fbd3df08f6c
+F autoconf/tea/teaish.tcl 76bcea8d44543f085084b6662219f0534e7513374a82d6aaa6f9c7c7e1acca58
 F autoconf/tea/teaish.test.tcl cfe94e1fb79dd078f650295be59843d470125e0cc3a17a1414c1fb8d77f4aea6
 F autoconf/tea/teaish.tester.tcl.in 743fd0fe1e667f82fd8fc3ebe0a5c77763e4dbed7bbc8605a9d4b1d0663dac78
 F autosetup/LICENSE 41a26aebdd2cd185d1e2b210f71b7ce234496979f6b35aef2cbf6b80cbed4ce4
@@ -51,7 +51,7 @@ F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e
 F autosetup/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1821baf61bc86a7e
 F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049
 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba
-F autosetup/proj.tcl a59eac46d92125905dd577699d4acc09adbbf377f4337cc43f61786091c8af6c
+F autosetup/proj.tcl 9de1b0fbc76dd22d447cd10c7a5f07c8aafef258a87c52c67687fb1e91fc3d58
 F autosetup/sqlite-config.tcl 3f771754b89ae10379bb5d9d48d80921568345618f8f37d4a62a8e1fd9cd916c
 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9
 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x
@@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350
 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 914d4c9d6c26536ca14be80eee6c54af4311eac6bf88b327738075275f4b77da
-R fee16bedc2936fcf762a590910cd0015
-U drh
-Z cac2b67ac54b69b59bd81ffa4eaf41eb
+P 92513f6bce7ecc778e78af3a77bc66ff65585fffa2e3138f8acb9e617121eeb0
+R 885261e686c805e49dc78c31644a054a
+U stephan
+Z 68c2318b2d8a42399b7b82112788ad28
 # Remove this line to create a well-formed Fossil manifest.
diff --git a/manifest.uuid b/manifest.uuid
index d4ba1305b2..de64e8eecb 100644
--- a/manifest.uuid
+++ b/manifest.uuid
@@ -1 +1 @@
-92513f6bce7ecc778e78af3a77bc66ff65585fffa2e3138f8acb9e617121eeb0
+921c5ea76925be911222ac5f2887b8a967ff47b1aa43e196231e6168a3f9cb88

From dc2d79f80fab9bda99ad95f4c7de752feefa927a Mon Sep 17 00:00:00 2001
From: stephan 
Date: Tue, 15 Apr 2025 00:47:31 +0000
Subject: [PATCH 103/120] Slight simplifications in the teaish build.

FossilOrigin-Name: 6b2d0e09e4806b5731764192782ec7e1ad595c529202a684d23bcfe2fae559d7
---
 autoconf/tea/autosetup/core.tcl          |  6 +--
 autoconf/tea/autosetup/feature-tests.tcl |  2 +-
 autoconf/tea/teaish.tcl                  | 52 ++++++++----------------
 manifest                                 | 16 ++++----
 manifest.uuid                            |  2 +-
 5 files changed, 30 insertions(+), 48 deletions(-)

diff --git a/autoconf/tea/autosetup/core.tcl b/autoconf/tea/autosetup/core.tcl
index 8b781793f2..a4e74d8420 100644
--- a/autoconf/tea/autosetup/core.tcl
+++ b/autoconf/tea/autosetup/core.tcl
@@ -48,7 +48,7 @@ array set teaish__Config [proj-strip-hash-comments {
 
   #
   # A list of lists of Autosetup [options]-format --flags definitions.
-  # Append to this using [teaish-append-options].
+  # Append to this using [teaish-add-options].
   #
   extra-options {}
 }]
@@ -992,7 +992,7 @@ proc teaish-feature-cache-check {{depth 0} tgtVar} {
   return 0
 }
 
-# @teach-append-options list
+# @teach-add-options list
 #
 # Adds a list of options to the pending --flag processing.  It must be
 # in the format used by Autosetup's [options] function.
@@ -1004,7 +1004,7 @@ proc teaish-feature-cache-check {{depth 0} tgtVar} {
 # [teaish-options]. When used in conjunction with [teaish-options],
 # [teaish-options] will appear first in the --help list.
 #
-proc teaish-append-options {list} {
+proc teaish-add-options {list} {
   lappend ::teaish__Config(extra-options) $list
 }
 
diff --git a/autoconf/tea/autosetup/feature-tests.tcl b/autoconf/tea/autosetup/feature-tests.tcl
index 63da9cd4fa..5f045eae09 100644
--- a/autoconf/tea/autosetup/feature-tests.tcl
+++ b/autoconf/tea/autosetup/feature-tests.tcl
@@ -235,7 +235,7 @@ proc teaish-import-features {args} {
     if {$doOpt} {
       set n "teaish-check-${arg}-options"
       if {[llength [info proc $n]] > 0} {
-        teaish-append-options [$n]
+        teaish-add-options [$n]
       }
     }
   }
diff --git a/autoconf/tea/teaish.tcl b/autoconf/tea/teaish.tcl
index 30c8714ad4..ae4f6c7b7c 100644
--- a/autoconf/tea/teaish.tcl
+++ b/autoconf/tea/teaish.tcl
@@ -67,6 +67,7 @@ proc teaish-options {} {
 # work needed for this extension.
 #
 proc teaish-configure {} {
+  teaish-enable-dist 0
   use teaish/feature-tests
 
   set srcdir [get-define TEAISH_DIR]
@@ -108,15 +109,9 @@ proc teaish-configure {} {
   sqlite-handle-load-extension
   sqlite-handle-math
   sqlite-handle-icu
-  sqlite-handle-common-feature-flags
-
-  teaish-add-ldflags -p -d \
-    LDFLAGS_LIBICU LDFLAGS_LIBMATH LDFLAGS_DLOPEN \
-    LDFLAGS_LIBRT
-
-  teaish-add-cflags -define CFLAGS_LIBICU OPT_FEATURE_FLAGS
-  teaish-enable-dist 0
 
+  sqlite-handle-common-feature-flags; # must be late in the process
+  teaish-add-cflags -define OPT_FEATURE_FLAGS
 }; # teaish-configure
 
 
@@ -242,27 +237,6 @@ proc sqlite-finalize-feature-flags {} {
 # both the canonical build and the "autoconf" bundle.
 #
 proc sqlite-check-common-system-deps {} {
-  # Check for needed/wanted data types
-  if {0} {
-    # We don't need these until/unless we want to generate
-    # sqlite_cfg.h. The historical TEA build does not generate that
-    # file.
-    cc-with {-includes stdint.h} \
-      {cc-check-types int8_t int16_t int32_t int64_t intptr_t \
-         uint8_t uint16_t uint32_t uint64_t uintptr_t}
-
-    # Check for needed/wanted functions
-    cc-check-functions gmtime_r isnan localtime_r localtime_s \
-      malloc_usable_size strchrnul usleep utime pread pread64 pwrite pwrite64
-
-    # Check for needed/wanted headers
-    cc-check-includes \
-      sys/types.h sys/stat.h dlfcn.h unistd.h \
-      stdlib.h malloc.h memory.h \
-      string.h strings.h \
-      inttypes.h
-  }
-
   teaish-check-librt
   teaish-check-libz
 }
@@ -273,6 +247,8 @@ proc sqlite-check-common-system-deps {} {
 # needed for linking pthread (possibly an empty string). If
 # --enable-threadsafe is not set, adds -DSQLITE_THREADSAFE=0 to
 # OPT_FEATURE_FLAGS and sets LDFLAGS_PTHREAD to an empty string.
+#
+# It prepends the flags to the global LDFLAGS.
 proc sqlite-handle-threadsafe {} {
   msg-checking "Support threadsafe operation? "
   define LDFLAGS_PTHREAD ""
@@ -281,8 +257,10 @@ proc sqlite-handle-threadsafe {} {
     proj-if-opt-truthy threadsafe {
       if {[proj-check-function-in-lib pthread_create pthread]
           && [proj-check-function-in-lib pthread_mutexattr_init pthread]} {
-        set enable 1
-        define LDFLAGS_PTHREAD [get-define lib_pthread_create]
+        incr enable
+        set ldf [get-define lib_pthread_create]
+        define LDFLAGS_PTHREAD $ldf
+        teaish-prepend-ldflags $ldf
         undefine lib_pthread_create
         undefine lib_pthread_mutexattr_init
       } elseif {[proj-opt-was-provided threadsafe]} {
@@ -305,16 +283,16 @@ proc sqlite-handle-threadsafe {} {
     if {[string match *pthread* [get-define TCL_LIBS]]} {
       # ^^^ FIXME: there must be a better way of testing this
       set flagName "--threadsafe"
-      set lblAbled "en"
+      set lblAbled "enabled"
       set enable 1
       msg-result "yes"
     } else {
       set flagName "--disable-threadsafe"
-      set lblAbled "dis"
+      set lblAbled "disabled"
       set enable 0
       msg-result "no"
     }
-    msg-result "NOTICE: defaulting to ${flagName} because TCL has threading ${lblAbled}abled."
+    msg-result "NOTICE: defaulting to ${flagName} because TCL has threading ${lblAbled}."
     # ^^^ We don't need to link against -lpthread in the is-enabled case.
   }
   sqlite-add-feature-flag -DSQLITE_THREADSAFE=${enable}
@@ -342,7 +320,9 @@ proc sqlite-handle-load-extension {} {
   proj-if-opt-truthy load-extension {
     set found [proj-check-function-in-lib dlopen dl]
     if {$found} {
-      define LDFLAGS_DLOPEN [get-define lib_dlopen]
+      set ldf [get-define lib_dlopen]
+      define LDFLAGS_DLOPEN $ldf
+      teaish-prepend-ldflags $ldf
       undefine lib_dlopen
     } else {
       if {[proj-opt-was-provided load-extension]} {
@@ -461,6 +441,8 @@ proc sqlite-handle-icu {} {
       msg-result "Enabling ICU collations."
       sqlite-add-feature-flag -DSQLITE_ENABLE_ICU_COLLATIONS
     }
+    teaish-prepend-ldflags $ldflags
+    teaish-add-cflags $cflags
   } elseif {[opt-bool icu-collations]} {
     proj-warn "ignoring --enable-icu-collations because neither --with-icu-ldflags nor --with-icu-config provided any linker flags"
   } else {
diff --git a/manifest b/manifest
index b613f66bd2..3f476d195e 100644
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Update\steaish\sto\sthe\slatest\supstream\scopy.\sMove\ssome\sof\sits\sutility\scode\sinto\sproj.tcl\sfor\sreuse\sin\sthe\stop-level\sconfigure\sbits.
-D 2025-04-14T23:52:11.230
+C Slight\ssimplifications\sin\sthe\steaish\sbuild.
+D 2025-04-15T00:47:31.233
 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
@@ -26,14 +26,14 @@ F autoconf/tea/Makefile.in 2a90dfab1e95cb3ec610429c78d88d4a7d26beb080ad45ff6a059
 F autoconf/tea/README.txt 656d4686c509d375f5988ff3deda94f65fe6cd8358cd55d1f1dcc7b6e2ff73aa
 F autoconf/tea/auto.def 81e2617cfb90d53c19b53b3ec632cd2893bf32f2e5dd272b1116fadf2ea86c2d
 F autoconf/tea/autosetup/README.txt b40071e6f8506500a2f7f71d5fc69e0bf87b9d7678dd9da1e5b4d0acbf40b1ca
-F autoconf/tea/autosetup/core.tcl 2738997421c4fdcf52528af36db716993bb00425b10340a1e50143fe94048c46
-F autoconf/tea/autosetup/feature-tests.tcl 57bc056df24f7b5d54006598ee2cbdf234fea55e0d17f8c5f2b52a8d90095dbc
+F autoconf/tea/autosetup/core.tcl 3c012cc4b956c9aa867cedc6b9903c095c536de4a48d2acc43933ee3727446a2
+F autoconf/tea/autosetup/feature-tests.tcl 33202bd04d73f706fb7c7efad6866f45a9db0521748f7986506227a2fc48cd22
 F autoconf/tea/autosetup/tester.tcl d94aa9d51d2a22062e61db97310c2502ca0df50ca87108482c3bccf8f41db127
 F autoconf/tea/configure d0b12b984edca6030d1976375b80157ac78b5b90a5b4f0dcee39357f63f4a80b x
 F autoconf/tea/doc/sqlite3.n 9a97f4f717ceab73004ea412af7960625c1cb24b5c25e4ae4c8b5d8fa4300f4e
 F autoconf/tea/license.terms 13bd403c9610fd2b76ece0ab50c4c5eda933d523
 F autoconf/tea/pkgIndex.tcl.in 2c99a64a0eff5dc2ad8e9657bb564fae2dbdfdb6b77a4c49b4387bd5a25c42ef
-F autoconf/tea/teaish.tcl 76bcea8d44543f085084b6662219f0534e7513374a82d6aaa6f9c7c7e1acca58
+F autoconf/tea/teaish.tcl be716d0d4ecf71672c1977b6c62bd473d09033c6d6a9f3171c36838644d4f81d
 F autoconf/tea/teaish.test.tcl cfe94e1fb79dd078f650295be59843d470125e0cc3a17a1414c1fb8d77f4aea6
 F autoconf/tea/teaish.tester.tcl.in 743fd0fe1e667f82fd8fc3ebe0a5c77763e4dbed7bbc8605a9d4b1d0663dac78
 F autosetup/LICENSE 41a26aebdd2cd185d1e2b210f71b7ce234496979f6b35aef2cbf6b80cbed4ce4
@@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350
 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 92513f6bce7ecc778e78af3a77bc66ff65585fffa2e3138f8acb9e617121eeb0
-R 885261e686c805e49dc78c31644a054a
+P 921c5ea76925be911222ac5f2887b8a967ff47b1aa43e196231e6168a3f9cb88
+R ad57ad0cbc680b95f0767a618309fa99
 U stephan
-Z 68c2318b2d8a42399b7b82112788ad28
+Z 7b2b40b6cb214032eb81bf29106563a7
 # Remove this line to create a well-formed Fossil manifest.
diff --git a/manifest.uuid b/manifest.uuid
index de64e8eecb..577271d26e 100644
--- a/manifest.uuid
+++ b/manifest.uuid
@@ -1 +1 @@
-921c5ea76925be911222ac5f2887b8a967ff47b1aa43e196231e6168a3f9cb88
+6b2d0e09e4806b5731764192782ec7e1ad595c529202a684d23bcfe2fae559d7

From 56da8772bdd414e68cdb6b79ca6a761418e09e06 Mon Sep 17 00:00:00 2001
From: stephan 
Date: Tue, 15 Apr 2025 02:02:36 +0000
Subject: [PATCH 104/120] Further cleanups and code consolidation between
 teaish.tcl and sqlite-config.tcl parts.

FossilOrigin-Name: 07e9ceee51380ee25e580178fa82030be5d2b65d4f4b4dc86c94b21f7f04f291
---
 autoconf/tea/autosetup/core.tcl          | 61 ++-------------------
 autoconf/tea/autosetup/feature-tests.tcl |  2 +-
 autoconf/tea/teaish.tcl                  | 33 +++++------
 autosetup/proj.tcl                       | 70 +++++++++++++++++++-----
 autosetup/sqlite-config.tcl              | 15 ++---
 manifest                                 | 20 +++----
 manifest.uuid                            |  2 +-
 7 files changed, 94 insertions(+), 109 deletions(-)

diff --git a/autoconf/tea/autosetup/core.tcl b/autoconf/tea/autosetup/core.tcl
index a4e74d8420..ad7e942e54 100644
--- a/autoconf/tea/autosetup/core.tcl
+++ b/autoconf/tea/autosetup/core.tcl
@@ -45,12 +45,6 @@ array set teaish__Config [proj-strip-hash-comments {
   # 0x10 = teaish-pragma was called: use their pkgIndex.tcl
   #
   pkgindex-policy 0
-
-  #
-  # A list of lists of Autosetup [options]-format --flags definitions.
-  # Append to this using [teaish-add-options].
-  #
-  extra-options {}
 }]
 
 #
@@ -110,7 +104,7 @@ proc teaish-configure-core {} {
   #
   # Set up the --flags...
   #
-  set opts [proj-strip-hash-comments {
+  proj-options-add [proj-strip-hash-comments {
     with-tcl:DIR
       => {Directory containing tclConfig.sh or a directory one level up from
           that, from which we can derive a directory containing tclConfig.sh.}
@@ -154,23 +148,14 @@ proc teaish-configure-core {} {
 
     t-d
     teaish-debug => {Enable teaish-specific debug output}
-  }]; # $opts
+  }]; # main options.
 
-  #
-  # Create the full options list from:
-  # 1) $opts
-  # 2) [teaish-options], if defined
-  # 3) $::teaish__Config(exta-options)
-  #
-  set optLists [list $opts]
   if {[llength [info proc teaish-options]] > 0} {
-    # teaish-options is assumed to be imported via TEAISH_TCL.
-    lappend optLists [teaish-options]
+    # Add options defined by teaish-options, which is assumed to be
+    # imported via TEAISH_TCL.
+    proj-options-add [teaish-options]
   }
-  lappend optLists {*}$::teaish__Config(extra-options)
-  set opts [teaish-combine-option-lists {*}$optLists]
-  unset optLists
-
+  set opts [proj-options-combine]
   #lappend opts teaish-debug => {x}; #testing dupe entry handling
   if {[catch {options $opts} msg xopts]} {
     # Workaround for 
@@ -992,40 +977,6 @@ proc teaish-feature-cache-check {{depth 0} tgtVar} {
   return 0
 }
 
-# @teach-add-options list
-#
-# Adds a list of options to the pending --flag processing.  It must be
-# in the format used by Autosetup's [options] function.
-#
-# This will have no effect if called from [teaish-configure],
-# as the flags processing is done by the time that is called.
-#
-# This may be used from the top scope of teaish.tcl or from
-# [teaish-options]. When used in conjunction with [teaish-options],
-# [teaish-options] will appear first in the --help list.
-#
-proc teaish-add-options {list} {
-  lappend ::teaish__Config(extra-options) $list
-}
-
-# @teash-combine-option-lists list1 ?...listN?
-#
-# Expects each argument to be a list of options compatible with
-# autosetup's [options] function. This function concatenates the
-# contents of each list into a new top-level list, stripping the outer
-# list part of each argument. The intent is that teaish-options
-# implementations can use this to combine multiple lists, e.g. from
-# functions teaish-check-openssl-options.
-proc teaish-combine-option-lists {args} {
-  set rv [list]
-  foreach e $args {
-    foreach x $e {
-      lappend rv $x
-    }
-  }
-  return $rv
-}
-
 ########################################################################
 # Internal helper for teaish__defs-format_: returns a JSON-ish quoted
 # form of the given string-type values. It only performs the most
diff --git a/autoconf/tea/autosetup/feature-tests.tcl b/autoconf/tea/autosetup/feature-tests.tcl
index 5f045eae09..b2f9d84660 100644
--- a/autoconf/tea/autosetup/feature-tests.tcl
+++ b/autoconf/tea/autosetup/feature-tests.tcl
@@ -235,7 +235,7 @@ proc teaish-import-features {args} {
     if {$doOpt} {
       set n "teaish-check-${arg}-options"
       if {[llength [info proc $n]] > 0} {
-        teaish-add-options [$n]
+        proj-options-add [$n]
       }
     }
   }
diff --git a/autoconf/tea/teaish.tcl b/autoconf/tea/teaish.tcl
index ae4f6c7b7c..049f500020 100644
--- a/autoconf/tea/teaish.tcl
+++ b/autoconf/tea/teaish.tcl
@@ -103,7 +103,8 @@ proc teaish-configure {} {
     teaish-add-ldflags -lsqlite3
   }
 
-  sqlite-check-common-system-deps
+  teaish-check-librt
+  teaish-check-libz
   sqlite-handle-threadsafe
   sqlite-handle-tempstore
   sqlite-handle-load-extension
@@ -111,7 +112,6 @@ proc teaish-configure {} {
   sqlite-handle-icu
 
   sqlite-handle-common-feature-flags; # must be late in the process
-  teaish-add-cflags -define OPT_FEATURE_FLAGS
 }; # teaish-configure
 
 
@@ -136,8 +136,13 @@ proc sqlite-affirm-have-math {featureName} {
     if {![msg-quiet proj-check-function-in-lib log m]} {
       user-error "Missing math APIs for $featureName"
     }
-    define LDFLAGS_MATH [get-define lib_log ""]
+    set lfl [get-define lib_log ""]
     undefine lib_log
+    if {"" ne $lfl} {
+      user-notice "Forcing requirement of $lfl for $featureName"
+    }
+    define LDFLAGS_MATH $lfl
+    teaish-prepend-ldflags $lfl
   }
 }
 
@@ -215,13 +220,9 @@ proc sqlite-handle-common-feature-flags {} {
     }
   }
 
-  sqlite-finalize-feature-flags
-}
-
-#########################################################################
-# Remove duplicates from the final feature flag sets and show them to
-# the user.
-proc sqlite-finalize-feature-flags {} {
+  #########################################################################
+  # Remove duplicates from the final feature flag sets and show them
+  # to the user.
   set oFF [get-define OPT_FEATURE_FLAGS]
   if {"" ne $oFF} {
     define OPT_FEATURE_FLAGS [lsort -unique $oFF]
@@ -230,16 +231,8 @@ proc sqlite-finalize-feature-flags {} {
   if {[lsearch [get-define TARGET_DEBUG ""] -DSQLITE_DEBUG=1] > -1} {
     msg-result "Note: this is a debug build, so performance will suffer."
   }
-}
-
-########################################################################
-# Run checks for system-level includes and libs which are common to
-# both the canonical build and the "autoconf" bundle.
-#
-proc sqlite-check-common-system-deps {} {
-  teaish-check-librt
-  teaish-check-libz
-}
+  teaish-add-cflags -define OPT_FEATURE_FLAGS
+}; # sqlite-handle-common-feature-flags
 
 ########################################################################
 # If --enable-threadsafe is set, this adds -DSQLITE_THREADSAFE=1 to
diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl
index 296652279f..d64cc62186 100644
--- a/autosetup/proj.tcl
+++ b/autosetup/proj.tcl
@@ -55,9 +55,10 @@
 # @section Project Helper APIs
 
 ########################################################################
-# $proj_ is an internal-use-only array for storing whatever generic
+# $proj__Config is an internal-use-only array for storing whatever generic
 # internal stuff we need stored.
-array set proj_ {}
+array set proj__Config {
+}
 #
 # List of dot-in files to filter in the final stages of
 # configuration. Some configuration steps may append to this.  Each
@@ -67,8 +68,15 @@ array set proj_ {}
 #
 # See: proj-dot-ins-append and proj-dot-ins-process
 #
-set proj_(dot-in-files) [list]
-set proj_(isatty) [isatty? stdout]
+set proj__Config(dot-in-files) [list]
+set proj__Config(isatty) [isatty? stdout]
+#
+# A list of lists of Autosetup [options]-format --flags definitions.
+# Append to this using [proj-options-add] and use
+# [proj-options-combine] to merge them into a single list for passing
+# to [options].
+#
+set proj__Config(extra-options} {}
 
 ########################################################################
 # @proj-warn msg
@@ -118,7 +126,7 @@ proc proj-assert {script {msg ""}} {
 # ANSI escape sequences then this returns $str wrapped in a sequence
 # to bold that text, else it returns $str as-is.
 proc proj-bold {args} {
-  if {$::autosetup(iswin) || !$::proj_(isatty)} {
+  if {$::autosetup(iswin) || !$::proj__Config(isatty)} {
     return $str
   }
   return "\033\[1m${args}\033\[0m"
@@ -1147,16 +1155,16 @@ proc proj-quote-str_ {value} {
 ########################################################################
 # An internal impl detail of proj-dump-defs-json. Requires a data
 # type specifier, as used by make-config-header, and a value. Returns
-# the formatted value or the value $::proj_(defs-skip) if the caller
+# the formatted value or the value $::proj__Config(defs-skip) if the caller
 # should skip emitting that value.
-set proj_(defs-skip) "-proj-defs-format_ sentinel"
+set proj__Config(defs-skip) "-proj-defs-format_ sentinel"
 proc proj-defs-format_ {type value} {
   switch -exact -- $type {
     -bare {
       # Just output the value unchanged
     }
     -none {
-      set value $::proj_(defs-skip)
+      set value $::proj__Config(defs-skip)
     }
     -str {
       set value [proj-quote-str_ $value]
@@ -1171,14 +1179,14 @@ proc proj-defs-format_ {type value} {
       set ar {}
       foreach v $value {
         set v [proj-defs-format_ -auto $v]
-        if {$::proj_(defs-skip) ne $v} {
+        if {$::proj__Config(defs-skip) ne $v} {
           lappend ar $v
         }
       }
       set value "\[ [join $ar {, }] \]"
     }
     "" {
-      set value $::proj_(defs-skip)
+      set value $::proj__Config(defs-skip)
     }
     default {
       proj-fatal "Unknown type in proj-dump-defs-json: $type"
@@ -1224,7 +1232,7 @@ proc proj-dump-defs-json {file args} {
   foreach n [lsort [dict keys [all-defines]]] {
     set type [proj-defs-type_ $n $args]
     set value [proj-defs-format_ $type [get-define $n]]
-    if {$::proj_(defs-skip) ne $value} {
+    if {$::proj__Config(defs-skip) ne $value} {
       lappend lines "\"$n\": ${value}"
     }
   }
@@ -1564,7 +1572,7 @@ proc proj-dot-ins-append {fileIn args} {
     }
   }
   #puts "******* [proj-current-scope]: adding $fileIn"
-  lappend ::proj_(dot-in-files) $fileIn
+  lappend ::proj__Config(dot-in-files) $fileIn
 }
 
 ########################################################################
@@ -1574,7 +1582,7 @@ proc proj-dot-ins-append {fileIn args} {
 # that each entry is a 3-element list of (inputFileName,
 # outputFileName, postProcessScript).
 proc proj-dot-ins-list {} {
-  return $::proj_(dot-in-files)
+  return $::proj__Config(dot-in-files)
 }
 
 ########################################################################
@@ -1610,7 +1618,7 @@ proc proj-dot-ins-process {args} {
       default   break
     }
   }
-  foreach f $::proj_(dot-in-files) {
+  foreach f $::proj__Config(dot-in-files) {
     proj-assert {3==[llength $f]} \
       "Expecting proj-dot-ins-list to be stored in 3-entry lists"
     lassign $f fIn fOut fScript
@@ -1624,7 +1632,7 @@ proc proj-dot-ins-process {args} {
     }
   }
   if {$clear} {
-    set ::proj_(dot-in-files) [list]
+    set ::proj__Config(dot-in-files) [list]
   }
 }
 
@@ -1747,6 +1755,7 @@ proc proj-define-amend {defName args} {
       lappend xargs [get-define $arg ""]
     }
   }
+
   set args $xargs
   if {$prepend} {
     lappend args {*}[get-define $defName ""]
@@ -1755,3 +1764,34 @@ proc proj-define-amend {defName args} {
     proj-define-append $defName {*}$args
   }
 }
+
+# @proj-options-add list
+#
+# Adds a list of options to the pending --flag processing.  It must be
+# in the format used by Autosetup's [options] function.
+#
+# This will have no useful effect if called from after [options]
+# is called.
+proc proj-options-add {list} {
+  lappend ::proj__Config(extra-options) $list
+}
+
+# @proj-options-combine list1 ?...listN?
+#
+# Expects each argument to be a list of options compatible with
+# autosetup's [options] function. This function concatenates the
+# contents of each list into a new top-level list, stripping the outer
+# list part of each argument, and returning that list
+#
+# If passed no arguments, it uses the list generated by calls to
+# [proj-options-add].
+proc proj-options-combine {args} {
+  set rv [list]
+  if {0 == [llength $args]} {
+    set args $::proj__Config(extra-options)
+  }
+  foreach e $args {
+      lappend rv {*}$e
+  }
+  return $rv
+}
diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl
index 3042b7bedb..1bd5a184ee 100644
--- a/autosetup/sqlite-config.tcl
+++ b/autosetup/sqlite-config.tcl
@@ -425,17 +425,14 @@ proc sqlite-configure {buildMode configScript} {
   }
 
   # Filter allFlags to create the set of [options] legal for this build
-  set opts {}
-  foreach {group XY} [subst -nobackslashes -nocommands \
-                        [proj-strip-hash-comments $allFlags]] {
+  foreach {group XY} [subst -nobackslashes -nocommands $allFlags] {
     foreach {X Y} $XY {
       if { $buildMode in $X || "*" in $X } {
-        foreach y $Y {
-          lappend opts $y
-        }
+        proj-options-add $Y
       }
     }
   }
+  set opts [proj-options-combine]
   #lappend opts "soname:=duplicateEntry => {x}"; #just testing
   if {[catch {options $opts} msg xopts]} {
     # Workaround for 
@@ -585,8 +582,12 @@ proc sqlite-affirm-have-math {featureName} {
     if {![msg-quiet proj-check-function-in-lib log m]} {
       user-error "Missing math APIs for $featureName"
     }
-    define LDFLAGS_MATH [get-define lib_log ""]
+    set lfl [get-define lib_log ""]
     undefine lib_log
+    if {"" ne $lfl} {
+      user-notice "Forcing requirement of $lfl for $featureName"
+    }
+    define LDFLAGS_MATH $lfl
   }
 }
 
diff --git a/manifest b/manifest
index 3f476d195e..7e007c9d1a 100644
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Slight\ssimplifications\sin\sthe\steaish\sbuild.
-D 2025-04-15T00:47:31.233
+C Further\scleanups\sand\scode\sconsolidation\sbetween\steaish.tcl\sand\ssqlite-config.tcl\sparts.
+D 2025-04-15T02:02:36.015
 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
@@ -26,14 +26,14 @@ F autoconf/tea/Makefile.in 2a90dfab1e95cb3ec610429c78d88d4a7d26beb080ad45ff6a059
 F autoconf/tea/README.txt 656d4686c509d375f5988ff3deda94f65fe6cd8358cd55d1f1dcc7b6e2ff73aa
 F autoconf/tea/auto.def 81e2617cfb90d53c19b53b3ec632cd2893bf32f2e5dd272b1116fadf2ea86c2d
 F autoconf/tea/autosetup/README.txt b40071e6f8506500a2f7f71d5fc69e0bf87b9d7678dd9da1e5b4d0acbf40b1ca
-F autoconf/tea/autosetup/core.tcl 3c012cc4b956c9aa867cedc6b9903c095c536de4a48d2acc43933ee3727446a2
-F autoconf/tea/autosetup/feature-tests.tcl 33202bd04d73f706fb7c7efad6866f45a9db0521748f7986506227a2fc48cd22
+F autoconf/tea/autosetup/core.tcl 87051761ee1bb11df381751e656f3d86feac3f281e539ec4442ffc4c2758f2f8
+F autoconf/tea/autosetup/feature-tests.tcl f594efeb43fe1d83599367ac388082a1d47be28322591a1d9d29214039df2094
 F autoconf/tea/autosetup/tester.tcl d94aa9d51d2a22062e61db97310c2502ca0df50ca87108482c3bccf8f41db127
 F autoconf/tea/configure d0b12b984edca6030d1976375b80157ac78b5b90a5b4f0dcee39357f63f4a80b x
 F autoconf/tea/doc/sqlite3.n 9a97f4f717ceab73004ea412af7960625c1cb24b5c25e4ae4c8b5d8fa4300f4e
 F autoconf/tea/license.terms 13bd403c9610fd2b76ece0ab50c4c5eda933d523
 F autoconf/tea/pkgIndex.tcl.in 2c99a64a0eff5dc2ad8e9657bb564fae2dbdfdb6b77a4c49b4387bd5a25c42ef
-F autoconf/tea/teaish.tcl be716d0d4ecf71672c1977b6c62bd473d09033c6d6a9f3171c36838644d4f81d
+F autoconf/tea/teaish.tcl 2661246d497e263ed05f436421758c5035ad1fc3a1c7484f6484844b61281913
 F autoconf/tea/teaish.test.tcl cfe94e1fb79dd078f650295be59843d470125e0cc3a17a1414c1fb8d77f4aea6
 F autoconf/tea/teaish.tester.tcl.in 743fd0fe1e667f82fd8fc3ebe0a5c77763e4dbed7bbc8605a9d4b1d0663dac78
 F autosetup/LICENSE 41a26aebdd2cd185d1e2b210f71b7ce234496979f6b35aef2cbf6b80cbed4ce4
@@ -51,8 +51,8 @@ F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e
 F autosetup/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1821baf61bc86a7e
 F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049
 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba
-F autosetup/proj.tcl 9de1b0fbc76dd22d447cd10c7a5f07c8aafef258a87c52c67687fb1e91fc3d58
-F autosetup/sqlite-config.tcl 3f771754b89ae10379bb5d9d48d80921568345618f8f37d4a62a8e1fd9cd916c
+F autosetup/proj.tcl 4902c308f0b8fe8d734247f38253aa0cf46fee63834074b2b0ff90d092b4add0
+F autosetup/sqlite-config.tcl d4e888fc94e677e3820fea998747c94b8dcc4ff346a14253bf7f5344f526ceef
 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9
 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x
 F contrib/sqlitecon.tcl eb4c6578e08dd353263958da0dc620f8400b869a50d06e271ab0be85a51a08d3
@@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350
 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 921c5ea76925be911222ac5f2887b8a967ff47b1aa43e196231e6168a3f9cb88
-R ad57ad0cbc680b95f0767a618309fa99
+P 6b2d0e09e4806b5731764192782ec7e1ad595c529202a684d23bcfe2fae559d7
+R 459786ce4af7bd9d29b2d98508f1ac93
 U stephan
-Z 7b2b40b6cb214032eb81bf29106563a7
+Z 6395a8a08ae56770c6a7b258189df8f5
 # Remove this line to create a well-formed Fossil manifest.
diff --git a/manifest.uuid b/manifest.uuid
index 577271d26e..d7ed4d8e80 100644
--- a/manifest.uuid
+++ b/manifest.uuid
@@ -1 +1 @@
-6b2d0e09e4806b5731764192782ec7e1ad595c529202a684d23bcfe2fae559d7
+07e9ceee51380ee25e580178fa82030be5d2b65d4f4b4dc86c94b21f7f04f291

From 136afcfcc1d12f7b9f3908d48a7c4f9ffedf727b Mon Sep 17 00:00:00 2001
From: dan 
Date: Tue, 15 Apr 2025 11:06:37 +0000
Subject: [PATCH 105/120] Avoid a potential integer overflow in non-default
 builds of the fts3 matchinfo() function.

FossilOrigin-Name: aecc0100cef3ea83feed558dbe34dd6313721fa54052ee1ed529741cec8cacda
---
 ext/fts3/fts3_snippet.c |  6 +++---
 manifest                | 14 +++++++-------
 manifest.uuid           |  2 +-
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/ext/fts3/fts3_snippet.c b/ext/fts3/fts3_snippet.c
index 36ee94a48b..9c7f0ade97 100644
--- a/ext/fts3/fts3_snippet.c
+++ b/ext/fts3/fts3_snippet.c
@@ -1027,16 +1027,16 @@ static size_t fts3MatchinfoSize(MatchInfo *pInfo, char cArg){
       break;
 
     case FTS3_MATCHINFO_LHITS:
-      nVal = pInfo->nCol * pInfo->nPhrase;
+      nVal = (size_t)pInfo->nCol * pInfo->nPhrase;
       break;
 
     case FTS3_MATCHINFO_LHITS_BM:
-      nVal = pInfo->nPhrase * ((pInfo->nCol + 31) / 32);
+      nVal = (size_t)pInfo->nPhrase * ((pInfo->nCol + 31) / 32);
       break;
 
     default:
       assert( cArg==FTS3_MATCHINFO_HITS );
-      nVal = pInfo->nCol * pInfo->nPhrase * 3;
+      nVal = (size_t)pInfo->nCol * pInfo->nPhrase * 3;
       break;
   }
 
diff --git a/manifest b/manifest
index 7e007c9d1a..4a867fff84 100644
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Further\scleanups\sand\scode\sconsolidation\sbetween\steaish.tcl\sand\ssqlite-config.tcl\sparts.
-D 2025-04-15T02:02:36.015
+C Avoid\sa\spotential\sinteger\soverflow\sin\snon-default\sbuilds\sof\sthe\sfts3\smatchinfo()\sfunction.
+D 2025-04-15T11:06:37.142
 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
@@ -89,7 +89,7 @@ F ext/fts3/fts3_hash.c d9dba473741445789330c7513d4f65737c92df23c3212784312931641
 F ext/fts3/fts3_hash.h 39cf6874dc239d6b4e30479b1975fe5b22a3caaf
 F ext/fts3/fts3_icu.c 305ce7fb6036484085b5556a9c8e62acdc7763f0f4cdf5fd538212a9f3720116
 F ext/fts3/fts3_porter.c 024417020c57dd1ab39816f5fe6cf45222a857b78a1f6412f040ada1ceabd4ff
-F ext/fts3/fts3_snippet.c 55506af9c656d06ad6acef0735b67749d199617421f2e66c5b7101745b9cf1ba
+F ext/fts3/fts3_snippet.c 627d564878f82479ee3e040c89fb15aebf691d81e11c8e451241033c02b9810d
 F ext/fts3/fts3_term.c 6a96027ad364001432545fe43322b6af04ed28bb5619ec51af1f59d0710d6d69
 F ext/fts3/fts3_test.c cc329471e573f95a6ea9fbca87e89dcfa1d355591c80172ffcd759ac521d25d8
 F ext/fts3/fts3_tokenize_vtab.c 66eba6c2baa04b2b15e80d68341b8fd0b4d3831f6b2edb33916a2906ff2d4389
@@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350
 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 6b2d0e09e4806b5731764192782ec7e1ad595c529202a684d23bcfe2fae559d7
-R 459786ce4af7bd9d29b2d98508f1ac93
-U stephan
-Z 6395a8a08ae56770c6a7b258189df8f5
+P 07e9ceee51380ee25e580178fa82030be5d2b65d4f4b4dc86c94b21f7f04f291
+R 84dac09860d04f3b89dac3e5a6e35be6
+U dan
+Z fa2be2a8c187a7c531361e66a41cdaca
 # Remove this line to create a well-formed Fossil manifest.
diff --git a/manifest.uuid b/manifest.uuid
index d7ed4d8e80..3b0c6fc0db 100644
--- a/manifest.uuid
+++ b/manifest.uuid
@@ -1 +1 @@
-07e9ceee51380ee25e580178fa82030be5d2b65d4f4b4dc86c94b21f7f04f291
+aecc0100cef3ea83feed558dbe34dd6313721fa54052ee1ed529741cec8cacda

From 850289bf1e3bb5916f2acdcd00a6e7baf11940c7 Mon Sep 17 00:00:00 2001
From: stephan 
Date: Tue, 15 Apr 2025 15:20:30 +0000
Subject: [PATCH 106/120] Cleanups and refactoring in proj.tcl and teaish.

FossilOrigin-Name: 6b7ca8176e8c1b5e99e177c3daaba47b0674fa2f82d91754e7a8f66460ca8419
---
 autoconf/tea/autosetup/core.tcl          | 332 +++++++++++++----------
 autoconf/tea/autosetup/feature-tests.tcl |  59 ----
 autosetup/proj.tcl                       | 102 +++++++
 manifest                                 |  18 +-
 manifest.uuid                            |   2 +-
 5 files changed, 298 insertions(+), 215 deletions(-)

diff --git a/autoconf/tea/autosetup/core.tcl b/autoconf/tea/autosetup/core.tcl
index ad7e942e54..c265e50a58 100644
--- a/autoconf/tea/autosetup/core.tcl
+++ b/autoconf/tea/autosetup/core.tcl
@@ -27,9 +27,9 @@ define TEAISH_VERSION 0.1-beta
 use system ; # Will output "Host System" and "Build System" lines
 if {"--help" ni $::argv} {
   proj-tweak-default-env-dirs
-  msg-result "Source dir  = $::autosetup(srcdir)"
-  msg-result "Build dir   = $::autosetup(builddir)"
   msg-result "TEA(ish) Version = [get-define TEAISH_VERSION]"
+  msg-result "Source dir    = $::autosetup(srcdir)"
+  msg-result "Build dir     = $::autosetup(builddir)"
 }
 
 #
@@ -38,23 +38,25 @@ array set teaish__Config [proj-strip-hash-comments {
   # set to 1 to enable some internal debugging output
   debug-enabled 0
   #
-  # 0    = default
-  # 0x01 = teaish__find-extension found input in TEAISH_DIR
-  # 0x02 = teaish__find-extension found input in srcdir
-  # 0x04 = teaish__find-extension found output file but no input
-  # 0x10 = teaish-pragma was called: use their pkgIndex.tcl
+  # 0    = don't yet have extension's pkgindex
+  # 0x01 = teaish__find_extension found TEAISH_DIR/pkgindex.tcl
+  # 0x02 = teaish__find_extension found srcdir/pkgindex.tcl.in
+  # 0x04 = teaish__find_extension found TEAISH_DIR/pkgindex.tcl (static file)
+  # 0x10 = teaish-pragma was called: behave as if 0x04
   #
   pkgindex-policy 0
 }]
 
 #
-# Returns true if any arg in $::argv matches the given glob, else
-# returns false.
+# Returns true if any arg in $::argv matches any of the given globs,
+# else returns false.
 #
-proc teaish__argv-has {glob} {
-  foreach arg $::argv {
-    if {[string match $glob $arg]} {
-      return 1
+proc teaish__argv_has {args} {
+  foreach glob $args {
+    foreach arg $::argv {
+      if {[string match $glob $arg]} {
+        return 1
+      }
     }
   }
   return 0
@@ -66,26 +68,27 @@ proc teaish__argv-has {glob} {
 #
 proc teaish-configure-core {} {
   #
-  # "Declare" some defines for potential later use.
+  # "Declare" some defines...
   #
   foreach {f v} {
     TEAISH_MAKEFILE ""
     TEAISH_MAKEFILE_IN ""
+    TEAISH_DIST_FILES ""
+    TEAISH_PKGINIT_TCL ""
+    TEAISH_PKGINIT_TCL_IN ""
+    TEAISH_PKGINDEX_TCL_IN ""
+    TEAISH_PKGINDEX_TCL ""
     TEAISH_TCL ""
     TEAISH_CFLAGS ""
     TEAISH_LDFLAGS ""
     TEAISH_SRC ""
-    TEAISH_DIST_FILES ""
-    TEAISH_PKGINIT_TCL ""
-    TEAISH_PKGINDEX_TCL_IN ""
-    TEAISH_PKGINDEX_TCL ""
-    EXTRA_CFLAGS ""
   } {
     define $f $v
   }
 
   set gotExt 0; # True if an extension config is found
-  if {![teaish__argv-has --teaish-create-extension*]} {
+  if {![teaish__argv_has --teaish-create-extension* --t-c-e*]} {
+    # Don't look for an extension if we're in --t-c-e mode
     set gotExt [teaish__find-extension]
   }
 
@@ -177,7 +180,7 @@ proc teaish-configure-core {} {
   set ::teaish__Config(debug-enabled) [opt-bool teaish-debug]
 
   if {[proj-opt-was-provided teaish-create-extension]} {
-    teaish__create-extension [opt-val teaish-create-extension]
+    teaish__create_extension [opt-val teaish-create-extension]
     return
   }
   proj-assert {1==$gotExt} "Else we cannot have gotten this far"
@@ -305,7 +308,7 @@ proc teaish__configure-finalize {} {
   #
   # Ensure we have a pkgIndex.tcl and don't have a stale generated one
   # when rebuilding for different --with-tcl=... values. Also take
-  # care not to nuke it if pkgindex-policy is 1.
+  # care not to nuke it if pkgindex-policy is 0x10.
   #
   apply {{} {
     set policy $::teaish__Config(pkgindex-policy);
@@ -313,7 +316,6 @@ proc teaish__configure-finalize {} {
     if {$policy & 0x10} {
       # teaish-pragma --have-own-pkgIndex.tcl override. This means
       # we have a static/non-generated pkgIndex.tcl.
-      define TEAISH_PKGINDEX_TCL_IN ""
       set tpt [get-define TEAISH_PKGINDEX_TCL ""]
       if {"" eq $tpt} {
         set tpt [file join [get-define TEAISH_DIR] pkgIndex.tcl]
@@ -321,11 +323,11 @@ proc teaish__configure-finalize {} {
       }
       set src $tpt
     } elseif {$policy & 0x04} {
-      # Found output file in TEAISH_DIR but no input file, so
+      # Found TEAISH_DIR/pkgIndex.tcl but no pkgIndex.tcl.in, so
       # assume it's a hand-written one.
       set src [get-define TEAISH_PKGINDEX_TCL]
     } elseif {$policy} {
-      # Found input pkgIndex.tcl.in TEAISH_DIR or srcdir
+      # Found one of {TEAISH_DIR,srcdir}/pkgIndex.tcl.in
       set src [get-define TEAISH_PKGINDEX_TCL_IN]
     } else {
       proj-fatal "Cannot determine the pkgIndex.tcl to use"
@@ -602,77 +604,50 @@ proc teaish__find-extension {} {
   # be loaded before [options] is run (so that the extension can
   # inject its own options).
   #
-  set largv {}; # rewritten $::argv
   set extM ""; # teaish.make.in
   set extT ""; # teaish.tcl
-  set lambdaM {{f} {
-    if {[file isdir $f]} {
-      set f [file join $f teaish.make.in]
-    }
-    if {[file readable $f]} {
-      return [file-normalize $f]
+  # Helper for the foreach loop below.
+  set lambdaMT {{mustHave fid dir} {
+    if {[file isdir $dir]} {
+      set f [file join $dir $fid]
+      if {[file readable $f]} {
+        return [file-normalize $f]
+      } elseif {$mustHave} {
+        proj-fatal "Missing required $dir/$fid"
+      }
+    } elseif {$mustHave} {
+      proj-fatal "--teaish-extension-dir=$dir does not reference a directory"
     }
     return ""
   }}
-  set lambdaT {{f} {
-    if {[file isdir $f]} {
-      set f [file join $f teaish.tcl]
-    }
-    if {![file readable $f]} {
-      proj-fatal "extension tcl file is not readable: $f"
-    }
-    return [file-normalize $f]
-  }}
-#  set gotNonFlag 0
+  set largv {}; # rewritten $::argv
   foreach arg $::argv {
     #puts "*** arg=$arg"
     switch -glob -- $arg {
       --ted=* -
       --t-e-d=* -
       --teaish-extension-dir=* {
+        # Ensure that $extD refers to a directory and contains a
+        # teaish.tcl.
         regexp -- {--[^=]+=(.+)} $arg - extD
         set extD [file-normalize $extD]
         if {![file isdir $extD]} {
           proj-fatal "--teaish-extension-dir value is not a directory: $extD"
         }
-        set extM [apply $lambdaM [file join $extD teaish.make.in]]
-        set extT [apply $lambdaT [file join $extD teaish.tcl]]
+        set extM [apply $lambdaMT 0 teaish.make.in $extD]
+        set extT [apply $lambdaMT 1 teaish.tcl $extD]
         define TEAISH_DIR $extD
       }
       default {
-        # We'd like to treat the first non-flag argument as
-        # --teaish-extension-dir, but autosetup does not accept args
-        # except in the form --flag or X=Y
         lappend largv $arg
-#
-#      --* {
-#        lappend largv $arg
-#      }
-#      default {
-#        if {$gotNonFlag || "" ne $extT} {
-#          lappend largv $arg
-#        } else {
-#          incr gotNonFlag
-#          msg-checking "Treating fist non-flag argument as --teaish-extension-dir ... "
-#          if {[catch [set extD [file-normalize $arg]]]} {
-#            msg-result "dir name not normalizable: $arg"
-#            lappend largv $arg
-#          } else {
-#            set extM [apply $lambdaM [file join $arg teaish.make.in]]
-#            set extT [apply $lambdaT [file join $arg teaish.tcl]]
-#            define TEAISH_DIR $extD
-#            msg-result "$arg"
-#          }
-#        }
-#      }
       }
     }
   }
   set ::argv $largv
-  set dbld $::autosetup(builddir); # dir we're configuring under
-  set dsrc $::autosetup(srcdir);   # where teaish's configure script lives
-  set dext [get-define TEAISH_DIR $dbld] ; # dir with the extension
-  set extEqSrc [expr {$dext eq $dsrc}]   ; # are we building in-tree vis-a-vis teaish core?
+  set dirBld $::autosetup(builddir); # dir we're configuring under
+  set dirSrc $::autosetup(srcdir);   # where teaish's configure script lives
+  set dirExt [get-define TEAISH_DIR $dirBld] ; # dir with the extension
+  set extEqSrc [expr {$dirExt eq $dirSrc}]   ; # are we building in-tree vis-a-vis teaish core?
 
   #
   # teaish.tcl is a TCL script which implements various
@@ -681,33 +656,34 @@ proc teaish__find-extension {} {
   # We use the first one we find in the builddir or srcdir.
   #
   if {"" eq $extT} {
-    set flist [list $dext/teaish.tcl]
+    set flist [list $dirExt/teaish.tcl]
     if {!$extEqSrc} {
-      lappend flist $dsrc/teaish.tcl
+      lappend flist $dirSrc/teaish.tcl
     }
     if {![proj-first-file-found $flist extT]} {
       if {"--help" in $::argv} {
-        return 0
+        return 0; # signals teaish-configure-core to process --help
       }
       proj-indented-notice -error "
 Did not find any of: $flist
 
-If you are attempting an out-of-tree build, be sure to
-use --teaish-extension-dir=/path/to/extension"
+If you are attempting an out-of-tree build, use
+ --teaish-extension-dir=/path/to/extension"
     }
   }
   if {![file readable $extT]} {
     proj-fatal "extension tcl file is not readable: $extT"
   }
-  msg-result "Extension config           = $extT"
   define TEAISH_TCL $extT
   if {"" eq [get-define TEAISH_DIR ""]} {
     # If this wasn't set via --teaish-extension-dir then derive it from
     # $extT.
-    #puts "extT=$extT dext=$dext"
-    set dext [file dirname $extT]
-    define TEAISH_DIR $dext
+    #puts "extT=$extT dirExt=$dirExt"
+    set dirExt [file dirname $extT]
+    define TEAISH_DIR $dirExt
   }
+  msg-result "Extension dir            = [get-define TEAISH_DIR]"
+  msg-result "Extension config         = $extT"
 
   #
   # teaish.make provides some of the info for the main makefile,
@@ -717,9 +693,9 @@ use --teaish-extension-dir=/path/to/extension"
   # the builddir or the srcdir.
   #
   if {"" eq $extM} {
-    set flist [list $dext/teaish.make.in]
+    set flist [list $dirExt/teaish.make.in]
     if {!$extEqSrc} {
-      lappend flist $dsrc/teaish.make.in
+      lappend flist $dirSrc/teaish.make.in
     }
     proj-first-file-found $flist extM
   }
@@ -727,15 +703,15 @@ use --teaish-extension-dir=/path/to/extension"
     define TEAISH_MAKEFILE_IN $extM
     define TEAISH_MAKEFILE [file rootname [file tail $extM]]
     proj-dot-ins-append $extM [get-define TEAISH_MAKEFILE]
-    msg-result "Extension makefile         = $extM"
+    msg-result "Extension makefile       = $extM"
   } else {
     define TEAISH_MAKEFILE_IN ""
     define TEAISH_MAKEFILE ""
-    #proj-warn "Did not find an teaish.make.in."
+    #proj-warn "Did not find a teaish.make.in."
   }
 
   # Look for teaish.pkginit.tcl
-  set flist [list $dext/teaish.pkginit.tcl.in $dext/teaish.pkginit.tcl]
+  set flist [list $dirExt/teaish.pkginit.tcl.in $dirExt/teaish.pkginit.tcl]
   if {[proj-first-file-found $flist extI]} {
     if {[string match *.in $extI]} {
       proj-dot-ins-append $extI
@@ -746,37 +722,34 @@ use --teaish-extension-dir=/path/to/extension"
       define TEAISH_PKGINIT_TCL $extI
     }
     teaish-add-dist [file tail $extI]
-    msg-result "Extension post-load init   = $extI"
+    msg-result "Extension post-load init = $extI"
     define TEAISH_PKGINIT_TCL_TAIL [file tail [get-define TEAISH_PKGINIT_TCL]]; # for use in pkgIndex.tcl
   }
 
   # Look for pkgIndex.tcl[.in]...
   set piPolicy 0
-  if {[proj-first-file-found $dext/pkgIndex.tcl.in extPI]} {
-    # If $dext/pkgIndex.tcl.in exists, generate ./pkgIndex.tcl from
+  if {[proj-first-file-found $dirExt/pkgIndex.tcl.in extPI]} {
+    # If $dirExt/pkgIndex.tcl.in exists, generate ./pkgIndex.tcl from
     # it.
     define TEAISH_PKGINDEX_TCL_IN $extPI
     define TEAISH_PKGINDEX_TCL [file rootname [file tail $extPI]]
     proj-dot-ins-append $extPI
     teaish-add-dist [file tail $extPI]
     set piPolicy 0x01
-  } elseif {!$extEqSrc && [proj-first-file-found $dsrc/pkgIndex.tcl.in extPI]} {
-    # If $dsrc/pkgIndex.tcl.in exists, generate ./pkgIndex.tcl from
+  } elseif {!$extEqSrc && [proj-first-file-found $dirSrc/pkgIndex.tcl.in extPI]} {
+    # If $dirSrc/pkgIndex.tcl.in exists, generate ./pkgIndex.tcl from
     # it.
     define TEAISH_PKGINDEX_TCL_IN $extPI
     define TEAISH_PKGINDEX_TCL [file rootname [file tail $extPI]]
     proj-dot-ins-append $extPI
     set piPolicy 0x02
-  }
-  if {!$piPolicy } {
-    if {[proj-first-file-found $dext/pkgIndex.tcl extPI]} {
-      # if TEAISH_DIR/pkgIndex.tcl exists, assume it's a static file
-      # and use it.
-      define TEAISH_PKGINDEX_TCL_IN ""
-      define TEAISH_PKGINDEX_TCL $extPI
-      proj-dot-ins-append $extPI
-      set piPolicy 0x04
-    }
+  } elseif {[proj-first-file-found $dirExt/pkgIndex.tcl extPI]} {
+    # if TEAISH_DIR/pkgIndex.tcl exists, assume it's a static file
+    # and use it.
+    define TEAISH_PKGINDEX_TCL_IN ""
+    define TEAISH_PKGINDEX_TCL $extPI
+    proj-dot-ins-append $extPI
+    set piPolicy 0x04
   }
 
   set ::teaish__Config(pkgindex-policy) $piPolicy
@@ -946,53 +919,108 @@ proc teaish-make-config-header {filename} {
   proj-touch $filename; # help avoid frequent unnecessary auto-reconfig
 }
 
-# internal cache for feature checks.
-array set teaish__fCache {}
-
-# @teaish-feature-cache-set ?$depth? value
+# @teaish-feature-cache-set ?$key? value
 #
-# Sets a feature-check cache entry with a key equal to
-# [proj-current-scope [expr {$depth+1}]] and the given value.
-proc teaish-feature-cache-set {{depth 0} val} {
-  set key [proj-current-scope [expr {$depth + 1}]]
-  #puts "** fcheck set key=$key = $val"
-  set ::teaish__fCache($key) $val
+# Sets a feature-check cache entry with the given key.
+# See proj-cache-set for the key's semantics.
+proc teaish-feature-cache-set {{key 0} val} {
+  proj-cache-set $key 1 $val
 }
 
-# @teaish-feature-cache-check ?$depth? tgtVarName
+# @teaish-feature-cache-check ?$key? tgtVarName
 #
-# If the feature-check cache has an entry named [proj-current-scope
-# [expr {$depth+1}]] then this function assigns its value to tgtVar and
-# returns 1, else it assigns tgtVar to "" and returns 0.
+# Checks for a feature-check cache entry with the given key.
+# See proj-cache-set for the key's semantics.
 #
-proc teaish-feature-cache-check {{depth 0} tgtVar} {
+# If the feature-check cache has a matching entry then this function
+# assigns its value to tgtVar and returns 1, else it assigns tgtVar to
+# "" and returns 0.
+#
+# See proj-cache-check for $key's semantics.
+proc teaish-feature-cache-check {{key 0} tgtVar} {
   upvar $tgtVar tgt
-  set key [proj-current-scope [expr {$depth + 1}]]
-  #puts "** fcheck get key=$key"
-  if {[info exists ::teaish__fCache($key)]} {
-    set tgt $::teaish__fCache($key)
-    return 1
+  proj-cache-check $key 1 tgt
+}
+
+# @teaish-check-cached@ ?-nostatus? msg script
+#
+# A proxy for feature-test impls which handles caching of a feature
+# flag check on per-function basis, using the calling scope's name as
+# the cache key.
+#
+# It emits [msg-checking $msg]. If $msg is empty then it defaults to
+# the name of the caller's scope. At the end, it will [msg-result "ok"]
+# [msg-result "no"] unless -nostatus is used, in which case the caller
+# is responsible for emitting at least a newline when it's done.
+#
+# This function checks for a cache hit before running $script and
+# caching the result. If no hit is found then $script is run in the
+# calling scope and its result value is stored in the cache. This
+# routine will intercept a 'return' from $script.
+#
+# Flags:
+#
+#   -nostatus = do not emit "ok" or "no" at the end. This presumes
+#    that the caller will emit at least one newline before turning.
+proc teaish-check-cached {args} {
+  set quiet 0
+  set xargs {}
+  foreach arg $args {
+    switch -exact -- $arg {
+      -nostatus {
+        incr quiet
+      }
+      default {
+        lappend xargs $arg
+      }
+    }
+  }
+  lassign $xargs msg script
+  if {"" eq $msg} {
+    set msg [proj-current-scope 1]
+  }
+  msg-checking "${msg} ... "
+  if {[teaish-feature-cache-check 1 check]} {
+    msg-checking "(cached) "
+    if {$check} {msg-result "ok"} else {msg-result "no"}
+    return $check
+  } else {
+    set code [catch {uplevel 1 $script} rc xopt]
+    #puts "***** cached-check got code=$code rc=$rc"
+    if {$code in {0 2}} {
+      teaish-feature-cache-set 1 $rc
+      if {!$quiet} {
+        if {$rc} {
+          msg-result "ok"
+        } else {
+          msg-result "no"
+        }
+      }
+    } else {
+      #puts "**** code=$code rc=$rc xopt=$xopt"
+      teaish-feature-cache-set 1 0
+    }
+    #puts "**** code=$code rc=$rc"
+    return {*}$xopt $rc
   }
-  set tgtVar ""
-  return 0
 }
 
 ########################################################################
-# Internal helper for teaish__defs-format_: returns a JSON-ish quoted
+# Internal helper for teaish__defs_format_: returns a JSON-ish quoted
 # form of the given string-type values. It only performs the most
 # basic of escaping. The input must not contain any control
 # characters.
-proc teaish__quote-str {value} {
+proc teaish__quote_str {value} {
   return \"[string map [list \\ \\\\ \" \\\"] $value]\"
 }
 
 ########################################################################
-# Internal helper for teaish__dump-defs-json. Expects to be passed a
+# Internal helper for teaish__dump_defs_to_list. Expects to be passed a
 # [define] name and the variadic $args which are passed to
-# teaish__dump-defs-json. If it finds a pattern match for the given
+# teaish__dump_defs_to_list.. If it finds a pattern match for the given
 # $name in the various $args, it returns the type flag for that $name,
 # e.g. "-str" or "-bare", else returns an empty string.
-proc teaish__defs-type {name spec} {
+proc teaish__defs_type {name spec} {
   foreach {type patterns} $spec {
     foreach pattern $patterns {
       if {[string match $pattern $name]} {
@@ -1008,8 +1036,8 @@ proc teaish__defs-type {name spec} {
 # make-config-header, and a value. Returns the formatted value or the
 # value $::teaish__Config(defs-skip) if the caller should skip
 # emitting that value.
-set teaish__Config(defs-skip) "-teaish__defs-format sentinel"
-proc teaish__defs-format {type value} {
+set teaish__Config(defs-skip) "-teaish__defs_format sentinel"
+proc teaish__defs_format {type value} {
   switch -exact -- $type {
     -bare {
       # Just output the value unchanged
@@ -1018,18 +1046,18 @@ proc teaish__defs-format {type value} {
       set value $::teaish__Config(defs-skip)
     }
     -str {
-      set value [teaish__quote-str_ $value]
+      set value [teaish__quote_str_ $value]
     }
     -auto {
       # Automatically determine the type
       if {![string is integer -strict $value]} {
-        set value [teaish__quote-str $value]
+        set value [teaish__quote_str $value]
       }
     }
     -array {
       set ar {}
       foreach v $value {
-        set v [teaish__defs-format -auto $v]
+        set v [teaish__defs_format -auto $v]
         if {$::teaish__Config(defs-skip) ne $v} {
           lappend ar $v
         }
@@ -1065,8 +1093,8 @@ proc teaish__dump_defs_to_list {args} {
     -bare {SIZEOF_* HAVE_DECL_*} \
     -auto *
   foreach n [lsort [dict keys [all-defines]]] {
-    set type [teaish__defs-type $n $args]
-    set value [teaish__defs-format $type [get-define $n]]
+    set type [teaish__defs_type $n $args]
+    set value [teaish__defs_format $type [get-define $n]]
     if {$skipper ne $value} {
       lappend lines "$n $value"
     }
@@ -1081,13 +1109,15 @@ proc teaish__dump_defs_to_list {args} {
 # particular those which require changing how the core looks for an
 # extension and its files.
 #
-# Accepts the following flags:
+# Accepts the following flags. Those marked with [L] are safe to use
+# during initial loading of tclish.tcl (recall that most teaish APIs
+# cannot be used until [teaish-configure] is called).
 #
-#   --have-own-pkgIndex.tcl: Tells teaish that ./pkgIndex.tcl is not a
-#    generated file, so it will not try to overwrite or delete it.
-#    May be used during initial loading of teaish.tcl.
+#   --have-own-pkgIndex.tcl [L]: Tells teaish that ./pkgIndex.tcl is
+#    not a generated file, so it will not try to overwrite or delete
+#    it.
 #
-#   --disable-dist: disables the "dist" parts of the filtered
+#   --disable-dist [L]: disables the "dist" parts of the filtered
 #     Makefile.  May be used during initial loading of teaish.tcl.
 #
 # Emits a warning message for unknown arguments.
@@ -1132,17 +1162,27 @@ proc teaish-enable-dist {{yes 1}} {
 #
 # Handles --teaish-create-extension=TARGET-DIR
 #
-proc teaish__create-extension {dir} {
+proc teaish__create_extension {dir} {
   set force [opt-bool teaish-force]
+  if {"" eq $dir} {
+    proj-fatal "--teaish-create-extension=X requires a directory name."
+  }
   file mkdir $dir
   set cwd [pwd]
-  set dir [file-normalize [file join $cwd $dir]]
+  #set dir [file-normalize [file join $cwd $dir]]
   msg-result "Created dir $dir"
   cd $dir
-  set flist {teaish.tcl}
-  foreach f $flist {
-    if {!$force && [file exists $f]} {
-      error "Cowardly refusing to overwrite $dir/$f. Use --teaish-force to overwrite."
+  if {!$force} {
+    # Ensure that we don't blindly overwrite anything
+    foreach f {
+      teaish.c
+      teaish.tcl
+      teaish.make.in
+      teaish.test.tcl
+    } {
+      if {[file exists $f]} {
+        error "Cowardly refusing to overwrite $dir/$f. Use --teaish-force to overwrite."
+      }
     }
   }
 
diff --git a/autoconf/tea/autosetup/feature-tests.tcl b/autoconf/tea/autosetup/feature-tests.tcl
index b2f9d84660..7fac7a6acd 100644
--- a/autoconf/tea/autosetup/feature-tests.tcl
+++ b/autoconf/tea/autosetup/feature-tests.tcl
@@ -16,65 +16,6 @@
 # private/internal APIs. Those with a prefix of teaish- are
 # public APIs.
 
-# @teaish-check-cached@ ?-flags? msg script
-#
-# A proxy for feature-test impls which handles caching of a feature
-# flag check on per-function basis, using the calling scope's name as
-# the cache key.
-#
-# The test is performed by $script. This function checks for a chache
-# hit before running $script and caching the result. The value stored
-# in the cache is the final value of $script (and this routine will
-# intercept a 'return' from $script).
-#
-# Flags:
-#
-#   -nostatus = do not emit "ok" or "no" at the end. This presumes
-#    that the caller will emit at least one newline before turning.
-proc teaish-check-cached {args} {
-  set quiet 0
-  set xargs {}
-  foreach arg $args {
-    switch -exact -- $arg {
-      -nostatus {
-        incr quiet
-      }
-      default {
-        lappend xargs $arg
-      }
-    }
-  }
-  lassign $xargs msg script
-  if {"" eq $msg} {
-    set msg [proj-current-scope 1]
-  }
-  msg-checking "${msg} ... "
-  if {[teaish-feature-cache-check 1 check]} {
-    msg-checking "(cached) "
-    if {$check} {msg-result "ok"} else {msg-result "no"}
-    return $check
-  } else {
-    set code [catch {uplevel 1 $script} rc xopt]
-    #puts "***** ::teaish__fCache ="; parray ::teaish__fCache
-    #puts "***** cached-check got code=$code rc=$rc"
-    if {$code in {0 2}} {
-      teaish-feature-cache-set 1 $rc
-      if {!$quiet} {
-        if {$rc} {
-          msg-result "ok"
-        } else {
-          msg-result "no"
-        }
-      }
-    } else {
-      #puts "**** code=$code rc=$rc xopt=$xopt"
-      teaish-feature-cache-set 1 0
-    }
-    #puts "**** code=$code rc=$rc"
-    return {*}$xopt $rc
-  }
-}
-
 
 # @teaish-check-libz
 #
diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl
index d64cc62186..3d580b07c4 100644
--- a/autosetup/proj.tcl
+++ b/autosetup/proj.tcl
@@ -58,7 +58,9 @@
 # $proj__Config is an internal-use-only array for storing whatever generic
 # internal stuff we need stored.
 array set proj__Config {
+  self-tests 0
 }
+
 #
 # List of dot-in files to filter in the final stages of
 # configuration. Some configuration steps may append to this.  Each
@@ -1795,3 +1797,103 @@ proc proj-options-combine {args} {
   }
   return $rv
 }
+
+# Internal cache for use via proj-cache-*.
+array set proj__Cache {}
+
+# @proj-cache-key ?addLevel? arg
+#
+# Helper to generate cache keys for [proj-cache-*].
+#
+# Returns a cache key for the given argument:
+#
+#   integer: relative call stack levels to get the scope name of for
+#   use as a key. [proj-current-scope [expr {1 + $arg + addLevel}]] is
+#   then used to generate the key. i.e. the default of 0 uses the
+#   calling scope's name as the key.
+#
+#   "-": same as 0
+#
+#   Anything else: returned as-is
+#
+proc proj-cache-key {{addLevel 0} arg} {
+  if {"-" eq $arg} {set arg 0}
+  if {[string is integer -strict $arg]} {
+    return [proj-current-scope [expr {$arg + $addLevel + 1}]]
+  }
+  return $arg
+}
+
+# @proj-cache-set ?key? ?addLevel? value
+#
+# Sets a feature-check cache entry with the given key.
+#
+# See proj-cache-key for $key's and $addLevel's semantics, noting that
+# this function adds one to $addLevel for purposes of that call.
+proc proj-cache-set {{key 0} {addLevel 0} val} {
+  set key [proj-cache-key [expr {1 + $addLevel}] $key]
+  #puts "** fcheck set $key = $val"
+  set ::proj__Cache($key) $val
+}
+
+# @proj-cache-remove ?key? ?addLevel?
+#
+# Removes an entry from the proj-cache.
+proc proj-cache-remove {{key 0} {addLevel 0}} {
+  set key [proj-cache-key [expr {1 + $addLevel}] $key]
+  set rv ""
+  if {[info exists ::proj__Cache($key)]} {
+    set rv $::proj__Cache($key)
+    unset ::proj__Cache($key)
+  }
+  return $rv;
+}
+
+# @proj-cache-check ?$key? ?addLevel? tgtVarName
+#
+# Checks for a feature-check cache entry with the given key.
+#
+# If the feature-check cache has a matching entry then this function
+# assigns its value to tgtVar and returns 1, else it assigns tgtVar to
+# "" and returns 0.
+#
+# See proj-cache-key for $key's and $addLevel's semantics, noting that
+# this function adds one to $addLevel for purposes of that call.
+proc proj-cache-check {{key 0} {addLevel 0} tgtVar} {
+  upvar $tgtVar tgt
+  set rc 0
+  set key [proj-cache-key [expr {1 + $addLevel}] $key]
+  #puts "** fcheck get key=$key"
+  if {[info exists ::proj__Cache($key)]} {
+    set tgt $::proj__Cache($key)
+    incr rc
+  } else {
+    set tgt ""
+  }
+  return $rc
+}
+
+if {$::proj__Config(self-tests)} {
+  apply {{} {
+    proj-warn "Test code for proj-cache"
+    proj-assert {![proj-cache-check here check]}
+    proj-assert {"here" eq [proj-cache-key here]}
+    proj-assert {"" eq $check}
+    proj-cache-set here thevalue
+    proj-assert {[proj-cache-check here check]}
+    proj-assert {"thevalue" eq $check}
+
+    proj-assert {![proj-cache-check check]}
+    #puts "*** key = ([proj-cache-key -])"
+    proj-assert {"" eq $check}
+    proj-cache-set abc
+    proj-assert {[proj-cache-check check]}
+    proj-assert {"abc" eq $check}
+
+    parray ::proj__Cache;
+    proj-assert {"" ne [proj-cache-remove]}
+    proj-assert {"" eq [proj-cache-remove]}
+    proj-assert {![proj-cache-check check]}
+    proj-assert {"" eq $check}
+  }}
+}
diff --git a/manifest b/manifest
index 4a867fff84..e51001db89 100644
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Avoid\sa\spotential\sinteger\soverflow\sin\snon-default\sbuilds\sof\sthe\sfts3\smatchinfo()\sfunction.
-D 2025-04-15T11:06:37.142
+C Cleanups\sand\srefactoring\sin\sproj.tcl\sand\steaish.
+D 2025-04-15T15:20:30.333
 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
@@ -26,8 +26,8 @@ F autoconf/tea/Makefile.in 2a90dfab1e95cb3ec610429c78d88d4a7d26beb080ad45ff6a059
 F autoconf/tea/README.txt 656d4686c509d375f5988ff3deda94f65fe6cd8358cd55d1f1dcc7b6e2ff73aa
 F autoconf/tea/auto.def 81e2617cfb90d53c19b53b3ec632cd2893bf32f2e5dd272b1116fadf2ea86c2d
 F autoconf/tea/autosetup/README.txt b40071e6f8506500a2f7f71d5fc69e0bf87b9d7678dd9da1e5b4d0acbf40b1ca
-F autoconf/tea/autosetup/core.tcl 87051761ee1bb11df381751e656f3d86feac3f281e539ec4442ffc4c2758f2f8
-F autoconf/tea/autosetup/feature-tests.tcl f594efeb43fe1d83599367ac388082a1d47be28322591a1d9d29214039df2094
+F autoconf/tea/autosetup/core.tcl b0d2781acbd2bebbcf4baeb4c0a1fae4814e251df7a1b4f4db10e88c57d03eef
+F autoconf/tea/autosetup/feature-tests.tcl 87b448e620b043c8c23b6cb727a3a5e485b61b600077222b6799e9f64aab941a
 F autoconf/tea/autosetup/tester.tcl d94aa9d51d2a22062e61db97310c2502ca0df50ca87108482c3bccf8f41db127
 F autoconf/tea/configure d0b12b984edca6030d1976375b80157ac78b5b90a5b4f0dcee39357f63f4a80b x
 F autoconf/tea/doc/sqlite3.n 9a97f4f717ceab73004ea412af7960625c1cb24b5c25e4ae4c8b5d8fa4300f4e
@@ -51,7 +51,7 @@ F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e
 F autosetup/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1821baf61bc86a7e
 F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049
 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba
-F autosetup/proj.tcl 4902c308f0b8fe8d734247f38253aa0cf46fee63834074b2b0ff90d092b4add0
+F autosetup/proj.tcl 3e9f84104d401a353f53961db7d361469bf6d614897c11144aecedc9727120d3
 F autosetup/sqlite-config.tcl d4e888fc94e677e3820fea998747c94b8dcc4ff346a14253bf7f5344f526ceef
 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9
 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x
@@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350
 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 07e9ceee51380ee25e580178fa82030be5d2b65d4f4b4dc86c94b21f7f04f291
-R 84dac09860d04f3b89dac3e5a6e35be6
-U dan
-Z fa2be2a8c187a7c531361e66a41cdaca
+P aecc0100cef3ea83feed558dbe34dd6313721fa54052ee1ed529741cec8cacda
+R 6d0851af6d222d7402138880b42a71fb
+U stephan
+Z eb37c816b2f5ad3c81b2db656b75bd7f
 # Remove this line to create a well-formed Fossil manifest.
diff --git a/manifest.uuid b/manifest.uuid
index 3b0c6fc0db..0ce230b4dd 100644
--- a/manifest.uuid
+++ b/manifest.uuid
@@ -1 +1 @@
-aecc0100cef3ea83feed558dbe34dd6313721fa54052ee1ed529741cec8cacda
+6b7ca8176e8c1b5e99e177c3daaba47b0674fa2f82d91754e7a8f66460ca8419

From 8488789d742ba6cb818fab54d3c34e3d512413a0 Mon Sep 17 00:00:00 2001
From: drh <>
Date: Tue, 15 Apr 2025 19:53:36 +0000
Subject: [PATCH 107/120] Fix a minor typo in a code comment.

FossilOrigin-Name: 158e8c4fd7bdfc1cd4c0135abecd0d00994cd4027cf74ce6e5cf73d76475ae95
---
 manifest        | 14 +++++++-------
 manifest.uuid   |  2 +-
 src/wherecode.c |  2 +-
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/manifest b/manifest
index e51001db89..a78fa59b7b 100644
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Cleanups\sand\srefactoring\sin\sproj.tcl\sand\steaish.
-D 2025-04-15T15:20:30.333
+C Fix\sa\sminor\stypo\sin\sa\scode\scomment.
+D 2025-04-15T19:53:36.675
 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
@@ -871,7 +871,7 @@ F src/wal.h ba252daaa94f889f4b2c17c027e823d9be47ce39da1d3799886bbd51f0490452
 F src/walker.c d5006d6b005e4ea7302ad390957a8d41ed83faa177e412f89bc5600a7462a014
 F src/where.c 85690096a475ace0a2f5154be5341e3367f4ad8fda349a213702d2aff2d41d88
 F src/whereInt.h ecdbfb5551cf394f04ec7f0bc7ad963146d80eee3071405ac29aa84950128b8e
-F src/wherecode.c 6a3749575bcd02c7243ed89bde8a222525a60b56ae12ab78d997d64de346465c
+F src/wherecode.c d67fadf5430c2647773b5f702a47b82eb4af50a317f8978c0c82363cc1a5107f
 F src/whereexpr.c 2415c8eee5ff89a8b709d7d83d71c1ff986cd720d0520057e1d8a5371339012a
 F src/window.c d01227141f622f24fbe36ca105fbe6ef023f9fd98f1ccd65da95f88886565db5
 F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
@@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350
 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P aecc0100cef3ea83feed558dbe34dd6313721fa54052ee1ed529741cec8cacda
-R 6d0851af6d222d7402138880b42a71fb
-U stephan
-Z eb37c816b2f5ad3c81b2db656b75bd7f
+P 6b7ca8176e8c1b5e99e177c3daaba47b0674fa2f82d91754e7a8f66460ca8419
+R 59cb199d5d0cc4abecb0c1293594bc0a
+U drh
+Z 66b3eb3d1515a55c6cbd6e0d69f293fa
 # Remove this line to create a well-formed Fossil manifest.
diff --git a/manifest.uuid b/manifest.uuid
index 0ce230b4dd..1a4b7cc7a8 100644
--- a/manifest.uuid
+++ b/manifest.uuid
@@ -1 +1 @@
-6b7ca8176e8c1b5e99e177c3daaba47b0674fa2f82d91754e7a8f66460ca8419
+158e8c4fd7bdfc1cd4c0135abecd0d00994cd4027cf74ce6e5cf73d76475ae95
diff --git a/src/wherecode.c b/src/wherecode.c
index 76f7ec60a2..014f697d97 100644
--- a/src/wherecode.c
+++ b/src/wherecode.c
@@ -542,7 +542,7 @@ static void adjustOrderByCol(ExprList *pOrderBy, ExprList *pEList){
 /*
 ** pX is an expression of the form:  (vector) IN (SELECT ...)
 ** In other words, it is a vector IN operator with a SELECT clause on the
-** LHS.  But not all terms in the vector are indexable and the terms might
+** RHS.  But not all terms in the vector are indexable and the terms might
 ** not be in the correct order for indexing.
 **
 ** This routine makes a copy of the input pX expression and then adjusts

From 0243ca82459db9984f3708eb844b32bcebbff2e5 Mon Sep 17 00:00:00 2001
From: drh <>
Date: Tue, 15 Apr 2025 21:59:38 +0000
Subject: [PATCH 108/120] Correctly handle the case of a multi-column UNIQUE
 constraint that contains the ROWID as one of it columns, and then the columns
 of that UNIQUE are used in a row-value IN operator as a WHERE clause
 constraint.  Reported by [forum:/forumpost/b9647a113b465950|forum post
 b9647a113b].  Problem introduced by [723f1be3d4a905a6], part of ticket
 [da78413751863].

FossilOrigin-Name: d22475b81c4e26ccc50f3b5626d43b32f7a2de34e5a764539554665bdda735d5
---
 manifest           | 18 +++++++++---------
 manifest.uuid      |  2 +-
 src/build.c        |  1 +
 src/sqliteInt.h    |  1 +
 src/where.c        |  2 +-
 test/rowvalue.test | 23 +++++++++++++++++++++++
 6 files changed, 36 insertions(+), 11 deletions(-)

diff --git a/manifest b/manifest
index a78fa59b7b..c03eebfa82 100644
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\sa\sminor\stypo\sin\sa\scode\scomment.
-D 2025-04-15T19:53:36.675
+C Correctly\shandle\sthe\scase\sof\sa\smulti-column\sUNIQUE\sconstraint\sthat\scontains\nthe\sROWID\sas\sone\sof\sit\scolumns,\sand\sthen\sthe\scolumns\sof\sthat\sUNIQUE\sare\nused\sin\sa\srow-value\sIN\soperator\sas\sa\sWHERE\sclause\sconstraint.\s\sReported\sby\n[forum:/forumpost/b9647a113b465950|forum\spost\sb9647a113b].\s\sProblem\nintroduced\sby\s[723f1be3d4a905a6],\spart\sof\sticket\s[da78413751863].
+D 2025-04-15T21:59:38.221
 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
@@ -729,7 +729,7 @@ F src/btmutex.c 30dada73a819a1ef5b7583786370dce1842e12e1ad941e4d05ac29695528daea
 F src/btree.c 00fcee37947641f48d4b529d96143e74d056b7afa8f26d61292c90ee59c056b2
 F src/btree.h 18e5e7b2124c23426a283523e5f31a4bff029131b795bb82391f9d2f3136fc50
 F src/btreeInt.h 9c0f9ea5c9b5f4dcaea18111d43efe95f2ac276cd86d770dce10fd99ccc93886
-F src/build.c a411f732439279f09c2dda0275c5dccddc924fcf40a1d167ca9bf196be8fdbde
+F src/build.c ad72c60b6e01053dea9d1e03f52de747138e4b0de1c73f17501ea307cf40a240
 F src/callback.c acae8c8dddda41ee85cfdf19b926eefe830f371069f8aadca3aa39adf5b1c859
 F src/complete.c a3634ab1e687055cd002e11b8f43eb75c17da23e
 F src/date.c 9db4d604e699a73e10b8e85a44db074a1f04c0591a77e2abfd77703f50dce1e9
@@ -790,7 +790,7 @@ F src/shell.c.in 1e8b9bf369e80cdf9b029142e773038bc12bd38aea1c56df4af6bf7b46cae95
 F src/sqlite.h.in 22882ddd3a70751aa8864c81993ee4562ed54c2c508b6270f75e223ffee38e1b
 F src/sqlite3.rc 015537e6ac1eec6c7050e17b616c2ffe6f70fca241835a84a4f0d5937383c479
 F src/sqlite3ext.h 3f046c04ea3595d6bfda99b781926b17e672fd6d27da2ba6d8d8fc39981dcb54
-F src/sqliteInt.h 96133c5b4371629b30644a88108a0ca99e6a95a55509cdfc8de9961fba4bbd26
+F src/sqliteInt.h 8b18ed676757ce49df633b603a465655aa105d9862821ffa9296afb189ba564f
 F src/sqliteLimit.h 6d817c28a8f19af95e6f4921933b7fbbca48a962bce0eb0ec81e8bb3ef38e68b
 F src/status.c 0e72e4f6be6ccfde2488eb63210297e75f569f3ce9920f6c3d77590ec6ce5ffd
 F src/table.c 0f141b58a16de7e2fbe81c308379e7279f4c6b50eb08efeec5892794a0ba30d1
@@ -869,7 +869,7 @@ F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9
 F src/wal.c bcf40795a09b699ad7e42624dd6282b13335164fbabcd5a98a717758cebef451
 F src/wal.h ba252daaa94f889f4b2c17c027e823d9be47ce39da1d3799886bbd51f0490452
 F src/walker.c d5006d6b005e4ea7302ad390957a8d41ed83faa177e412f89bc5600a7462a014
-F src/where.c 85690096a475ace0a2f5154be5341e3367f4ad8fda349a213702d2aff2d41d88
+F src/where.c 16aab5421a7119063fdb138dce6b53c57c50ad01b0b64992dacb14f946fe8d4a
 F src/whereInt.h ecdbfb5551cf394f04ec7f0bc7ad963146d80eee3071405ac29aa84950128b8e
 F src/wherecode.c d67fadf5430c2647773b5f702a47b82eb4af50a317f8978c0c82363cc1a5107f
 F src/whereexpr.c 2415c8eee5ff89a8b709d7d83d71c1ff986cd720d0520057e1d8a5371339012a
@@ -1577,7 +1577,7 @@ F test/round1.test 29c3c9039936ed024d672f003c4d35ee11c14c0acb75c5f7d6188ff16190c
 F test/rowallock.test 3f88ec6819489d0b2341c7a7528ae17c053ab7cc
 F test/rowhash.test 0bc1d31415e4575d10cacf31e1a66b5cc0f8be81
 F test/rowid.test d27191b5ce794c05bf61081e8b2c546a1844c1641321dcaf7fb785234256cc8e
-F test/rowvalue.test 6f70e62912531378997cc6ed4940e9bdd5b6708464ef1536ffbd7272d9bbed24
+F test/rowvalue.test 9c873b2f6e7ce72b24ef133f93515c07a6a7dac4846a344ebc2af7b8bfdf5147
 F test/rowvalue2.test 060d238b7e5639a7c5630cb5e63e311b44efef2b
 F test/rowvalue3.test 103e9a224ca0548dd0d67e439f39c5dd16de4200221a333927372408c025324c
 F test/rowvalue4.test bac9326d1e886656650f67c0ec484eb5f452244a8209c6af508e9a862ace08ed
@@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350
 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 6b7ca8176e8c1b5e99e177c3daaba47b0674fa2f82d91754e7a8f66460ca8419
-R 59cb199d5d0cc4abecb0c1293594bc0a
+P 158e8c4fd7bdfc1cd4c0135abecd0d00994cd4027cf74ce6e5cf73d76475ae95
+R c2d14e3a5c8d8bcc253d1803871a054b
 U drh
-Z 66b3eb3d1515a55c6cbd6e0d69f293fa
+Z 7bbbfb8e256d1c10ef6ff3242542ea0b
 # Remove this line to create a well-formed Fossil manifest.
diff --git a/manifest.uuid b/manifest.uuid
index 1a4b7cc7a8..a530b41c17 100644
--- a/manifest.uuid
+++ b/manifest.uuid
@@ -1 +1 @@
-158e8c4fd7bdfc1cd4c0135abecd0d00994cd4027cf74ce6e5cf73d76475ae95
+d22475b81c4e26ccc50f3b5626d43b32f7a2de34e5a764539554665bdda735d5
diff --git a/src/build.c b/src/build.c
index 9c0285e3df..13f5b71330 100644
--- a/src/build.c
+++ b/src/build.c
@@ -4219,6 +4219,7 @@ void sqlite3CreateIndex(
       assert( j<=0x7fff );
       if( j<0 ){
         j = pTab->iPKey;
+        pIndex->bIdxRowid = 1;
       }else{
         if( pTab->aCol[j].notNull==0 ){
           pIndex->uniqNotNull = 0;
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index 35e5b94d71..edf925964b 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -2792,6 +2792,7 @@ struct Index {
   unsigned bLowQual:1;     /* sqlite_stat1 says this is a low-quality index */
   unsigned bNoQuery:1;     /* Do not use this index to optimize queries */
   unsigned bAscKeyBug:1;   /* True if the bba7b69f9849b5bf bug applies */
+  unsigned bIdxRowid:1;    /* One or more of the index keys is the ROWID */
   unsigned bHasVCol:1;     /* Index references one or more VIRTUAL columns */
   unsigned bHasExpr:1;     /* Index contains an expression, either a literal
                            ** expression, or a reference to a VIRTUAL column */
diff --git a/src/where.c b/src/where.c
index 3320f68554..c51d1ba815 100644
--- a/src/where.c
+++ b/src/where.c
@@ -3476,7 +3476,7 @@ static int whereLoopAddBtreeIndex(
     if( (pNew->wsFlags & WHERE_TOP_LIMIT)==0
      && pNew->u.btree.nEqnColumn
      && (pNew->u.btree.nEqnKeyCol ||
-           pProbe->idxType!=SQLITE_IDXTYPE_PRIMARYKEY)
+          (pProbe->idxType!=SQLITE_IDXTYPE_PRIMARYKEY && !pProbe->bIdxRowid))
     ){
       if( pNew->u.btree.nEq>3 ){
         sqlite3ProgressCheck(pParse);
diff --git a/test/rowvalue.test b/test/rowvalue.test
index 875fe1c608..e2688e9030 100644
--- a/test/rowvalue.test
+++ b/test/rowvalue.test
@@ -782,4 +782,27 @@ do_execsql_test 33.3 {
   SELECT * FROM t1 WHERE (a,b) BETWEEN (2,99) AND (4,0);
 } {3 100}
 
+# 2025-04-15 https://sqlite.org/forum/forumpost/b9647a113b465950
+# Incorrect result when the schema includes a table with a UNIQUE
+# constraint and one of the columns in the UNIQUE constraint is the
+# INTEGER PRIMARY KEY, and the columns that UNIQUE constraint are
+# used in a rowvalue-IN operator constraint.
+#
+reset_db
+do_execsql_test 34.1 {
+  CREATE TABLE items (
+    Id INTEGER  /* rowid alias */,
+    Item INTEGER  /* any type */,
+    Test TEXT  /* TEXT or BLOB */,
+    Filler,  /* any type */
+    PRIMARY KEY(Id),
+    UNIQUE(Item, Id)
+  );
+  INSERT INTO items (Id, Item)
+    VALUES (1, 2), (2, 2), (3, 3), (4, 5);
+  UPDATE items SET test='ok'
+    WHERE (Id, Item) IN (SELECT Id, Item FROM items);
+  SELECT Id, Item, test FROM items ORDER BY id;
+} {1 2 ok 2 2 ok 3 3 ok 4 5 ok}
+
 finish_test

From b1cc4aeb6105bb2b4cf3e15276b46af21477598e Mon Sep 17 00:00:00 2001
From: stephan 
Date: Wed, 16 Apr 2025 12:48:27 +0000
Subject: [PATCH 109/120] Latest upstream teaish for fixes and improvements.

FossilOrigin-Name: 8f9148b33e01aa7963140704ef16e4304799e5842fa60e55373ccdabe8e3616d
---
 autoconf/tea/autosetup/core.tcl          | 388 ++++++++++++-----------
 autoconf/tea/autosetup/feature-tests.tcl |   9 +-
 autosetup/proj.tcl                       | 323 +++++++++++++++----
 autosetup/sqlite-config.tcl              |   5 +-
 manifest                                 |  20 +-
 manifest.uuid                            |   2 +-
 6 files changed, 494 insertions(+), 253 deletions(-)

diff --git a/autoconf/tea/autosetup/core.tcl b/autoconf/tea/autosetup/core.tcl
index c265e50a58..e3f71f1ede 100644
--- a/autoconf/tea/autosetup/core.tcl
+++ b/autoconf/tea/autosetup/core.tcl
@@ -39,14 +39,15 @@ array set teaish__Config [proj-strip-hash-comments {
   debug-enabled 0
   #
   # 0    = don't yet have extension's pkgindex
-  # 0x01 = teaish__find_extension found TEAISH_DIR/pkgindex.tcl
-  # 0x02 = teaish__find_extension found srcdir/pkgindex.tcl.in
-  # 0x04 = teaish__find_extension found TEAISH_DIR/pkgindex.tcl (static file)
+  # 0x01 = teaish__find_extension found TEAISH_DIR/pkgIndex.tcl
+  # 0x02 = teaish__find_extension found srcdir/pkgIndex.tcl.in
+  # 0x04 = teaish__find_extension found TEAISH_DIR/pkgIndex.tcl (static file)
   # 0x10 = teaish-pragma was called: behave as if 0x04
   #
+  # This might no longer be needed.
   pkgindex-policy 0
 }]
-
+set teaish__Config(core-dir) $::autosetup(libdir)/teaish
 #
 # Returns true if any arg in $::argv matches any of the given globs,
 # else returns false.
@@ -74,10 +75,9 @@ proc teaish-configure-core {} {
     TEAISH_MAKEFILE ""
     TEAISH_MAKEFILE_IN ""
     TEAISH_DIST_FILES ""
-    TEAISH_PKGINIT_TCL ""
-    TEAISH_PKGINIT_TCL_IN ""
-    TEAISH_PKGINDEX_TCL_IN ""
-    TEAISH_PKGINDEX_TCL ""
+    TEAISH_TEST_TCL "" TEAISH_TEST_TCL_IN ""
+    TEAISH_PKGINIT_TCL "" TEAISH_PKGINIT_TCL_IN ""
+    TEAISH_PKGINDEX_TCL_IN "" TEAISH_PKGINDEX_TCL ""
     TEAISH_TCL ""
     TEAISH_CFLAGS ""
     TEAISH_LDFLAGS ""
@@ -89,7 +89,7 @@ proc teaish-configure-core {} {
   set gotExt 0; # True if an extension config is found
   if {![teaish__argv_has --teaish-create-extension* --t-c-e*]} {
     # Don't look for an extension if we're in --t-c-e mode
-    set gotExt [teaish__find-extension]
+    set gotExt [teaish__find_extension]
   }
 
   if {$gotExt} {
@@ -107,7 +107,7 @@ proc teaish-configure-core {} {
   #
   # Set up the --flags...
   #
-  proj-options-add [proj-strip-hash-comments {
+  options-add [proj-strip-hash-comments {
     with-tcl:DIR
       => {Directory containing tclConfig.sh or a directory one level up from
           that, from which we can derive a directory containing tclConfig.sh.}
@@ -156,11 +156,14 @@ proc teaish-configure-core {} {
   if {[llength [info proc teaish-options]] > 0} {
     # Add options defined by teaish-options, which is assumed to be
     # imported via TEAISH_TCL.
-    proj-options-add [teaish-options]
+    set o [teaish-options]
+    if {"" ne $o} {
+      options-add $o
+    }
   }
-  set opts [proj-options-combine]
+  #set opts [proj-options-combine]
   #lappend opts teaish-debug => {x}; #testing dupe entry handling
-  if {[catch {options $opts} msg xopts]} {
+  if {[catch {options {}} msg xopts]} {
     # Workaround for 
     # where [options] behaves oddly on _some_ TCL builds when it's
     # called from deeper than the global scope.
@@ -199,6 +202,27 @@ proc teaish-debug {msg} {
 }
 
 proc teaish__configure-phase1 {} {
+  # Set up some default values if the user did not set them.
+  foreach {key val} [list \
+                       TEAISH_PKGNAME [get-define TEAISH_NAME] \
+                       TEAISH_VERSION 0.0.0 \
+                       TEAISH_MAKEFILE_CODE ""] {
+    if {"" eq [get-define $key ""]} {
+      #puts "***** defining default $key $val"
+      define $key $val
+    }
+  }
+  # Do it again for vars which rely on defaults derived from other
+  # vars.
+  foreach {key val} [list \
+                       TEAISH_LIBDIR_NAME [get-define TEAISH_PKGNAME ""] \
+                       TEAISH_LOAD_PREFIX [string totitle [get-define TEAISH_PKGNAME ""]] \
+                       TEAISH_PKGNAME [get-define TEAISH_NAME]] {
+    if {"" eq [get-define $key ""]} {
+      #puts "***** defining default $key $val"
+      define $key $val
+    }
+  }
 
   msg-result \
     "Configuring extension [proj-bold [get-define TEAISH_NAME] [get-define TEAISH_VERSION]]..."
@@ -206,13 +230,8 @@ proc teaish__configure-phase1 {} {
   uplevel 1 {
     use cc cc-db cc-shared cc-lib; # pkg-config
   }
-  teaish__check-common-bins
-
-  if {"" eq [get-define TEAISH_LIBDIR_NAME]} {
-    define TEAISH_LIBDIR_NAME [get-define TEAISH_NAME]
-  }
-
   teaish__check-tcl
+  teaish__check-common-bins
   apply {{} {
     #
     # If --prefix or --exec-prefix are _not_ provided, use their
@@ -259,13 +278,15 @@ proc teaish__configure-phase1 {} {
     define TEAISH_DLL9 [get-define TEAISH_DLL9_BASENAME]$ext
   }}
 
-#  foreach ft [glob -nocomplain [get-define TEAISH_AUTOSETUP_DIR]/featuretest-*.tcl] {
+  define TEAISH_AUTOSETUP_DIR $::teaish__Config(core-dir)
+# We'd need to import feature-tests.tcl too
+#  foreach ft [glob -nocomplain [get-define TEAISH_AUTOSETUP_DIR]/feature/*.tcl] {
 #    puts "Loading external feature test: $ft"
 #    upscope 1 "source $ft"
 #  }
 
   if {[llength [info proc teaish-configure]] > 0} {
-    # teaish-options is assumed to be imported via
+    # teaish-configure is assumed to be imported via
     # TEAISH_TCL
     teaish-configure
   }
@@ -277,72 +298,42 @@ proc teaish__configure-phase1 {} {
     teaish-add-cflags -DUSE_TCL_STUBS=1
   }
 
-  define TEAISH_TEST_TCL \
-    [join [glob -nocomplain [get-define TEAISH_DIR]/teaish.test.tcl]]
-
   #define AS_LIBDIR $::autosetup(libdir)
-  define TEAISH_CORE_DIR $::autosetup(libdir)/teaish
-  define TEAISH_MODULE_TEST_TCL $::autosetup(libdir)/teaish/tester.tcl
-  define TEAISH_TESTER_TCL $::autosetup(builddir)/teaish.tester.tcl
+  define TEAISH_MODULE_TEST_TCL $::teaish__Config(core-dir)/tester.tcl
   teaish__configure-finalize
 }
 
 proc teaish__configure-finalize {} {
 
   apply {{} {
-    # Set up TEAISH_DIST_FILES
-    set df {}
-    foreach d {
-      TEAISH_TCL
-      TEAISH_MAKEFILE_IN
-      TEAISH_TEST_TCL
-    } {
-      set x [get-define $d ""]
-      if {"" ne $x} {
-        lappend df [file tail $x]
-      }
+    #
+    # Ensure we have a pkgIndex.tcl and don't have a stale generated one
+    # when rebuilding for different --with-tcl=... values.
+    #
+    if {!$::teaish__Config(pkgindex-policy)} {
+      proj-fatal "Cannot determine which pkgIndex.tcl to use"
     }
-    teaish-add-dist {*}$df
-  }}
-
-  #
-  # Ensure we have a pkgIndex.tcl and don't have a stale generated one
-  # when rebuilding for different --with-tcl=... values. Also take
-  # care not to nuke it if pkgindex-policy is 0x10.
-  #
-  apply {{} {
-    set policy $::teaish__Config(pkgindex-policy);
-    set src ""; # input source for pkgIndex.tcl
-    if {$policy & 0x10} {
-      # teaish-pragma --have-own-pkgIndex.tcl override. This means
-      # we have a static/non-generated pkgIndex.tcl.
-      set tpt [get-define TEAISH_PKGINDEX_TCL ""]
-      if {"" eq $tpt} {
-        set tpt [file join [get-define TEAISH_DIR] pkgIndex.tcl]
-        define TEAISH_PKGINDEX_TCL $tpt
-      }
-      set src $tpt
-    } elseif {$policy & 0x04} {
-      # Found TEAISH_DIR/pkgIndex.tcl but no pkgIndex.tcl.in, so
-      # assume it's a hand-written one.
-      set src [get-define TEAISH_PKGINDEX_TCL]
-    } elseif {$policy} {
-      # Found one of {TEAISH_DIR,srcdir}/pkgIndex.tcl.in
-      set src [get-define TEAISH_PKGINDEX_TCL_IN]
-    } else {
-      proj-fatal "Cannot determine the pkgIndex.tcl to use"
-    }
-    msg-result "Using pkgIndex from $src"
+    set tpi [proj-coalesce \
+               [get-define TEAISH_PKGINDEX_TCL_IN] \
+               [get-define TEAISH_PKGINDEX_TCL]]
+    proj-assert {$tpi ne ""} \
+      "TEAISH_PKGINDEX_TCL should have been set up by now"
+    msg-result "Using pkgIndex from $tpi"
   }}; # $::teaish__Config(pkgindex-policy)
 
-  proj-dot-ins-append $::autosetup(srcdir)/Makefile.in
-  proj-dot-ins-append $::autosetup(srcdir)/teaish.tester.tcl.in
+  set dEx $::teaish__Config(teaish-dir)
+  set dSrc $::autosetup(srcdir)
+  proj-dot-ins-append $dSrc/Makefile.in
+  proj-dot-ins-append $dSrc/teaish.tester.tcl.in
+  define TEAISH_TESTER_TCL_IN $dEx/teaish.tester.tcl.in
+  define TEAISH_TESTER_TCL teaish.tester.tcl
 
   if {[get-define TEAISH_OUT_OF_EXT_TREE]} {
     define TEAISH_ENABLE_DIST 0
+  } else {
+    define TEAISH_ENABLE_DIST 1
   }
 
-  define TEAISH_AUTOSETUP_DIR $::autosetup(libdir)/teaish
   proj-setup-autoreconfig TEAISH_AUTORECONFIG
   foreach f {
     TEAISH_CFLAGS
@@ -352,7 +343,9 @@ proc teaish__configure-finalize {} {
   } {
     define $f [join [get-define $f]]
   }
-  define TEAISH__DEFINES_MAP [teaish__dump_defs_to_list]
+  proj-remap-autoconf-dir-vars
+  define TEAISH__DEFINES_MAP \
+    [teaish__dump_defs_to_list]; # injected into teaish.tester.tcl
   proj-dot-ins-process -validate; # do not [define] after this point
   proj-if-opt-truthy teaish-dump-defines {
     make-config-header config.defines.txt \
@@ -534,13 +527,6 @@ proc teaish__check-tcl {} {
   define TCLSH_CMD $with_tclsh
   if {$use_tcl} {
     # Set up the TCLLIBDIR
-    #
-    # 2024-10-28: calculation of TCLLIBDIR is now done via the shell
-    # in main.mk (search it for T.tcl.env.sh) so that
-    # static/hand-written makefiles which import main.mk do not have
-    # to define that before importing main.mk. Even so, we export
-    # TCLLIBDIR from here, which will cause the canonical makefile to
-    # use this one rather than to re-calculate it at make-time.
     set tcllibdir [get-env TCLLIBDIR ""]
     set extDirName [get-define TEAISH_LIBDIR_NAME]
     if {"" eq $tcllibdir} {
@@ -596,16 +582,9 @@ proc teaish__check-tcl {} {
 #
 # This sets up lots of defines, e.g. TEAISH_DIR.
 #
-proc teaish__find-extension {} {
+proc teaish__find_extension {} {
 
   msg-result "Looking for teaish extension..."
-  #
-  # We have to handle some flags manually because the extension must
-  # be loaded before [options] is run (so that the extension can
-  # inject its own options).
-  #
-  set extM ""; # teaish.make.in
-  set extT ""; # teaish.tcl
   # Helper for the foreach loop below.
   set lambdaMT {{mustHave fid dir} {
     if {[file isdir $dir]} {
@@ -620,7 +599,17 @@ proc teaish__find-extension {} {
     }
     return ""
   }}
+  #
+  # We have to handle some flags manually because the extension must
+  # be loaded before [options] is run (so that the extension can
+  # inject its own options).
+  #
+  #set extM ""; # teaish.make.in
+  set dirBld $::autosetup(builddir); # dir we're configuring under
+  set dirSrc $::autosetup(srcdir);   # where teaish's configure script lives
+  set extT {}; # teaish.tcl
   set largv {}; # rewritten $::argv
+  set gotHelpArg 0; # got the --help
   foreach arg $::argv {
     #puts "*** arg=$arg"
     switch -glob -- $arg {
@@ -634,21 +623,22 @@ proc teaish__find-extension {} {
         if {![file isdir $extD]} {
           proj-fatal "--teaish-extension-dir value is not a directory: $extD"
         }
-        set extM [apply $lambdaMT 0 teaish.make.in $extD]
         set extT [apply $lambdaMT 1 teaish.tcl $extD]
         define TEAISH_DIR $extD
       }
+      --help {
+        incr gotHelpArg
+      }
       default {
         lappend largv $arg
       }
     }
   }
   set ::argv $largv
-  set dirBld $::autosetup(builddir); # dir we're configuring under
-  set dirSrc $::autosetup(srcdir);   # where teaish's configure script lives
-  set dirExt [get-define TEAISH_DIR $dirBld] ; # dir with the extension
-  set extEqSrc [expr {$dirExt eq $dirSrc}]   ; # are we building in-tree vis-a-vis teaish core?
 
+  set dirExt [proj-coalesce \
+                [get-define TEAISH_DIR ""] \
+                $dirBld]; # dir with the extension
   #
   # teaish.tcl is a TCL script which implements various
   # interfaces described by this framework.
@@ -657,12 +647,14 @@ proc teaish__find-extension {} {
   #
   if {"" eq $extT} {
     set flist [list $dirExt/teaish.tcl]
-    if {!$extEqSrc} {
+    if {$dirExt ne $dirSrc} {
       lappend flist $dirSrc/teaish.tcl
     }
     if {![proj-first-file-found $flist extT]} {
-      if {"--help" in $::argv} {
-        return 0; # signals teaish-configure-core to process --help
+      if {$gotHelpArg} {
+        # Tell teaish-configure-core that the lack of extension is not
+        # an error when --help is used.
+        return 0;
       }
       proj-indented-notice -error "
 Did not find any of: $flist
@@ -675,44 +667,57 @@ If you are attempting an out-of-tree build, use
     proj-fatal "extension tcl file is not readable: $extT"
   }
   define TEAISH_TCL $extT
-  if {"" eq [get-define TEAISH_DIR ""]} {
+
+  if {"" eq $dirExt} {
     # If this wasn't set via --teaish-extension-dir then derive it from
     # $extT.
     #puts "extT=$extT dirExt=$dirExt"
     set dirExt [file dirname $extT]
-    define TEAISH_DIR $dirExt
   }
+  define TEAISH_DIR $dirExt
+  set ::teaish__Config(teaish-dir) $dirExt
+  # are we building in-tree vis-a-vis the extension?
+  set ::teaish__Config(blddir-is-extdir) \
+    [define TEAISH_ENABLE_DIST [expr {$dirBld eq $dirExt}]]
+  set addDist {{file} {
+    teaish-add-dist [file tail $file]
+  }}
+  apply $addDist $extT
+
   msg-result "Extension dir            = [get-define TEAISH_DIR]"
   msg-result "Extension config         = $extT"
 
+  define TEAISH_NAME [file tail [file dirname $extT]]
+
   #
-  # teaish.make provides some of the info for the main makefile,
+  # teaish.make[.in] provides some of the info for the main makefile,
   # like which source(s) to build and their build flags.
   #
-  # We use the first one of teaish.make.in we find in either
-  # the builddir or the srcdir.
+  # We use the first one of teaish.make.in or teaish.make we find in
+  # $dirExt.
   #
-  if {"" eq $extM} {
-    set flist [list $dirExt/teaish.make.in]
-    if {!$extEqSrc} {
-      lappend flist $dirSrc/teaish.make.in
+  if {[proj-first-file-found \
+         [list $dirExt/teaish.make.in $dirExt/teaish.make] \
+         extM]} {
+    if {[string match *.in $extM]} {
+      define TEAISH_MAKEFILE_IN $extM
+      define TEAISH_MAKEFILE [file rootname [file tail $extM]]
+      proj-dot-ins-append $extM [get-define TEAISH_MAKEFILE]
+    } else {
+      define TEAISH_MAKEFILE_IN ""
+      define TEAISH_MAKEFILE $extM
     }
-    proj-first-file-found $flist extM
-  }
-  if {"" ne $extM && [file readable $extM]} {
-    define TEAISH_MAKEFILE_IN $extM
-    define TEAISH_MAKEFILE [file rootname [file tail $extM]]
-    proj-dot-ins-append $extM [get-define TEAISH_MAKEFILE]
-    msg-result "Extension makefile       = $extM"
+    apply $addDist $extM
+    msg-result "Extension makefile      = $extM"
   } else {
     define TEAISH_MAKEFILE_IN ""
     define TEAISH_MAKEFILE ""
-    #proj-warn "Did not find a teaish.make.in."
   }
 
-  # Look for teaish.pkginit.tcl
-  set flist [list $dirExt/teaish.pkginit.tcl.in $dirExt/teaish.pkginit.tcl]
-  if {[proj-first-file-found $flist extI]} {
+  # Look for teaish.pkginit.tcl[.in]
+  if {[proj-first-file-found \
+         [list $dirExt/teaish.pkginit.tcl.in $dirExt/teaish.pkginit.tcl] \
+         extI]} {
     if {[string match *.in $extI]} {
       proj-dot-ins-append $extI
       define TEAISH_PKGINIT_TCL_IN $extI
@@ -721,7 +726,7 @@ If you are attempting an out-of-tree build, use
       define TEAISH_PKGINIT_TCL_IN ""
       define TEAISH_PKGINIT_TCL $extI
     }
-    teaish-add-dist [file tail $extI]
+    apply $addDist $extI
     msg-result "Extension post-load init = $extI"
     define TEAISH_PKGINIT_TCL_TAIL [file tail [get-define TEAISH_PKGINIT_TCL]]; # for use in pkgIndex.tcl
   }
@@ -734,14 +739,17 @@ If you are attempting an out-of-tree build, use
     define TEAISH_PKGINDEX_TCL_IN $extPI
     define TEAISH_PKGINDEX_TCL [file rootname [file tail $extPI]]
     proj-dot-ins-append $extPI
-    teaish-add-dist [file tail $extPI]
+    file delete -force -- [get-define TEAISH_PKGINDEX_TCL]
+    apply $addDist $extPI
     set piPolicy 0x01
-  } elseif {!$extEqSrc && [proj-first-file-found $dirSrc/pkgIndex.tcl.in extPI]} {
+  } elseif {![expr {$dirExt eq $dirSrc}]
+            && [proj-first-file-found $dirSrc/pkgIndex.tcl.in extPI]} {
     # If $dirSrc/pkgIndex.tcl.in exists, generate ./pkgIndex.tcl from
     # it.
     define TEAISH_PKGINDEX_TCL_IN $extPI
     define TEAISH_PKGINDEX_TCL [file rootname [file tail $extPI]]
     proj-dot-ins-append $extPI
+    file delete -force -- [get-define TEAISH_PKGINDEX_TCL]
     set piPolicy 0x02
   } elseif {[proj-first-file-found $dirExt/pkgIndex.tcl extPI]} {
     # if TEAISH_DIR/pkgIndex.tcl exists, assume it's a static file
@@ -749,18 +757,37 @@ If you are attempting an out-of-tree build, use
     define TEAISH_PKGINDEX_TCL_IN ""
     define TEAISH_PKGINDEX_TCL $extPI
     proj-dot-ins-append $extPI
+    apply $addDist $extPI
     set piPolicy 0x04
   }
 
   set ::teaish__Config(pkgindex-policy) $piPolicy
 
-  #
-  # Set some sane defaults...
-  #
-  define TEAISH_NAME [file tail [file dirname $extT]]
-  define TEAISH_PKGNAME [get-define TEAISH_NAME]
-  define TEAISH_LIBDIR_NAME [get-define TEAISH_PKGNAME]
-  define TEAISH_VERSION 0.0.0
+  # Look for teaish.test.tcl[.in]
+  apply {{addDist} {
+    set tdir $::teaish__Config(teaish-dir)
+    proj-assert {"" ne $tdir}
+    set flist [list $tdir/teaish.test.tcl.in $tdir/teaish.test.tcl]
+    if {[proj-first-file-found $flist ttt]} {
+      set tail [file tail $ttt]
+      set xt [file rootname $tail]
+      if {[string match *.in $ttt]} {
+        # Generate teaish.test.tcl from $ttt
+        file delete -force -- $xt; # ensure no stale copy is used
+        define TEAISH_TEST_TCL $xt
+        define TEAISH_TEST_TCL_IN $ttt
+        proj-dot-ins-append $ttt $xt
+        apply $addDist $tail
+      } else {
+        define TEAISH_TEST_TCL $ttt
+        define TEAISH_TEST_TCL_IN ""
+        apply $addDist $xt
+      }
+    } else {
+      define TEAISH_TEST_TCL ""
+      define TEAISH_TEST_TCL_IN ""
+    }
+  }} $addDist
 
   # TEAISH_OUT_OF_EXT_TREE = 1 if we're building from a dir other
   # than the extension's home dir.
@@ -768,20 +795,8 @@ If you are attempting an out-of-tree build, use
   define TEAISH_OUT_OF_EXT_TREE \
     [expr {[file-normalize $::autosetup(builddir)] ne $dteaish}]
 
-  #
-  # Defines which extensions may optionally make but are not required
-  # to.
-  #
-  foreach {optionalDef dflt} [subst {
-    TEAISH_LOAD_PREFIX "[string totitle [get-define TEAISH_PKGNAME]]"
-    TEAISH_MAKEFILE_CODE ""
-    TEAISH_ENABLE_DIST 1
-  }] {
-    define $optionalDef $dflt
-  }
-
   return 1
-}
+}; # teaish__find_extension
 
 # @teaish-add-cflags ?-p|prepend? ?-define? cflags...
 #
@@ -790,6 +805,16 @@ proc teaish-add-cflags {args} {
   proj-define-amend TEAISH_CFLAGS {*}$args
 }
 
+# @teaish-define-to-cflag defineName...
+#
+# Uses [proj-define-to-cflag] to expand a list of [define] keys, each
+# one a separate argument, to CFLAGS-style -D... form then appends
+# that to the current TEAISH_CFLAGS.
+#
+proc teaish-define-to-cflag {args} {
+  teaish-add-cflags [proj-define-to-cflag {*}$args]
+}
+
 # @teaish-add-ldflags ?-p|-prepend? ?-define? ldflags...
 #
 # Equivalent to [proj-define-amend TEAISH_LDFLAGS {*}$args].
@@ -824,33 +849,20 @@ proc teaish-prepend-ldflags {args} {
 # sources, but there are cases where it's not desired (e.g. when using
 # a source file from outside of the extension's dir).
 proc teaish-add-src {args} {
-  set dist 0
-  set xdir 0
   set i 0
-  foreach arg $args {
-    switch -exact -- $arg {
-      -dist {
-        set dist 1
-        set args [lassign $args -]
-      }
-      -dir {
-        set xdir 1
-        set args [lassign $args -]
-      }
-      default {
-        break;
-      }
-    }
+  proj-parse-simple-flags args flags {
+    -dist 0 {return 1}
+    -dir  0 {return 1}
   }
-  if {$dist} {
+  if {$flags(-dist)} {
     teaish-add-dist {*}$args
   }
-  if {$xdir} {
+  if {$flags(-dir)} {
     set xargs {}
     set d [get-define TEAISH_DIR]
     foreach arg $args {
       if {"" ne $arg} {
-        lappend xargs $d/$arg
+        lappend xargs [file join $d $arg]
       }
     }
     set args $xargs
@@ -861,8 +873,16 @@ proc teaish-add-src {args} {
 # @teaish-add-dist files-or-dirs...
 #
 # Equivalent to [proj-define-apend TEAISH_DIST_FILES ...].
+#
+# This is a no-op when the current build is not in the extension's
+# directory, as dist support is disabled in out-of-tree builds.
+#
+# It is not legal to call this until TEAISH_DIR has been reliably set
+# (via teaish__find_extension).
 proc teaish-add-dist {args} {
-  proj-define-amend TEAISH_DIST_FILES {*}$args
+  if {$::teaish__Config(blddir-is-extdir)} {
+    proj-define-amend TEAISH_DIST_FILES {*}$args
+  }
 }
 
 # teaish-add-install files...
@@ -963,19 +983,10 @@ proc teaish-feature-cache-check {{key 0} tgtVar} {
 #   -nostatus = do not emit "ok" or "no" at the end. This presumes
 #    that the caller will emit at least one newline before turning.
 proc teaish-check-cached {args} {
-  set quiet 0
-  set xargs {}
-  foreach arg $args {
-    switch -exact -- $arg {
-      -nostatus {
-        incr quiet
-      }
-      default {
-        lappend xargs $arg
-      }
-    }
+  proj-parse-simple-flags args flags {
+    -nostatus 0 {expr 1}
   }
-  lassign $xargs msg script
+  lassign $args msg script
   if {"" eq $msg} {
     set msg [proj-current-scope 1]
   }
@@ -989,7 +1000,7 @@ proc teaish-check-cached {args} {
     #puts "***** cached-check got code=$code rc=$rc"
     if {$code in {0 2}} {
       teaish-feature-cache-set 1 $rc
-      if {!$quiet} {
+      if {!$flags(-nostatus)} {
         if {$rc} {
           msg-result "ok"
         } else {
@@ -1117,24 +1128,28 @@ proc teaish__dump_defs_to_list {args} {
 #    not a generated file, so it will not try to overwrite or delete
 #    it.
 #
-#   --disable-dist [L]: disables the "dist" parts of the filtered
-#     Makefile.  May be used during initial loading of teaish.tcl.
-#
 # Emits a warning message for unknown arguments.
 proc teaish-pragma {args} {
   foreach arg $args {
     switch -exact -- $arg {
 
-      --disable-dist {
-        define TEAISH_ENABLE_DIST 0
-      }
-
       --have-own-pkgIndex.tcl {
-        set pi [file join [get-define TEAISH_DIR] pkgIndex.tcl]
-        if {![file exists $pi]} {
-          proj-fatal "teaish-pragmas $arg found no pkgIndex.tcl"
+        set flist [list \
+                     [file join $::teaish__Config(teaish-dir) pkgIndex.tcl.in] \
+                     [file join $::teaish__Config(teaish-dir) pkgIndex.tcl]]
+        if {[proj-first-file-found $flist tpi]} {
+          if {[string match *.in $tpi]} {
+            define TEAISH_PKGINDEX_TCL_IN $tpi
+            teaish-add-dist [file tail $tpi]
+            define TEAISH_PKGINDEX_TCL [file rootname [file tail $pi]]
+          } else {
+            define TEAISH_PKGINDEX_TCL_IN ""
+            define TEAISH_PKGINDEX_TCL $tpi
+            teaish-add-dist [file tail $tpi]
+          }
+        } else {
+          proj-fatal "teaish-pragma $arg found no package-local pkgIndex.tcl\[.in]"
         }
-        define TEAISH_PKGINDEX_TCL $pi
         set ::teaish__Config(pkgindex-policy) 0x10
       }
 
@@ -1142,6 +1157,13 @@ proc teaish-pragma {args} {
         proj-warn "Unknown [proj-current-scope] flag: $arg"
       }
     }
+
+#   --disable-dist [L]: disables the "dist" parts of the filtered
+#     Makefile.  May be used during initial loading of teaish.tcl.
+#
+#      --disable-dist {
+#        define TEAISH_ENABLE_DIST 0
+#      }
   }
 }
 
diff --git a/autoconf/tea/autosetup/feature-tests.tcl b/autoconf/tea/autosetup/feature-tests.tcl
index 7fac7a6acd..d6a54dd4d7 100644
--- a/autoconf/tea/autosetup/feature-tests.tcl
+++ b/autoconf/tea/autosetup/feature-tests.tcl
@@ -149,11 +149,11 @@ proc teaish-check-libmath {} {
 #
 #   use teaish/feature/$name
 #
-# to load $::autosetup(libdir)/teaish/feature/$name.tcl.
+# to load TEAISH_AUTOSETUP_DIR/feature/$name.tcl
 #
 # By default, if a proc named teaish-check-${name}-options is defined
 # after sourcing a file, it is called and its result is passed to
-# teaish-append-options. This can be suppressed with the -no-options
+# proj-append-options. This can be suppressed with the -no-options
 # flag.
 proc teaish-import-features {args} {
   set doOpt 1
@@ -176,7 +176,10 @@ proc teaish-import-features {args} {
     if {$doOpt} {
       set n "teaish-check-${arg}-options"
       if {[llength [info proc $n]] > 0} {
-        proj-options-add [$n]
+        set x [$n]
+        if {"" ne $x} {
+          options-add $x
+        }
       }
     }
   }
diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl
index 3d580b07c4..64222b6833 100644
--- a/autosetup/proj.tcl
+++ b/autosetup/proj.tcl
@@ -61,6 +61,7 @@ array set proj__Config {
   self-tests 0
 }
 
+
 #
 # List of dot-in files to filter in the final stages of
 # configuration. Some configuration steps may append to this.  Each
@@ -72,13 +73,6 @@ array set proj__Config {
 #
 set proj__Config(dot-in-files) [list]
 set proj__Config(isatty) [isatty? stdout]
-#
-# A list of lists of Autosetup [options]-format --flags definitions.
-# Append to this using [proj-options-add] and use
-# [proj-options-combine] to merge them into a single list for passing
-# to [options].
-#
-set proj__Config(extra-options} {}
 
 ########################################################################
 # @proj-warn msg
@@ -91,13 +85,22 @@ proc proj-warn {args} {
 }
 
 ########################################################################
-# @proj-error msg
+# @proj-error ?-up...? msg
 #
 # Emits an error message to stderr and exits with non-0. All args are
 # appended with a space between each.
+#
+# The calling scope's name is used in the error message. To instead
+# use the name of a call higher up in the stack, use -up once for each
+# additional level.
 proc proj-fatal {args} {
   show-notices
-  puts stderr [join [list "ERROR: \[[proj-current-scope 1]]:" {*}$args] " "]
+  set lvl 1
+  while {"-up" eq [lindex $args 0]} {
+    set args [lassign $args -]
+    incr lvl
+  }
+  puts stderr [join [list "ERROR: \[[proj-current-scope $lvl]]:" {*}$args] " "]
   exit 1
 }
 
@@ -129,7 +132,7 @@ proc proj-assert {script {msg ""}} {
 # to bold that text, else it returns $str as-is.
 proc proj-bold {args} {
   if {$::autosetup(iswin) || !$::proj__Config(isatty)} {
-    return $str
+    return [join $args]
   }
   return "\033\[1m${args}\033\[0m"
 }
@@ -1609,31 +1612,28 @@ proc proj-dot-ins-list {} {
 # -clear: after processing, empty the dot-ins list. This effectively
 #  makes proj-dot-ins-append available for re-use.
 proc proj-dot-ins-process {args} {
-  set flags ""
-  set clear 0
-  set validate 0
-  foreach arg $args {
-    switch -exact -- $arg {
-      -touch    {set flags "-touch"}
-      -clear    {incr clear}
-      -validate {incr validate}
-      default   break
-    }
+  proj-parse-simple-flags args flags {
+    -touch   "" {return "-touch"}
+    -clear    0 {expr 1}
+    -validate 0 {expr 1}
+  }
+  if {[llength $args] > 0} {
+    error "Invalid argument to [proj-current-scope]: $args"
   }
   foreach f $::proj__Config(dot-in-files) {
     proj-assert {3==[llength $f]} \
       "Expecting proj-dot-ins-list to be stored in 3-entry lists"
     lassign $f fIn fOut fScript
     #puts "DOING $fIn  ==> $fOut"
-    proj-make-from-dot-in {*}$flags $fIn $fOut
-    if {$validate} {
+    proj-make-from-dot-in {*}$flags(-touch) $fIn $fOut
+    if {$flags(-validate)} {
       proj-validate-no-unresolved-ats $fOut
     }
     if {"" ne $fScript} {
       uplevel 1 "set fileIn $fIn; set fileOut $fOut; eval {$fScript}"
     }
   }
-  if {$clear} {
+  if {$flags(-clear)} {
     set ::proj__Config(dot-in-files) [list]
   }
 }
@@ -1735,18 +1735,22 @@ proc proj-define-append {defineName args} {
 # technically correct and still relevant on some environments.
 #
 # See: proj-append-to
-proc proj-define-amend {defName args} {
+proc proj-define-amend {args} {
+  set defName ""
   set prepend 0
   set isdefs 0
   set xargs [list]
   foreach arg $args {
     switch -exact -- $arg {
       -p - -prepend { set prepend 1 }
-      -d - -define {
-        set isdefs 1
-      }
+      -d - -define  { set isdefs 1 }
+      "" {}
       default {
-        lappend xargs $arg
+        if {"" eq $defName} {
+          set defName $arg
+        } else {
+          lappend xargs $arg
+        }
       }
     }
   }
@@ -1756,7 +1760,10 @@ proc proj-define-amend {defName args} {
     foreach arg $args {
       lappend xargs [get-define $arg ""]
     }
+    set args $xargs
   }
+#  puts "**** args=$args"
+#  puts "**** xargs=$xargs"
 
   set args $xargs
   if {$prepend} {
@@ -1767,36 +1774,97 @@ proc proj-define-amend {defName args} {
   }
 }
 
-# @proj-options-add list
+# @proj-define-to-cflag ?-list? defineName...
 #
-# Adds a list of options to the pending --flag processing.  It must be
-# in the format used by Autosetup's [options] function.
+# Treat each argument as the name of a [define]
+# and attempt to render it like a CFLAGS value:
 #
-# This will have no useful effect if called from after [options]
-# is called.
-proc proj-options-add {list} {
-  lappend ::proj__Config(extra-options) $list
+#  -D$name
+#  -D$name=value
+#
+# If treats integers as numbers and everything else as a quoted
+# string, noting that it does not handle strings which themselves
+# contain quotes.
+#
+# By default it returns the result as string of all -D... flags,
+# but if passed the -list flag it will return a list of the
+# individual CFLAGS.
+proc proj-define-to-cflag {args} {
+  set rv {}
+  set xargs {}
+  set returnList 0;
+  foreach arg $args {
+    switch -exact -- $arg {
+      -list {incr returnList}
+      default {
+        lappend xargs $arg
+      }
+    }
+  }
+  foreach d $xargs {
+    set v [get-define $d ""]
+    set li [list -D${d}]
+    if {[string is integer -strict $v]} {
+      lappend li = $v
+    } elseif {"" eq $d} {
+    } else {
+      lappend li = {"} $v {"}
+    }
+    lappend rv [join $li ""]
+  }
+  if {$returnList} { return $rv }
+  return [join $rv]
 }
 
-# @proj-options-combine list1 ?...listN?
-#
-# Expects each argument to be a list of options compatible with
-# autosetup's [options] function. This function concatenates the
-# contents of each list into a new top-level list, stripping the outer
-# list part of each argument, and returning that list
-#
-# If passed no arguments, it uses the list generated by calls to
-# [proj-options-add].
-proc proj-options-combine {args} {
-  set rv [list]
-  if {0 == [llength $args]} {
-    set args $::proj__Config(extra-options)
+
+if {0} {
+  # Turns out that autosetup's [options-add] essentially does exactly
+  # this...
+
+  # A list of lists of Autosetup [options]-format --flags definitions.
+  # Append to this using [proj-options-add] and use
+  # [proj-options-combine] to merge them into a single list for passing
+  # to [options].
+  #
+  set ::proj__Config(extra-options) {}
+
+  # @proj-options-add list
+  #
+  # Adds a list of options to the pending --flag processing.  It must be
+  # in the format used by Autosetup's [options] function.
+  #
+  # This will have no useful effect if called from after [options]
+  # is called.
+  #
+  # Use [proj-options-combine] to get a combined list of all added
+  # options.
+  #
+  # PS: when writing this i wasn't aware of autosetup's [options-add],
+  # works quite similarly. Only the timing is different.
+  proc proj-options-add {list} {
+    lappend ::proj__Config(extra-options) $list
   }
-  foreach e $args {
+
+  # @proj-options-combine list1 ?...listN?
+  #
+  # Expects each argument to be a list of options compatible with
+  # autosetup's [options] function. This function concatenates the
+  # contents of each list into a new top-level list, stripping the outer
+  # list part of each argument, and returning that list
+  #
+  # If passed no arguments, it uses the list generated by calls to
+  # [proj-options-add].
+  proc proj-options-combine {args} {
+    set rv [list]
+    if {0 == [llength $args]} {
+      set args $::proj__Config(extra-options)
+    }
+    foreach e $args {
       lappend rv {*}$e
+    }
+    return $rv
   }
-  return $rv
-}
+}; # proj-options-*
 
 # Internal cache for use via proj-cache-*.
 array set proj__Cache {}
@@ -1873,6 +1941,155 @@ proc proj-cache-check {{key 0} {addLevel 0} tgtVar} {
   return $rc
 }
 
+# @proj-coalesce ...args
+#
+# Returns the first argument which is not empty (eq ""), or an empty
+# string on no match.
+proc proj-coalesce {args} {
+  foreach arg $args {
+    if {"" ne $arg} {
+      return $arg
+    }
+  }
+  return ""
+}
+
+# @proj-parse-simple-flags ...
+#
+# An experiment. Do not use.
+#
+# A helper to parse flags from proc argument lists.
+#
+# Expects a list of arguments to parse, an array name to store any
+# -flag values to, and a prototype object which declares the flags.
+#
+# The prototype must be a list in one of the following forms:
+#
+#   -flag defaultValue {script}
+#
+#   -flag => defaultValue
+#   -----^--^ (wiith spaces there!)
+#
+# Repeated for each flag.
+#
+# The first form represents a basic flag with no associated
+# following argument. The second form extracts its value
+# from the following argument in $argvName.
+#
+# The first argument to this function is the name of a var holding the
+# args to parse. It will be overwritten, possibly with a smaller list.
+#
+# The second argument the name of an array variable to create in the
+# caller's scope. (Pneumonic: => points to the next argument.)
+#
+# For the first form of flag, $script is run in the caller's scope if
+# $argv contains -flag, and the result of that script is the new value
+# for $tgtArrayName(-flag). This function intercepts [return $val]
+# from $script. Any empty script will result in the flag having ""
+# assigned to it.
+#
+# The args list is only inspected until the first argument which is
+# not described by $prototype. i.e. the first "non-flag" (not counting
+# values consumed for flags defined like --flag=>default).
+#
+# If a "--" flag is encountered, no more arguments are inspected as
+# flags. If "--" is the first non-flag argument, the "--" flag is
+# removed from the results but all remaining arguments are passed
+# through. If "--" appears after the first non-flag, it is retained.
+#
+# This function assumes that each flag is unique, and using a flag
+# more than once behaves in a last-one-wins fashion.
+#
+# Any $argv entries not described in $prototype are not treated
+# as flags.
+#
+# Returns the number of flags it processed in $argvName.
+#
+# Example:
+#
+# set args [list -foo -bar {blah} 8 9 10]
+# set args [proj-parse-simple-flags args flags {
+#   -foo    0  {expr 1}
+#   -bar    => 0
+#   -no-baz 2  {return 0}
+# }
+#
+# After that $flags would contain {-foo 1 -bar {blah} -no-baz 2}
+# and $args would be {8 9 10}.
+#
+proc proj-parse-simple-flags {argvName tgtArrayName prototype} {
+  upvar $argvName argv
+  upvar $tgtArrayName tgt
+  array set dflt {}
+  array set scripts {}
+  array set consuming {}
+  set n [llength $prototype]
+  # Figure out what our flags are...
+  for {set i 0} {$i < $n} {} {
+    set k [lindex $prototype $i]
+    #puts "**** #$i of $n k=$k"
+    proj-assert {[string match -* $k]} \
+      "Invalid flag value for [proj-current-scope]: $k"
+    set v ""
+    set s ""
+    if {"=>" eq [lindex $prototype [expr {$i + 1}]]} {
+      incr i 2
+      if {$i >= $n} {
+        proj-fatal "Missing argument for $k => flag"
+      }
+      set consuming($k) 1
+      set v [lindex $prototype $i]
+    } else {
+      set v [lindex $prototype [incr i]]
+      set s [lindex $prototype [incr i]]
+      set scripts($k) $s
+    }
+    incr i
+    #puts "**** #$i of $n k=$k v=$v s=$s"
+    set dflt($k) $v
+  }
+  # Now look for those flags in the source list
+  array set tgt $dflt
+  unset dflt
+  set rc 0
+  set rv {}
+  set skipMode 0
+  set n [llength $argv]
+  for {set i 0} {$i < $n} {} {
+    set arg [lindex $argv $i]
+    if {$skipMode} {
+      lappend rv $arg
+    } elseif {"--" eq $arg} {
+      incr skipMode
+    } elseif {[info exists tgt($arg)]} {
+      if {[info exists consuming($arg)]} {
+        if {$i + 1 >= $n} {
+          proj-fatal "Missing argument for $arg flag"
+        }
+        set tgt($arg) [lindex $argv [incr i]]
+      } elseif {"" eq $scripts($arg)} {
+        set tgt($arg) ""
+      } else {
+        #puts "**** running scripts($arg) $scripts($arg)"
+        set code [catch {uplevel 1 $scripts($arg)} rc xopt]
+        #puts "**** tgt($arg)=$scripts($arg) code=$code rc=$rc"
+        if {$code in {0 2}} {
+          set tgt($arg) $rc
+        } else {
+          return {*}$xopt $rc
+        }
+      }
+      incr rc
+    } else {
+      incr skipMode
+      lappend rv $arg
+    }
+    incr i
+  }
+  set argv $rv
+  return $rc
+}
+
 if {$::proj__Config(self-tests)} {
   apply {{} {
     proj-warn "Test code for proj-cache"
@@ -1890,10 +2107,10 @@ if {$::proj__Config(self-tests)} {
     proj-assert {[proj-cache-check check]}
     proj-assert {"abc" eq $check}
 
-    parray ::proj__Cache;
+    #parray ::proj__Cache;
     proj-assert {"" ne [proj-cache-remove]}
-    proj-assert {"" eq [proj-cache-remove]}
     proj-assert {![proj-cache-check check]}
+    proj-assert {"" eq [proj-cache-remove]}
     proj-assert {"" eq $check}
   }}
 }
diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl
index 1bd5a184ee..3f7d174d7a 100644
--- a/autosetup/sqlite-config.tcl
+++ b/autosetup/sqlite-config.tcl
@@ -428,13 +428,12 @@ proc sqlite-configure {buildMode configScript} {
   foreach {group XY} [subst -nobackslashes -nocommands $allFlags] {
     foreach {X Y} $XY {
       if { $buildMode in $X || "*" in $X } {
-        proj-options-add $Y
+        options-add $Y
       }
     }
   }
-  set opts [proj-options-combine]
   #lappend opts "soname:=duplicateEntry => {x}"; #just testing
-  if {[catch {options $opts} msg xopts]} {
+  if {[catch {options {}} msg xopts]} {
     # Workaround for 
     # where [options] behaves oddly on _some_ TCL builds when it's
     # called from deeper than the global scope.
diff --git a/manifest b/manifest
index c03eebfa82..716f0b7239 100644
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Correctly\shandle\sthe\scase\sof\sa\smulti-column\sUNIQUE\sconstraint\sthat\scontains\nthe\sROWID\sas\sone\sof\sit\scolumns,\sand\sthen\sthe\scolumns\sof\sthat\sUNIQUE\sare\nused\sin\sa\srow-value\sIN\soperator\sas\sa\sWHERE\sclause\sconstraint.\s\sReported\sby\n[forum:/forumpost/b9647a113b465950|forum\spost\sb9647a113b].\s\sProblem\nintroduced\sby\s[723f1be3d4a905a6],\spart\sof\sticket\s[da78413751863].
-D 2025-04-15T21:59:38.221
+C Latest\supstream\steaish\sfor\sfixes\sand\simprovements.
+D 2025-04-16T12:48:27.368
 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
@@ -26,8 +26,8 @@ F autoconf/tea/Makefile.in 2a90dfab1e95cb3ec610429c78d88d4a7d26beb080ad45ff6a059
 F autoconf/tea/README.txt 656d4686c509d375f5988ff3deda94f65fe6cd8358cd55d1f1dcc7b6e2ff73aa
 F autoconf/tea/auto.def 81e2617cfb90d53c19b53b3ec632cd2893bf32f2e5dd272b1116fadf2ea86c2d
 F autoconf/tea/autosetup/README.txt b40071e6f8506500a2f7f71d5fc69e0bf87b9d7678dd9da1e5b4d0acbf40b1ca
-F autoconf/tea/autosetup/core.tcl b0d2781acbd2bebbcf4baeb4c0a1fae4814e251df7a1b4f4db10e88c57d03eef
-F autoconf/tea/autosetup/feature-tests.tcl 87b448e620b043c8c23b6cb727a3a5e485b61b600077222b6799e9f64aab941a
+F autoconf/tea/autosetup/core.tcl 4b828c8c77bfe7c94c7331d6dbb9efd1077160343867b4bee6d83c9977a11b6c
+F autoconf/tea/autosetup/feature-tests.tcl 3ccf2fd1cad368c7ed958a869d8b915fada7f164a6b382c7381540c4892476f8
 F autoconf/tea/autosetup/tester.tcl d94aa9d51d2a22062e61db97310c2502ca0df50ca87108482c3bccf8f41db127
 F autoconf/tea/configure d0b12b984edca6030d1976375b80157ac78b5b90a5b4f0dcee39357f63f4a80b x
 F autoconf/tea/doc/sqlite3.n 9a97f4f717ceab73004ea412af7960625c1cb24b5c25e4ae4c8b5d8fa4300f4e
@@ -51,8 +51,8 @@ F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e
 F autosetup/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1821baf61bc86a7e
 F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049
 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba
-F autosetup/proj.tcl 3e9f84104d401a353f53961db7d361469bf6d614897c11144aecedc9727120d3
-F autosetup/sqlite-config.tcl d4e888fc94e677e3820fea998747c94b8dcc4ff346a14253bf7f5344f526ceef
+F autosetup/proj.tcl ce217cdf7defa6b69664039039d7bbf064d00cb849e9cc64c6597f0f447e5e84
+F autosetup/sqlite-config.tcl bde169c42d5d5331485ae7785f5dd19ca1aa01315787e8306441c472ad4e4201
 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9
 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x
 F contrib/sqlitecon.tcl eb4c6578e08dd353263958da0dc620f8400b869a50d06e271ab0be85a51a08d3
@@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350
 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 158e8c4fd7bdfc1cd4c0135abecd0d00994cd4027cf74ce6e5cf73d76475ae95
-R c2d14e3a5c8d8bcc253d1803871a054b
-U drh
-Z 7bbbfb8e256d1c10ef6ff3242542ea0b
+P d22475b81c4e26ccc50f3b5626d43b32f7a2de34e5a764539554665bdda735d5
+R 244c408285d69971e2cf8a84cb501cc6
+U stephan
+Z cd79baf6d120e2ca68da7047ac9f0e56
 # Remove this line to create a well-formed Fossil manifest.
diff --git a/manifest.uuid b/manifest.uuid
index a530b41c17..bfd867d43f 100644
--- a/manifest.uuid
+++ b/manifest.uuid
@@ -1 +1 @@
-d22475b81c4e26ccc50f3b5626d43b32f7a2de34e5a764539554665bdda735d5
+8f9148b33e01aa7963140704ef16e4304799e5842fa60e55373ccdabe8e3616d

From b70d450426121ba8bec74f4f9b525d12ed954649 Mon Sep 17 00:00:00 2001
From: stephan 
Date: Wed, 16 Apr 2025 14:21:48 +0000
Subject: [PATCH 110/120] A portability fix for proj.tcl: some Tcl builds do
 not like (array set x $someArray). Also better --mandir handling on Haiku
 (where the former problem was found).7

FossilOrigin-Name: 849534499d9b2056c0eabef7f3e65f79f58e8a6fefb3f7603de44774da7166b5
---
 autosetup/proj.tcl | 21 +++++++++++++++------
 manifest           | 12 ++++++------
 manifest.uuid      |  2 +-
 3 files changed, 22 insertions(+), 13 deletions(-)

diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl
index 64222b6833..d4fcdc590f 100644
--- a/autosetup/proj.tcl
+++ b/autosetup/proj.tcl
@@ -1526,19 +1526,28 @@ proc proj-tclConfig-sh-to-autosetup {tclConfigSh} {
 # proj-remap-autoconf-dir-vars late in the config process (immediately
 # before ".in" files are filtered).
 #
+# Similar modifications may be made for --mandir.
+#
 # Returns 1 if it modifies the environment, else 0.
 proc proj-tweak-default-env-dirs {} {
+  set rc 0
   switch -glob -- [get-define host] {
     *-haiku {
-      set hpre /boot/home/config/non-packaged
       if {![proj-opt-was-provided prefix]} {
-        proj-opt-set prefix $hpre
-        define prefix $hpre
-        return 1
+        set hdir /boot/home/config/non-packaged
+        proj-opt-set prefix $hdir
+        define prefix $hdir
+        incr rc
+      }
+      if {![proj-opt-was-provided mandir]} {
+        set hdir /boot/system/documentation/man
+        proj-opt-set mandir $hdir
+        define mandir $hdir
+        incr rc
       }
     }
   }
-  return 0
+  return $rc
 }
 
 ########################################################################
@@ -2049,7 +2058,7 @@ proc proj-parse-simple-flags {argvName tgtArrayName prototype} {
     set dflt($k) $v
   }
   # Now look for those flags in the source list
-  array set tgt $dflt
+  array set tgt [array get dflt]
   unset dflt
   set rc 0
   set rv {}
diff --git a/manifest b/manifest
index 716f0b7239..3093a167fd 100644
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Latest\supstream\steaish\sfor\sfixes\sand\simprovements.
-D 2025-04-16T12:48:27.368
+C A\sportability\sfix\sfor\sproj.tcl:\ssome\sTcl\sbuilds\sdo\snot\slike\s(array\sset\sx\s$someArray).\sAlso\sbetter\s--mandir\shandling\son\sHaiku\s(where\sthe\sformer\sproblem\swas\sfound).7
+D 2025-04-16T14:21:48.040
 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
@@ -51,7 +51,7 @@ F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e
 F autosetup/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1821baf61bc86a7e
 F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049
 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba
-F autosetup/proj.tcl ce217cdf7defa6b69664039039d7bbf064d00cb849e9cc64c6597f0f447e5e84
+F autosetup/proj.tcl 5d214dd3e9ffc7cf8dfda0b2f047c76316bbe70ad5bb0d715fee75c8676daeea
 F autosetup/sqlite-config.tcl bde169c42d5d5331485ae7785f5dd19ca1aa01315787e8306441c472ad4e4201
 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9
 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x
@@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350
 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P d22475b81c4e26ccc50f3b5626d43b32f7a2de34e5a764539554665bdda735d5
-R 244c408285d69971e2cf8a84cb501cc6
+P 8f9148b33e01aa7963140704ef16e4304799e5842fa60e55373ccdabe8e3616d
+R aa0fe7da73c9edbabf2fa6a65ab77ae7
 U stephan
-Z cd79baf6d120e2ca68da7047ac9f0e56
+Z dbb524d743adce9b01d6d0dc64cf862b
 # Remove this line to create a well-formed Fossil manifest.
diff --git a/manifest.uuid b/manifest.uuid
index bfd867d43f..9c1933435f 100644
--- a/manifest.uuid
+++ b/manifest.uuid
@@ -1 +1 @@
-8f9148b33e01aa7963140704ef16e4304799e5842fa60e55373ccdabe8e3616d
+849534499d9b2056c0eabef7f3e65f79f58e8a6fefb3f7603de44774da7166b5

From cd83a85e0583b320fe054160e697d992a2e7db2d Mon Sep 17 00:00:00 2001
From: stephan 
Date: Wed, 16 Apr 2025 15:40:40 +0000
Subject: [PATCH 111/120] Change the target libdir name in the teaish build to
 match historical tea builds.

FossilOrigin-Name: 8ae437301ed0cf71ef0e07be07917d9702221d27bdc98491209d8f28c7a500e2
---
 autoconf/tea/teaish.tcl | 10 ++++------
 manifest                | 12 ++++++------
 manifest.uuid           |  2 +-
 3 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/autoconf/tea/teaish.tcl b/autoconf/tea/teaish.tcl
index 049f500020..1107600845 100644
--- a/autoconf/tea/teaish.tcl
+++ b/autoconf/tea/teaish.tcl
@@ -1,14 +1,12 @@
 # Teaish configure script for the SQLite TCL extension
 
-define TEAISH_NAME sqlite
-define TEAISH_PKGNAME sqlite3
-define TEAISH_LIBDIR_NAME sqlite3
+define TEAISH_NAME sqlite; # name used in dist tarballs and as the libdir prefix
+define TEAISH_PKGNAME sqlite3; # name for purposes of Tcl_PkgProvide()
 define TEAISH_LOAD_PREFIX Sqlite3; # 2nd arg to [load]
-#
-# Get the version...
-#
 define TEAISH_VERSION [proj-file-content -trim [get-define TEAISH_DIR]/../VERSION]
 proj-assert {[string match 3.*.* [get-define TEAISH_VERSION]]}
+define TEAISH_LIBDIR_NAME \
+  [join [list [get-define TEAISH_NAME] [get-define TEAISH_VERSION]] ""]
 
 #
 # Object for communicating certain config-time state across various
diff --git a/manifest b/manifest
index 3093a167fd..cb85565159 100644
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C A\sportability\sfix\sfor\sproj.tcl:\ssome\sTcl\sbuilds\sdo\snot\slike\s(array\sset\sx\s$someArray).\sAlso\sbetter\s--mandir\shandling\son\sHaiku\s(where\sthe\sformer\sproblem\swas\sfound).7
-D 2025-04-16T14:21:48.040
+C Change\sthe\starget\slibdir\sname\sin\sthe\steaish\sbuild\sto\smatch\shistorical\stea\sbuilds.
+D 2025-04-16T15:40:40.262
 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
@@ -33,7 +33,7 @@ F autoconf/tea/configure d0b12b984edca6030d1976375b80157ac78b5b90a5b4f0dcee39357
 F autoconf/tea/doc/sqlite3.n 9a97f4f717ceab73004ea412af7960625c1cb24b5c25e4ae4c8b5d8fa4300f4e
 F autoconf/tea/license.terms 13bd403c9610fd2b76ece0ab50c4c5eda933d523
 F autoconf/tea/pkgIndex.tcl.in 2c99a64a0eff5dc2ad8e9657bb564fae2dbdfdb6b77a4c49b4387bd5a25c42ef
-F autoconf/tea/teaish.tcl 2661246d497e263ed05f436421758c5035ad1fc3a1c7484f6484844b61281913
+F autoconf/tea/teaish.tcl dbed8b4cc299e459c6d221262f884bdb27029bdb218e0590ededbe65bb926284
 F autoconf/tea/teaish.test.tcl cfe94e1fb79dd078f650295be59843d470125e0cc3a17a1414c1fb8d77f4aea6
 F autoconf/tea/teaish.tester.tcl.in 743fd0fe1e667f82fd8fc3ebe0a5c77763e4dbed7bbc8605a9d4b1d0663dac78
 F autosetup/LICENSE 41a26aebdd2cd185d1e2b210f71b7ce234496979f6b35aef2cbf6b80cbed4ce4
@@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350
 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 8f9148b33e01aa7963140704ef16e4304799e5842fa60e55373ccdabe8e3616d
-R aa0fe7da73c9edbabf2fa6a65ab77ae7
+P 849534499d9b2056c0eabef7f3e65f79f58e8a6fefb3f7603de44774da7166b5
+R c663d63347fffecf7bafd62061283993
 U stephan
-Z dbb524d743adce9b01d6d0dc64cf862b
+Z 52b71a2b4e4aa998a2fc1dd4aabdcd89
 # Remove this line to create a well-formed Fossil manifest.
diff --git a/manifest.uuid b/manifest.uuid
index 9c1933435f..dc467953be 100644
--- a/manifest.uuid
+++ b/manifest.uuid
@@ -1 +1 @@
-849534499d9b2056c0eabef7f3e65f79f58e8a6fefb3f7603de44774da7166b5
+8ae437301ed0cf71ef0e07be07917d9702221d27bdc98491209d8f28c7a500e2

From 6fe2a9a8f1e5c59f0b9dd491fe6f3e10a49ecc86 Mon Sep 17 00:00:00 2001
From: drh <>
Date: Wed, 16 Apr 2025 17:36:26 +0000
Subject: [PATCH 112/120] Attempt to provide EBCDIC translations to the tables
 in the JSON implementation.  The SQLite developers do not have access to any
 computers using EBCDIC and so have no way to test this patch, and cannot
 vouch for its accuracy.

FossilOrigin-Name: 84e698f38429c142caaa66ac086410f2035691b2ad39ad2fc4e0ebc31dd58a5b
---
 manifest      |  14 +++---
 manifest.uuid |   2 +-
 src/json.c    | 117 ++++++++++++++++++++++++++++++++++++--------------
 3 files changed, 93 insertions(+), 40 deletions(-)

diff --git a/manifest b/manifest
index cb85565159..5676b26985 100644
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Change\sthe\starget\slibdir\sname\sin\sthe\steaish\sbuild\sto\smatch\shistorical\stea\sbuilds.
-D 2025-04-16T15:40:40.262
+C Attempt\sto\sprovide\sEBCDIC\stranslations\sto\sthe\stables\sin\sthe\sJSON\nimplementation.\s\sThe\sSQLite\sdevelopers\sdo\snot\shave\saccess\sto\sany\ncomputers\susing\sEBCDIC\sand\sso\shave\sno\sway\sto\stest\sthis\spatch,\sand\ncannot\svouch\sfor\sits\saccuracy.
+D 2025-04-16T17:36:26.944
 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
@@ -746,7 +746,7 @@ F src/hash.h 46b92795a95bfefb210f52f0c316e9d7cdbcdd7e7fcfb0d8be796d3a5767cddf
 F src/hwtime.h f9c2dfb84dce7acf95ce6d289e46f5f9d3d1afd328e53da8f8e9008e3b3caae6
 F src/in-operator.md 10cd8f4bcd225a32518407c2fb2484089112fd71
 F src/insert.c d05934dfab2c5c0c480fc6fd2038f11215661de08ea6ff38d2563216bd555c1b
-F src/json.c fbae43c3920110be8d5307003d37d2b85b9bfb6d6d70fcb56ab68204026141af
+F src/json.c d0e1c62a9689018fe5876b1a1eb574e4ab7a40e0928e0e5adda8b3860c70e1b8
 F src/legacy.c d7874bc885906868cd51e6c2156698f2754f02d9eee1bae2d687323c3ca8e5aa
 F src/loadext.c 7432c944ff197046d67a1207790a1b13eec4548c85a9457eb0896bb3641dfb36
 F src/main.c 07f78d917ffcdf327982840cfd8e855fd000527a2ea5ace372ce4febcbd0bf97
@@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350
 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 849534499d9b2056c0eabef7f3e65f79f58e8a6fefb3f7603de44774da7166b5
-R c663d63347fffecf7bafd62061283993
-U stephan
-Z 52b71a2b4e4aa998a2fc1dd4aabdcd89
+P 8ae437301ed0cf71ef0e07be07917d9702221d27bdc98491209d8f28c7a500e2
+R c64f1aa94a03741a3b8d9bb200ed893f
+U drh
+Z 0fc17037f0ec1a61cba3bc34abd61d37
 # Remove this line to create a well-formed Fossil manifest.
diff --git a/manifest.uuid b/manifest.uuid
index dc467953be..12bf847461 100644
--- a/manifest.uuid
+++ b/manifest.uuid
@@ -1 +1 @@
-8ae437301ed0cf71ef0e07be07917d9702221d27bdc98491209d8f28c7a500e2
+84e698f38429c142caaa66ac086410f2035691b2ad39ad2fc4e0ebc31dd58a5b
diff --git a/src/json.c b/src/json.c
index 0ab46c5ae1..9c38bde985 100644
--- a/src/json.c
+++ b/src/json.c
@@ -151,23 +151,47 @@ static const char * const jsonbType[] = {
 ** increase for the text-JSON parser.  (Ubuntu14.10 gcc 4.8.4 x64 with -Os).
 */
 static const char jsonIsSpace[] = {
-  0, 0, 0, 0, 0, 0, 0, 0,  0, 1, 1, 0, 0, 1, 0, 0,
-  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,
-  1, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,
-  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,
-  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,
-  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,
-  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,
-  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,
+#ifdef SQLITE_ASCII
+/*0  1  2  3  4  5  6  7   8  9  a  b  c  d  e  f  */
+  0, 0, 0, 0, 0, 0, 0, 0,  0, 1, 1, 0, 0, 1, 0, 0,  /* 0 */
+  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,  /* 1 */
+  1, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,  /* 2 */
+  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,  /* 3 */
+  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,  /* 4 */
+  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,  /* 5 */
+  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,  /* 6 */
+  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,  /* 7 */
+
+  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,  /* 8 */
+  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,  /* 9 */
+  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,  /* a */
+  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,  /* b */
+  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,  /* c */
+  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,  /* d */
+  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,  /* e */
+  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,  /* f */
+#endif
+#ifdef SQLITE_EBCDIC
+/*0  1  2  3  4  5  6  7   8  9  a  b  c  d  e  f  */
+  0, 0, 0, 0, 0, 1, 0, 0,  0, 0, 0, 0, 0, 1, 0, 0,  /* 0 */
+  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,  /* 1 */
+  0, 0, 0, 0, 0, 1, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,  /* 2 */
+  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,  /* 3 */
+  1, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,  /* 4 */
+  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,  /* 5 */
+  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,  /* 6 */
+  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,  /* 7 */
+
+  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,  /* 8 */
+  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,  /* 9 */
+  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,  /* a */
+  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,  /* b */
+  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,  /* c */
+  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,  /* d */
+  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,  /* e */
+  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,  /* f */
+#endif
 
-  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,
-  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,
-  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,
-  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,
-  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,
-  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,
-  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,
-  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,
 };
 #define jsonIsspace(x) (jsonIsSpace[(unsigned char)x])
 
@@ -175,7 +199,13 @@ static const char jsonIsSpace[] = {
 ** The set of all space characters recognized by jsonIsspace().
 ** Useful as the second argument to strspn().
 */
+#ifdef SQLITE_ASCII
 static const char jsonSpaces[] = "\011\012\015\040";
+#endif
+#ifdef SQLITE_EBCDIC
+static const char jsonSpaces[] = "\005\045\015\100";
+#endif
+
 
 /*
 ** Characters that are special to JSON.  Control characters,
@@ -184,23 +214,46 @@ static const char jsonSpaces[] = "\011\012\015\040";
 ** it in the set of special characters.
 */
 static const char jsonIsOk[256] = {
-  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,
-  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,
-  1, 1, 0, 1, 1, 1, 1, 0,  1, 1, 1, 1, 1, 1, 1, 1,
-  1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,
-  1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,
-  1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 0, 1, 1, 1,
-  1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,
-  1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,
+#ifdef SQLITE_ASCII
+/*0  1  2  3  4  5  6  7   8  9  a  b  c  d  e  f  */
+  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,  /* 0 */
+  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,  /* 1 */
+  1, 1, 0, 1, 1, 1, 1, 0,  1, 1, 1, 1, 1, 1, 1, 1,  /* 2 */
+  1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,  /* 3 */
+  1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,  /* 4 */
+  1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 0, 1, 1, 1,  /* 5 */
+  1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,  /* 6 */
+  1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,  /* 7 */
 
-  1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,
-  1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,
-  1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,
-  1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,
-  1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,
-  1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,
-  1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,
-  1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1
+  1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,  /* 8 */
+  1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,  /* 9 */
+  1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,  /* a */
+  1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,  /* b */
+  1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,  /* c */
+  1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,  /* d */
+  1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,  /* e */
+  1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1   /* f */
+#endif
+#ifdef SQLITE_EBCDIC
+/*0  1  2  3  4  5  6  7   8  9  a  b  c  d  e  f  */
+  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,  /* 0 */
+  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,  /* 1 */
+  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,  /* 2 */
+  1, 1, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 1, 0,  /* 3 */
+  1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,  /* 4 */
+  1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,  /* 5 */
+  1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,  /* 6 */
+  1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 0, 1, 0,  /* 7 */
+
+  1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,  /* 8 */
+  1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,  /* 9 */
+  1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,  /* a */
+  1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,  /* b */
+  1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,  /* c */
+  1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,  /* d */
+  0, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,  /* e */
+  1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1   /* f */
+#endif
 };
 
 /* Objects */

From 259532c0ad20acdf5fea8b2165c7d32a2c7a4c0f Mon Sep 17 00:00:00 2001
From: stephan 
Date: Wed, 16 Apr 2025 17:47:16 +0000
Subject: [PATCH 113/120] Update doc/tcl-extension-testing.md for Unix systems,
 consolidating the Tcl 8.x and 9.x sections.

FossilOrigin-Name: c4c5dcb79c57f6e38cfe9b68b00e60e42d03ef30aeaefc5bf9dafed994849e1d
---
 doc/tcl-extension-testing.md | 92 ++++++++++++++++--------------------
 manifest                     | 14 +++---
 manifest.uuid                |  2 +-
 3 files changed, 49 insertions(+), 59 deletions(-)

diff --git a/doc/tcl-extension-testing.md b/doc/tcl-extension-testing.md
index df5f6537ba..fec7e0d668 100644
--- a/doc/tcl-extension-testing.md
+++ b/doc/tcl-extension-testing.md
@@ -35,84 +35,69 @@ perspective on how to compile SQLite on unix-like systems.
 ###  2.1 Setup
 
 
    -
  1. - [Fossil](https://fossil-scm.org/) installed. +
  2. + [Fossil][] installed.
  3. Check out source code and set environment variables:
    1. **TCLSOURCE** → - The top-level directory of a Fossil check-out of the TCL source tree. + The top-level directory of a [Fossil][] check-out of the + [TCL source tree][tcl-fossil].
    2. **SQLITESOURCE** → A Fossil check-out of the SQLite source tree. -
    3. **TCLBUILD** → +
    4. **TCLHOME** → A directory that does not exist at the start of the test and which will be deleted at the end of the test, and that will contain the test builds of the TCL libraries and the SQLite TCL Extensions. + It is the top-most installation directory, i.e. the one provided + to Tcl's `./configure --prefix=/path/to/tcl`. +
    5. **TCLVERSION** → + The `X.Y`-form version of Tcl being used: 8.6, 9.0, 9.1...
-### 2.2 Testing TCL 8.6 on unix +### 2.2 Testing TCL 8.x and 9.x on unix + +From a checked-out copy of [the core Tcl tree][tcl-fossil]
    -
  1. `mkdir -p $TCLBUILD/tcl86` -
  2. `cd $TCLSOURCE/unix` -
  3. `fossil up core-8-6-16`
    - ↑ Or some other version of Tcl8.6. +
  4. `TCLVERSION=8.6`
    + ↑ A version of your choice. This process has been tested with + values of 8.6, 9.0, and 9.1 (as of 2025-04-16). The out-of-life + version 8.5 fails some of `make devtest` for undetermined reasons. +
  5. `TCLHOME=$HOME/tcl/$TCLVERSION` +
  6. `TCLSOURCE=/path/to/tcl/checkout` +
  7. `SQLITESOURCE=/path/to/sqlite/checkout` +
  8. `rm -fr $TCLHOME`
    + ↑ Ensure that no stale Tcl installation is laying around. +
  9. `cd $TCLSOURCE` +
  10. `fossil up core-8-6-branch`
    + ↑ The branch corresponding to `$TCLVERSION`, e.g. + `core-9-0-branch` or `trunk`.
  11. `fossil clean -x` -
  12. `./configure --prefix=$TCLBUILD/tcl86 --disable-shared`
    - ↑ The --disable-shared is to avoid the need to set LD_LIBRARY_PATH +
  13. `cd unix` +
  14. `./configure --prefix=$TCLHOME --disable-shared`
    + ↑ The `--disable-shared` is to avoid the need to set `LD_LIBRARY_PATH` when using this Tcl build.
  15. `make install`
  16. `cd $SQLITESOURCE`
  17. `fossil clean -x` -
  18. `./configure --with-tclsh=$TCLBUILD/tcl86/bin/tclsh8.6 --all` +
  19. `./configure --with-tcl=$TCLHOME --all`
  20. `make tclextension-install`
    - ↑ Verify extension installed at $TCLBUILD/tcl86/lib/tcl8.6/sqlite3.* + ↑ Verify extension installed at + `$TCLHOME/lib/tcl${TCLVERSION}/sqlite`.
  21. `make tclextension-list`
    ↑ Verify TCL extension correctly installed.
  22. `make tclextension-verify`
    ↑ Verify that the correct version is installed. -
  23. `$TCLBUILD/tcl86/bin/tclsh8.6 test/testrunner.tcl release --explain`
    +
  24. `$TCLHOME/bin/tclsh[89].[0-9] test/testrunner.tcl release --explain`
    ↑ Verify thousands of lines of output with no errors. Or consider running "devtest" without --explain instead of "release".
-### 2.3 Testing TCL 9.0 on unix - -
    -
  1. `mkdir -p $TCLBUILD/tcl90` -
  2. `fossil up core-9-0-0`
    - ↑ Or some other version of Tcl9 -
  3. `fossil clean -x` -
  4. `./configure --prefix=$TCLBUILD/tcl90 --disable-shared`
    - ↑ The --disable-shared is to avoid the need to set LD_LIBRARY_PATH - when using this Tcl build. -
  5. `make install` -
  6. `cp -r ../library $TCLBUILD/tcl90/lib/tcl9.0`
    - ↑ The Tcl library is not installed by "make install" for Tcl9.0 unless - you also include the --disable-zipfs to ./configure. But if you do that - then the generated tclsh9.0 is no longer stand-alone. On the other hand, - if you don't install the Tcl library, other programs like testfixture - won't be able to find the Tcl library and hence won't work. This - extra installation step resolves the dilemma. - This step is not required when building Tcl8.6, which lacks support for - zipfs and hence always installs its Tcl library. -
  7. `cd $SQLITESOURCE` -
  8. `fossil clean -x` -
  9. `./configure --with-tclsh=$TCLBUILD/tcl90/bin/tclsh9.0 --all` -
  10. `make tclextension-install`
    - ↑ Verify extension installed at $TCLBUILD/tcl90/lib/sqlite3.* -
  11. `make tclextension-list`
    - ↑ Verify TCL extension correctly installed. -
  12. `make tclextension-verify` -
  13. `$TCLBUILD/tcl90/bin/tclsh9.0 test/testrunner.tcl release --explain`
    - ↑ Verify thousands of lines of output with no errors. Or - consider running "devtest" without --explain instead of "release". -
- -### 2.4 Cleanup +### 2.3 Cleanup
    -
  1. `rm -rf $TCLBUILD` +
  2. `rm -rf $TCLHOME`
@@ -123,9 +108,11 @@ perspective on how to compile SQLite on Windows. ### 3.1 Setup for Windows +(These docs are not as up-to-date as the Unix docs, above.) +
    -
  1. - [Fossil](https://fossil-scm.org/) installed. +
  2. + [Fossil][] installed.
  3. Unix-like command-line tools installed. Example: [unxutils](https://unxutils.sourceforge.net/) @@ -206,3 +193,6 @@ perspective on how to compile SQLite on Windows.
    1. `rm -rf %TCLBUILD%`
    + +[Fossil]: https://fossil-scm.org/home +[tcl-fossil]: https://core.tcl-lang.org/tcl diff --git a/manifest b/manifest index 5676b26985..c3377dc0b2 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Attempt\sto\sprovide\sEBCDIC\stranslations\sto\sthe\stables\sin\sthe\sJSON\nimplementation.\s\sThe\sSQLite\sdevelopers\sdo\snot\shave\saccess\sto\sany\ncomputers\susing\sEBCDIC\sand\sso\shave\sno\sway\sto\stest\sthis\spatch,\sand\ncannot\svouch\sfor\sits\saccuracy. -D 2025-04-16T17:36:26.944 +C Update\sdoc/tcl-extension-testing.md\sfor\sUnix\ssystems,\sconsolidating\sthe\sTcl\s8.x\sand\s9.x\ssections. +D 2025-04-16T17:47:16.773 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -63,7 +63,7 @@ F doc/json-enhancements.md e356fc834781f1f1aa22ee300027a270b2c960122468499bf347b F doc/jsonb.md ede3238186e3a90bb79d20b2a6a06d0f9429a38e069e9da0efbad0f2ed48b924 F doc/lemon.html 89ea833a6f71773ab1a9063fbb7fb9b32147bc0b1057b53ecab94a3b30c0aef5 F doc/pager-invariants.txt 83aa3a4724b2d7970cc3f3461f0295c46d4fc19a835a5781cbb35cb52feb0577 -F doc/tcl-extension-testing.md 864875c3b672db79e7d42348dd726f9a4fbd852b1d8e5efcf09fe3d1ff6bf2a2 +F doc/tcl-extension-testing.md b10538db54c3eda7f8682c05328ced8a2043d3de7ddbd22ae3f2b6cc770006ce F doc/testrunner.md 15583cf8c7d8a1c3378fd5d4319ca769a14c4d950a5df9b015d01d5be290dc69 F doc/trusted-schema.md 33625008620e879c7bcfbbfa079587612c434fa094d338b08242288d358c3e8a F doc/vdbesort-memory.md 4da2639c14cd24a31e0af694b1a8dd37eaf277aff3867e9a8cc14046bc49df56 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 8ae437301ed0cf71ef0e07be07917d9702221d27bdc98491209d8f28c7a500e2 -R c64f1aa94a03741a3b8d9bb200ed893f -U drh -Z 0fc17037f0ec1a61cba3bc34abd61d37 +P 84e698f38429c142caaa66ac086410f2035691b2ad39ad2fc4e0ebc31dd58a5b +R 10019481ad9fb3b387e600d039fce87e +U stephan +Z 32c947866489f54b1e21c649b883e5ef # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 12bf847461..fbdd7c571b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -84e698f38429c142caaa66ac086410f2035691b2ad39ad2fc4e0ebc31dd58a5b +c4c5dcb79c57f6e38cfe9b68b00e60e42d03ef30aeaefc5bf9dafed994849e1d From c264a0fd95d2e5c2874124d8909e1042cdfaaaa7 Mon Sep 17 00:00:00 2001 From: stephan Date: Wed, 16 Apr 2025 21:53:01 +0000 Subject: [PATCH 114/120] Latest upstream teaish. Most notably it adds the ability for the extension to specify a minimum Tcl version, and this build now enforces a minimum Tcl of 8.6. FossilOrigin-Name: c86315e538f4d75161faa72673927cde8be080c983f04a98491d1add14615038 --- autoconf/tea/Makefile.in | 70 +++++++-- autoconf/tea/autosetup/core.tcl | 236 +++++++++++++++++++++--------- autoconf/tea/autosetup/tester.tcl | 8 +- autoconf/tea/pkgIndex.tcl.in | 16 +- autoconf/tea/teaish.tcl | 1 + autoconf/tea/teaish.tester.tcl.in | 32 +++- manifest | 22 +-- manifest.uuid | 2 +- 8 files changed, 276 insertions(+), 111 deletions(-) diff --git a/autoconf/tea/Makefile.in b/autoconf/tea/Makefile.in index eae30567e9..1eb22984ba 100644 --- a/autoconf/tea/Makefile.in +++ b/autoconf/tea/Makefile.in @@ -38,7 +38,6 @@ tx.pkgName = @TEAISH_PKGNAME@ tx.version = @TEAISH_VERSION@ tx.libdir = @TEAISH_LIBDIR_NAME@ tx.loadPrefix = @TEAISH_LOAD_PREFIX@ -#tx.testScript = @TEAISH_TEST_TCL@ tx.tcl = @TEAISH_TCL@ tx.makefile = @TEAISH_MAKEFILE@ tx.makefile.in = @TEAISH_MAKEFILE_IN@ @@ -50,9 +49,9 @@ tx.dll = $(tx.dll$(TCL_MAJOR_VERSION)) tx.dir = @TEAISH_DIR@ teaish.dir = @abs_top_srcdir@ -teaish.dir.autosetup = @TEAISH_AUTOSETUP_DIR@ +#teaish.dir.autosetup = @TEAISH_AUTOSETUP_DIR@ teaish.makefile = Makefile -teaish.makefile.in = $(teaish.dir)/Makefile.in +teaish.makefile.in = $(teaish.dir)/Makefile.in teaish__auto.def = $(teaish.dir)/auto.def # @@ -156,13 +155,15 @@ tx.dist.files = @TEAISH_DIST_FILES@ # teaish__cleanExtra = -# # List of deps which may trigger an auto-reconfigure. # teaish__autogen.deps = \ $(tx.makefile.in) $(teaish.makefile.in) \ - $(tx.tcl) $(teaish.dir)/pkgIndex.tcl.in \ + $(tx.tcl) \ + @TEAISH_PKGINDEX_TCL_IN@ \ + @TEAISH_MODULE_TEST_TCL@ \ @AUTODEPS@ + # # Problem: when more than one target can invoke TEAISH_AUTORECONFIG, # we can get parallel reconfigures running. Thus, targets which @@ -179,6 +180,16 @@ reconfigure: $(teaish.makefile): $(teaish__auto.def) $(teaish.makefile.in) \ @AUTODEPS@ +@if TEAISH_TEST_TCL_IN +#config.log: @TEAISH_TEST_TCL_IN@ +#@TEAISH_TEST_TCL_IN@: +#@TEAISH_TEST_TCL@: @TEAISH_TEST_TCL_IN@ +@endif + +@TEAISH_TESTER_TCL_IN@: +@TEAISH_TESTER_TCL@: @TEAISH_TESTER_TCL_IN@ +config.log: @TEAISH_TESTER_TCL@ + # # The rest of this makefile exists solely to support this brief # target: the extension shared lib. @@ -208,7 +219,7 @@ tclsh: $(teaish.makefile) config.log tx.tester.args = $(tx.dll) $(tx.loadPrefix) @TEAISH_MODULE_TEST_TCL@ .PHONY: test-pre test-core test test-post test-extension test-extension: # this name is reserved for use by teaish.make -test-prepre: $(tx.dll) +test-prepre: $(tx.dll) @TEAISH_TESTER_TCL@ test-pre: test-prepre test-core: test-pre $(TCLSH) @TEAISH_TESTER_TCL@ $(tx.tester.args) @@ -218,7 +229,7 @@ test: test-post # # Cleanup rules... # -.PHONY: clean-pre clean-core clean-post clean-extension +#.PHONY: clean-pre clean-core clean-post clean-extension clean-extension: # this name is reserved for use by teaish.make clean-pre: clean-core: clean-pre @@ -230,8 +241,25 @@ clean: clean-post distclean-extension: # this name is reserved for use by teaish.make distclean-pre: clean distclean-core: distclean-pre - rm -f Makefile pkgIndex.tcl teaish.make teaish.tester.tcl + rm -f Makefile rm -f config.log config.defines.txt +@if TEAISH_MAKEFILE_IN +@if TEAISH_MAKEFILE + rm -f @TEAISH_MAKEFILE@ +@endif +@endif +@if TEAISH_TESTER_TCL_IN + rm -f @TEAISH_TESTER_TCL@ +@endif +@if TEAISH_PKGINDEX_TCL_IN + rm -f @TEAISH_PKGINDEX_TCL@ +@endif +@if TEAISH_PKGINIT_TCL_IN + rm -f @TEAISH_PKGINIT_TCL@ +@endif +@if TEAISH_TEST_TCL_IN + rm -f @TEAISH_TEST_TCL@ +@endif distclean-post: distclean-core distclean: distclean-post @@ -279,8 +307,8 @@ uninstall-post: uninstall-core uninstall: uninstall-post Makefile: config.log $(teaish.makefile.in) -@if TEAISH_MAKEFILE -$(tx.makefile): config.log +@if TEAISH_MAKEFILE_IN +config.log: @TEAISH_MAKEFILE_IN@ @endif # @@ -354,9 +382,8 @@ dist: @endif @endif #TEAISH_ENABLE_DIST -@if TEAISH_MAKEFILE # -# tx.makefile defines any extension-specific state this file +# TEAISH_MAKEFILE[_IN] defines any extension-specific state this file # needs. # # It must set the following vars if they're not already accounted for @@ -377,15 +404,32 @@ dist: # # It may optionally hook into various targets as documented in # /doc/extensions.md in the canonical teaish source tree. +# +# Interestingly, we don't have to pre-filter teaish.makefile.in - +# we can just import it into here. That skips its teaish-specific +# validation though. Hmm. +# +#@if TEAISH_MAKEFILE_IN +## TEAISH_MAKEFILE_IN ==> +#Makefile: @TEAISH_MAKEFILE_IN@ +#@include @TEAISH_MAKEFILE_IN@ +#@endif +#@if !TEAISH_MAKEFILE_IN +@if TEAISH_MAKEFILE +# TEAISH_MAKEFILE ==> +Makefile: @TEAISH_MAKEFILE@ @include @TEAISH_MAKEFILE@ @endif #TEAISH_MAKEFILE +#@endif #!TEAISH_MAKEFILE_IN -@if TEAISH_MAKEFILE_CODE # # TEAISH_MAKEFILE_CODE may contain literal makefile code, which # gets pasted verbatim here. Either [define TEAISH_MAKEFILE_CODE # ...] or use [teaish-add-make] to incrementally build up this # content. # +@if TEAISH_MAKEFILE_CODE +# TEAISH_MAKEFILE_CODE ==> +Makefile: @TEAISH_TCL@ @TEAISH_MAKEFILE_CODE@ @endif #TEAISH_MAKEFILE_CODE diff --git a/autoconf/tea/autosetup/core.tcl b/autoconf/tea/autosetup/core.tcl index e3f71f1ede..57d9246c7b 100644 --- a/autoconf/tea/autosetup/core.tcl +++ b/autoconf/tea/autosetup/core.tcl @@ -48,6 +48,7 @@ array set teaish__Config [proj-strip-hash-comments { pkgindex-policy 0 }] set teaish__Config(core-dir) $::autosetup(libdir)/teaish + # # Returns true if any arg in $::argv matches any of the given globs, # else returns false. @@ -82,6 +83,7 @@ proc teaish-configure-core {} { TEAISH_CFLAGS "" TEAISH_LDFLAGS "" TEAISH_SRC "" + TEAISH_VSATISFIES_TCL "8.5" } { define $f $v } @@ -192,15 +194,20 @@ proc teaish-configure-core {} { } -######################################################################## +# # Internal config-time debugging output routine. It is not legal to # call this from the global scope. +# proc teaish-debug {msg} { if {$::teaish__Config(debug-enabled)} { puts stderr [proj-bold "** DEBUG: \[[proj-current-scope 1]\]: $msg"] } } +# +# Runs "phase 1" of the configuration, immediately after processing +# --flags. This is what will import the client-defined teaish.tcl. +# proc teaish__configure-phase1 {} { # Set up some default values if the user did not set them. foreach {key val} [list \ @@ -215,8 +222,13 @@ proc teaish__configure-phase1 {} { # Do it again for vars which rely on defaults derived from other # vars. foreach {key val} [list \ - TEAISH_LIBDIR_NAME [get-define TEAISH_PKGNAME ""] \ - TEAISH_LOAD_PREFIX [string totitle [get-define TEAISH_PKGNAME ""]] \ + TEAISH_LIBDIR_NAME \ + [join [list \ + [get-define TEAISH_PKGNAME ""] \ + [get-define TEAISH_VERSION ""]] \ + "" ] \ + TEAISH_LOAD_PREFIX [string totitle \ + [get-define TEAISH_PKGNAME ""]] \ TEAISH_PKGNAME [get-define TEAISH_NAME]] { if {"" eq [get-define $key ""]} { #puts "***** defining default $key $val" @@ -230,8 +242,8 @@ proc teaish__configure-phase1 {} { uplevel 1 { use cc cc-db cc-shared cc-lib; # pkg-config } - teaish__check-tcl - teaish__check-common-bins + teaish__check_tcl + teaish__check_common_bins apply {{} { # # If --prefix or --exec-prefix are _not_ provided, use their @@ -291,6 +303,25 @@ proc teaish__configure-phase1 {} { teaish-configure } + if {0} { + # Reminder: we cannot do a TEAISH_VSATISFIES_TCL check like the following + # from here because _this_ tcl instance is very possibly not the one + # which will be hosting the extension. + if {$::autosetup(istcl)} { + # ^^^ this is a canonical Tcl, not JimTcl + set vsat [get-define TEAISH_VSATISFIES_TCL ""] + if {$vsat ne "" + && ![package vsatisfies [package provide Tcl] $vsat]} { + error [join [list "Tcl package vsatisfies failed for" \ + [get-define TEAISH_NAME] \ + [get-define TEAISH_VERSION] \ + ": expecting vsatisfies to match ($vsat)"]] + } + unset vsat + } + } + + if {[proj-looks-like-windows]} { # Without this, linking of an extension will not work on Cygwin or # Msys2. @@ -300,10 +331,6 @@ proc teaish__configure-phase1 {} { #define AS_LIBDIR $::autosetup(libdir) define TEAISH_MODULE_TEST_TCL $::teaish__Config(core-dir)/tester.tcl - teaish__configure-finalize -} - -proc teaish__configure-finalize {} { apply {{} { # @@ -323,10 +350,9 @@ proc teaish__configure-finalize {} { set dEx $::teaish__Config(teaish-dir) set dSrc $::autosetup(srcdir) + proj-dot-ins-append $dSrc/Makefile.in proj-dot-ins-append $dSrc/teaish.tester.tcl.in - define TEAISH_TESTER_TCL_IN $dEx/teaish.tester.tcl.in - define TEAISH_TESTER_TCL teaish.tester.tcl if {[get-define TEAISH_OUT_OF_EXT_TREE]} { define TEAISH_ENABLE_DIST 0 @@ -349,10 +375,11 @@ proc teaish__configure-finalize {} { proj-dot-ins-process -validate; # do not [define] after this point proj-if-opt-truthy teaish-dump-defines { make-config-header config.defines.txt \ - -none {TEAISH__*} \ - -str {BIN_* CC LD AR INSTALL LDFLAG*} \ + -none {TEAISH__* TEAISH_MAKEFILE_CODE} \ + -str { + BIN_* CC LD AR INSTALL LDFLAG* CFLAGS* *_LDFLAGS *_CFLAGS + } \ -bare {HAVE_*} \ - -str {TEAISH_DIST_FILES} \ -auto {*} } @@ -371,10 +398,10 @@ proc teaish__configure-finalize {} { #proj-file-write $::autosetup(builddir)/.configured "" } - -######################################################################## +# # Run checks for required binaries. -proc teaish__check-common-bins {} { +# +proc teaish__check_common_bins {} { if {"" eq [proj-bin-define install]} { proj-warn "Cannot find install binary, so 'make install' will not work." define BIN_INSTALL false @@ -387,10 +414,10 @@ proc teaish__check-common-bins {} { } } -######################################################################## +# # TCL... # -# teaish__check-tcl performs most of the --with-tcl and --with-tclsh +# teaish__check_tcl performs most of the --with-tcl and --with-tclsh # handling. Some related bits and pieces are performed before and # after that function is called. # @@ -403,7 +430,7 @@ proc teaish__check-common-bins {} { # - TCLLIBDIR is the dir to which the extension library gets # - installed. # -proc teaish__check-tcl {} { +proc teaish__check_tcl {} { define TCLSH_CMD false ; # Significant is that it exits with non-0 define TCLLIBDIR "" ; # Installation dir for TCL extension lib define TCL_CONFIG_SH ""; # full path to tclConfig.sh @@ -728,35 +755,32 @@ If you are attempting an out-of-tree build, use } apply $addDist $extI msg-result "Extension post-load init = $extI" - define TEAISH_PKGINIT_TCL_TAIL [file tail [get-define TEAISH_PKGINIT_TCL]]; # for use in pkgIndex.tcl + define TEAISH_PKGINIT_TCL_TAIL \ + [file tail [get-define TEAISH_PKGINIT_TCL]]; # for use in pkgIndex.tcl.in } # Look for pkgIndex.tcl[.in]... set piPolicy 0 if {[proj-first-file-found $dirExt/pkgIndex.tcl.in extPI]} { - # If $dirExt/pkgIndex.tcl.in exists, generate ./pkgIndex.tcl from - # it. + # Generate ./pkgIndex.tcl from it. define TEAISH_PKGINDEX_TCL_IN $extPI define TEAISH_PKGINDEX_TCL [file rootname [file tail $extPI]] proj-dot-ins-append $extPI file delete -force -- [get-define TEAISH_PKGINDEX_TCL] apply $addDist $extPI set piPolicy 0x01 - } elseif {![expr {$dirExt eq $dirSrc}] + } elseif {$dirExt ne $dirSrc && [proj-first-file-found $dirSrc/pkgIndex.tcl.in extPI]} { - # If $dirSrc/pkgIndex.tcl.in exists, generate ./pkgIndex.tcl from - # it. + # Generate ./pkgIndex.tcl from it. define TEAISH_PKGINDEX_TCL_IN $extPI define TEAISH_PKGINDEX_TCL [file rootname [file tail $extPI]] proj-dot-ins-append $extPI file delete -force -- [get-define TEAISH_PKGINDEX_TCL] set piPolicy 0x02 } elseif {[proj-first-file-found $dirExt/pkgIndex.tcl extPI]} { - # if TEAISH_DIR/pkgIndex.tcl exists, assume it's a static file - # and use it. + # Assume it's a static file and use it. define TEAISH_PKGINDEX_TCL_IN "" define TEAISH_PKGINDEX_TCL $extPI - proj-dot-ins-append $extPI apply $addDist $extPI set piPolicy 0x04 } @@ -764,30 +788,46 @@ If you are attempting an out-of-tree build, use set ::teaish__Config(pkgindex-policy) $piPolicy # Look for teaish.test.tcl[.in] - apply {{addDist} { - set tdir $::teaish__Config(teaish-dir) - proj-assert {"" ne $tdir} - set flist [list $tdir/teaish.test.tcl.in $tdir/teaish.test.tcl] - if {[proj-first-file-found $flist ttt]} { - set tail [file tail $ttt] - set xt [file rootname $tail] - if {[string match *.in $ttt]} { - # Generate teaish.test.tcl from $ttt - file delete -force -- $xt; # ensure no stale copy is used - define TEAISH_TEST_TCL $xt - define TEAISH_TEST_TCL_IN $ttt - proj-dot-ins-append $ttt $xt - apply $addDist $tail - } else { - define TEAISH_TEST_TCL $ttt - define TEAISH_TEST_TCL_IN "" - apply $addDist $xt - } + proj-assert {"" ne $dirExt} + set flist [list $dirExt/teaish.test.tcl.in $dirExt/teaish.test.tcl] + if {[proj-first-file-found $flist ttt]} { + if {[string match *.in $ttt]} { + # Generate teaish.test.tcl from $ttt + set xt [file rootname [file tail $ttt]] + file delete -force -- $xt; # ensure no stale copy is used + define TEAISH_TEST_TCL $xt + define TEAISH_TEST_TCL_IN $ttt + proj-dot-ins-append $ttt $xt } else { - define TEAISH_TEST_TCL "" + define TEAISH_TEST_TCL $ttt define TEAISH_TEST_TCL_IN "" } - }} $addDist + apply $addDist $ttt + } else { + define TEAISH_TEST_TCL "" + define TEAISH_TEST_TCL_IN "" + } + + # Look for teaish.tester.tcl[.in] + set flist [list $dirExt/teaish.tester.tcl.in $dirSrc/teaish.tester.tcl.in] + if {[proj-first-file-found $flist ttt]} { + # Generate teaish.test.tcl from $ttt + set xt [file rootname [file tail $ttt]] + file delete -force -- $xt; # ensure no stale copy is used + define TEAISH_TESTER_TCL $xt + define TEAISH_TESTER_TCL_IN $ttt + proj-dot-ins-append $ttt $xt + if {[lindex $flist 0] eq $ttt} { + apply $addDist $ttt + } + } else { + set ttt [file join $dirSrc teaish.tester.tcl.in] + set xt [file rootname [file tail $ttt]] + proj-dot-ins-append $ttt $xt + define TEAISH_TESTER_TCL $xt + define TEAISH_TESTER_TCL_IN $ttt + } + unset flist xt ttt # TEAISH_OUT_OF_EXT_TREE = 1 if we're building from a dir other # than the extension's home dir. @@ -801,6 +841,7 @@ If you are attempting an out-of-tree build, use # @teaish-add-cflags ?-p|prepend? ?-define? cflags... # # Equivalent to [proj-define-amend TEAISH_CFLAGS {*}$args]. +# proc teaish-add-cflags {args} { proj-define-amend TEAISH_CFLAGS {*}$args } @@ -825,6 +866,7 @@ proc teaish-define-to-cflag {args} { # technically correct and still relevant on some environments. # # See: teaish-prepend-ldflags +# proc teaish-add-ldflags {args} { proj-define-amend TEAISH_LDFLAGS {*}$args } @@ -832,6 +874,7 @@ proc teaish-add-ldflags {args} { # @teaish-prepend-ldflags args... # # Functionally equivalent to [teaish-add-ldflags -p {*}$args] +# proc teaish-prepend-ldflags {args} { teaish-add-ldflags -p {*}$args } @@ -848,6 +891,7 @@ proc teaish-prepend-ldflags {args} { # will be the desired behavior so that out-of-tree builds can find the # sources, but there are cases where it's not desired (e.g. when using # a source file from outside of the extension's dir). +# proc teaish-add-src {args} { set i 0 proj-parse-simple-flags args flags { @@ -879,6 +923,7 @@ proc teaish-add-src {args} { # # It is not legal to call this until TEAISH_DIR has been reliably set # (via teaish__find_extension). +# proc teaish-add-dist {args} { if {$::teaish__Config(blddir-is-extdir)} { proj-define-amend TEAISH_DIST_FILES {*}$args @@ -930,6 +975,7 @@ proc teaish-add-make {args} { # The exported file is then passed to [proj-touch] because, in # practice, that's sometimes necessary to avoid build dependency # issues. +# proc teaish-make-config-header {filename} { make-config-header $filename \ -bare {} \ @@ -943,6 +989,7 @@ proc teaish-make-config-header {filename} { # # Sets a feature-check cache entry with the given key. # See proj-cache-set for the key's semantics. +# proc teaish-feature-cache-set {{key 0} val} { proj-cache-set $key 1 $val } @@ -957,6 +1004,7 @@ proc teaish-feature-cache-set {{key 0} val} { # "" and returns 0. # # See proj-cache-check for $key's semantics. +# proc teaish-feature-cache-check {{key 0} tgtVar} { upvar $tgtVar tgt proj-cache-check $key 1 tgt @@ -982,6 +1030,7 @@ proc teaish-feature-cache-check {{key 0} tgtVar} { # # -nostatus = do not emit "ok" or "no" at the end. This presumes # that the caller will emit at least one newline before turning. +# proc teaish-check-cached {args} { proj-parse-simple-flags args flags { -nostatus 0 {expr 1} @@ -1016,21 +1065,28 @@ proc teaish-check-cached {args} { } } -######################################################################## +# # Internal helper for teaish__defs_format_: returns a JSON-ish quoted -# form of the given string-type values. It only performs the most -# basic of escaping. The input must not contain any control -# characters. -proc teaish__quote_str {value} { +# form of the given string-type values. +# +# If $asList is true then the return value is in {$value} form. If +# $asList is false it only performs the most basic of escaping and +# the input must not contain any control characters. +# +proc teaish__quote_str {asList value} { + if {$asList} { + return [join [list "\{" $value "\}"] ""] + } return \"[string map [list \\ \\\\ \" \\\"] $value]\" } -######################################################################## -# Internal helper for teaish__dump_defs_to_list. Expects to be passed a -# [define] name and the variadic $args which are passed to -# teaish__dump_defs_to_list.. If it finds a pattern match for the given -# $name in the various $args, it returns the type flag for that $name, -# e.g. "-str" or "-bare", else returns an empty string. +# +# Internal helper for teaish__dump_defs_to_list. Expects to be passed +# a name and the variadic $args which are passed to +# teaish__dump_defs_to_list.. If it finds a pattern match for the +# given $name in the various $args, it returns the type flag for that +# $name, e.g. "-str" or "-bare", else returns an empty string. +# proc teaish__defs_type {name spec} { foreach {type patterns} $spec { foreach pattern $patterns { @@ -1042,11 +1098,25 @@ proc teaish__defs_type {name spec} { return "" } -######################################################################## +# # An internal impl detail. Requires a data type specifier, as used by # make-config-header, and a value. Returns the formatted value or the # value $::teaish__Config(defs-skip) if the caller should skip # emitting that value. +# +# In addition to -str, -auto, etc., as defined by make-config-header, +# it supports: +# +# -list {...} will cause non-integer values to be quoted in {...} +# instead of quotes. +# +# -autolist {...} works like -auto {...} except that it falls back to +# -list {...} type instead of -str {...} style for non-integers. +# +# -array {...} emits the output in something which, for conservative +# inputs, will be a valid JSON array. It can only handle relatively +# simple values with no control characters in them. +# set teaish__Config(defs-skip) "-teaish__defs_format sentinel" proc teaish__defs_format {type value} { switch -exact -- $type { @@ -1057,14 +1127,22 @@ proc teaish__defs_format {type value} { set value $::teaish__Config(defs-skip) } -str { - set value [teaish__quote_str_ $value] + set value [teaish__quote_str 0 $value] } -auto { # Automatically determine the type if {![string is integer -strict $value]} { - set value [teaish__quote_str $value] + set value [teaish__quote_str 0 $value] } } + -autolist { + if {![string is integer -strict $value]} { + set value [teaish__quote_str 1 $value] + } + } + -list { + set value [teaish__quote_str 1 $value] + } -array { set ar {} foreach v $value { @@ -1079,7 +1157,9 @@ proc teaish__defs_format {type value} { set value $::teaish__Config(defs-skip) } default { - proj-fatal "Unknown type in [proj-current-scope 1]: $type" + proj-fatal \ + "Unknown [project-current-scope] -type ($type) called from" \ + [proj-current-scope 1] } } return $value @@ -1087,7 +1167,7 @@ proc teaish__defs_format {type value} { # # Returns Tcl code in the form of code which evaluates to a list of -# configure-time DEFINEs in the form {key val key2 val...}. It will +# configure-time DEFINEs in the form {key val key2 val...}. It may # misbehave for values which are not numeric or simple strings. # proc teaish__dump_defs_to_list {args} { @@ -1098,11 +1178,12 @@ proc teaish__dump_defs_to_list {args} { -none { TEAISH__* TEAISH_MAKEFILE_CODE - TEAISH_AUTORECONFIGURE AM_* AS_* } \ - -bare {SIZEOF_* HAVE_DECL_*} \ - -auto * + -auto { + SIZEOF_* HAVE_* + } \ + -autolist * foreach n [lsort [dict keys [all-defines]]] { set type [teaish__defs_type $n $args] set value [teaish__defs_format $type [get-define $n]] @@ -1114,6 +1195,7 @@ proc teaish__dump_defs_to_list {args} { return [join $lines "\n"] } +# # @teaish-pragma ...flags # # Offers a way to tweak how teaish's core behaves in some cases, in @@ -1129,6 +1211,7 @@ proc teaish__dump_defs_to_list {args} { # it. # # Emits a warning message for unknown arguments. +# proc teaish-pragma {args} { foreach arg $args { switch -exact -- $arg { @@ -1167,7 +1250,7 @@ proc teaish-pragma {args} { } } - +# # @teaish-enable-dist ?yes? # # Explicitly enables or disables the "dist" rules in the default @@ -1215,9 +1298,16 @@ proc teaish__create_extension {dir} { set content "define TEAISH_NAME ${name} define TEAISH_VERSION ${version} # define TEAISH_PKGNAME ${pkgName} -# define TEAISH_LIBDIR_NAME ${name} -define TEAISH_LOAD_PREFIX ${loadPrefix} -proc teaish-options {} {} +# define TEAISH_LIBDIR_NAME ${name}${version} +# define TEAISH_LOAD_PREFIX ${loadPrefix} +proc teaish-options {} { + # Return a list and/or use [options-add] to add new + # configure flags. This is called before teaish's + # bootstrapping is finished, so only teaish-* + # APIs which are explicitly noted as being safe + # early on may be used here. Any autosetup-related + # APIs may be used here. +} proc teaish-configure {} { set d \[get-define TEAISH_DIR] teaish-add-src \$d/teaish.c diff --git a/autoconf/tea/autosetup/tester.tcl b/autoconf/tea/autosetup/tester.tcl index d0d8024474..d48d7af44a 100644 --- a/autoconf/tea/autosetup/tester.tcl +++ b/autoconf/tea/autosetup/tester.tcl @@ -61,10 +61,10 @@ proc test-warn {args} { # # Triggers a test-failed error with a string describing the calling # scope and the provided message. -proc test-fail {msg} { +proc test-fail {args} { #puts stderr "ERROR: \[[test-current-scope 1]]: $msg" #exit 1 - error "FAIL: \[[test-current-scope 1]]: $msg" + error "FAIL: \[[test-current-scope 1]]: $args" } # Internal impl for assert-likes. Should not be called directly by @@ -129,7 +129,9 @@ proc test-catch {cmd args} { return 0 } -array set teaish__BuildFlags {} +if {![array exists ::teaish__BuildFlags]} { + array set ::teaish__BuildFlags {} +} # @teaish-build-flag2 flag tgtVar ?dflt? # diff --git a/autoconf/tea/pkgIndex.tcl.in b/autoconf/tea/pkgIndex.tcl.in index fe07e10016..93fbe0ead1 100644 --- a/autoconf/tea/pkgIndex.tcl.in +++ b/autoconf/tea/pkgIndex.tcl.in @@ -1,19 +1,27 @@ # -*- tcl -*- -# Automatically generated - do not edit # Tcl package index file +# +# Unless this file is named pkgIndex.tcl.in, you are probably looking +# at an automatically generated/filtered copy and should probably not +# edit it. +# # Adapted from https://core.tcl-lang.org/tcltls +@if TEAISH_VSATISFIES_TCL +if {![package vsatisfies [package provide Tcl] @TEAISH_VSATISFIES_TCL@]} { + error "Package @TEAISH_PKGNAME@ @TEAISH_VERSION@ requires Tcl @TEAISH_VSATISFIES_TCL@" +} +@endif if {[package vsatisfies [package provide Tcl] 9.0-]} { package ifneeded @TEAISH_PKGNAME@ @TEAISH_VERSION@ [list apply {{dir} { load [file join $dir @TEAISH_DLL9@] @TEAISH_LOAD_PREFIX@ @if TEAISH_PKGINIT_TCL_TAIL - set initScript [file join $dir [file tail @TEAISH_PKGINIT_TCL_TAIL@]] + set initScript [file join $dir @TEAISH_PKGINIT_TCL_TAIL@] if {[file exists $initScript]} { source -encoding utf-8 $initScript } @endif }} $dir] } else { - if {![package vsatisfies [package provide Tcl] 8.5]} {return} package ifneeded @TEAISH_PKGNAME@ @TEAISH_VERSION@ [list apply {{dir} { if {[string tolower [file extension @TEAISH_DLL8@]] in [list .dll .dylib .so]} { load [file join $dir @TEAISH_DLL8@] @TEAISH_LOAD_PREFIX@ @@ -21,7 +29,7 @@ if {[package vsatisfies [package provide Tcl] 9.0-]} { load {} @TEAISH_LOAD_PREFIX@ } @if TEAISH_PKGINIT_TCL_TAIL - set initScript [file join $dir [file tail @TEAISH_PKGINIT_TCL_TAIL@]] + set initScript [file join $dir @TEAISH_PKGINIT_TCL_TAIL@] if {[file exists $initScript]} { source -encoding utf-8 $initScript } diff --git a/autoconf/tea/teaish.tcl b/autoconf/tea/teaish.tcl index 1107600845..7d8490edf8 100644 --- a/autoconf/tea/teaish.tcl +++ b/autoconf/tea/teaish.tcl @@ -3,6 +3,7 @@ define TEAISH_NAME sqlite; # name used in dist tarballs and as the libdir prefix define TEAISH_PKGNAME sqlite3; # name for purposes of Tcl_PkgProvide() define TEAISH_LOAD_PREFIX Sqlite3; # 2nd arg to [load] +define TEAISH_VSATISFIES_TCL 8.6-; # builds with 8.5 but some tests fail define TEAISH_VERSION [proj-file-content -trim [get-define TEAISH_DIR]/../VERSION] proj-assert {[string match 3.*.* [get-define TEAISH_VERSION]]} define TEAISH_LIBDIR_NAME \ diff --git a/autoconf/tea/teaish.tester.tcl.in b/autoconf/tea/teaish.tester.tcl.in index c2ff76476a..315d82350b 100644 --- a/autoconf/tea/teaish.tester.tcl.in +++ b/autoconf/tea/teaish.tester.tcl.in @@ -1,13 +1,33 @@ # -*- tcl -*- -# Automatically generated - do not edit +# +# Unless this file is named teaish.tester.tcl.in, you are probably +# looking at an automatically generated/filtered copy and should +# probably not edit it. # # This is the wrapper script invoked by teaish's "make test" recipe. -load [lindex $::argv 0] [lindex $::argv 1]; source [lindex $::argv 2] +@if TEAISH_VSATISFIES_TCL +if {![package vsatisfies [package provide Tcl] @TEAISH_VSATISFIES_TCL@]} { + error "Package @TEAISH_PKGNAME@ @TEAISH_VERSION@ requires Tcl @TEAISH_VSATISFIES_TCL@" +} +@endif +load [lindex $::argv 0] [lindex $::argv 1]; +source [lindex $::argv 2]; # teaish/tester.tcl @if TEAISH_PKGINIT_TCL -apply {{} {set dir [file dirname $::argv0]; source @TEAISH_PKGINIT_TCL@}} +apply {{file} { + set dir [file dirname $::argv0] + source $file +}} [join {@TEAISH_PKGINIT_TCL@}] @endif @if TEAISH_TEST_TCL -source @TEAISH_TEST_TCL@ -@else -puts "Extension successfully loaded" +apply {{file} { + # Populate state for [tester.tcl::teaish-build-flag*] + array set ::teaish__BuildFlags @TEAISH__DEFINES_MAP@ + set dir [file normalize [file dirname $file]] + #test-fail "Just testing" + source $file +}} [join {@TEAISH_TEST_TCL@}] +@else # TEAISH_TEST_TCL +# No $TEAISH_TEST_TCL provided, so here's a default test which simply +# loads the extension. +puts {Extension @TEAISH_NAME@ @TEAISH_VERSION@ successfully loaded from @TEAISH_TESTER_TCL@} @endif diff --git a/manifest b/manifest index c3377dc0b2..efe02e2ab9 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Update\sdoc/tcl-extension-testing.md\sfor\sUnix\ssystems,\sconsolidating\sthe\sTcl\s8.x\sand\s9.x\ssections. -D 2025-04-16T17:47:16.773 +C Latest\supstream\steaish.\sMost\snotably\sit\sadds\sthe\sability\sfor\sthe\sextension\sto\sspecify\sa\sminimum\sTcl\sversion,\sand\sthis\sbuild\snow\senforces\sa\sminimum\sTcl\sof\s8.6. +D 2025-04-16T21:53:01.406 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -22,20 +22,20 @@ F autoconf/Makefile.msc 5bc67d3912444c40c6f96d003e5c90663e51abb83d204a520110b1b2 F autoconf/README.first f1d3876e9a7852c22f275a6f06814e64934cecbc0b5b9617d64849094c1fd136 F autoconf/README.txt b749816b8452b3af994dc6d607394bef3df1736d7e09359f1087de8439a52807 F autoconf/auto.def 3d994f3a9cc9b712dbce92a5708570ddcf3b988141b6eb738f2ed16127a9f0ac -F autoconf/tea/Makefile.in 2a90dfab1e95cb3ec610429c78d88d4a7d26beb080ad45ff6a05928b901e8309 +F autoconf/tea/Makefile.in 2f716371a21f2d2ad1244c932f9ba12c083c9b4bd066590a51cb20c08f8b7ca6 F autoconf/tea/README.txt 656d4686c509d375f5988ff3deda94f65fe6cd8358cd55d1f1dcc7b6e2ff73aa F autoconf/tea/auto.def 81e2617cfb90d53c19b53b3ec632cd2893bf32f2e5dd272b1116fadf2ea86c2d F autoconf/tea/autosetup/README.txt b40071e6f8506500a2f7f71d5fc69e0bf87b9d7678dd9da1e5b4d0acbf40b1ca -F autoconf/tea/autosetup/core.tcl 4b828c8c77bfe7c94c7331d6dbb9efd1077160343867b4bee6d83c9977a11b6c +F autoconf/tea/autosetup/core.tcl 94b4f452606f75249aba667e4a4a577112a181112c24201856c8dbef8424f134 F autoconf/tea/autosetup/feature-tests.tcl 3ccf2fd1cad368c7ed958a869d8b915fada7f164a6b382c7381540c4892476f8 -F autoconf/tea/autosetup/tester.tcl d94aa9d51d2a22062e61db97310c2502ca0df50ca87108482c3bccf8f41db127 +F autoconf/tea/autosetup/tester.tcl 610b158c12112bfcbfe3a0eb18cacaccd914241a37a7a38a7fdd73822b7b3cab F autoconf/tea/configure d0b12b984edca6030d1976375b80157ac78b5b90a5b4f0dcee39357f63f4a80b x F autoconf/tea/doc/sqlite3.n 9a97f4f717ceab73004ea412af7960625c1cb24b5c25e4ae4c8b5d8fa4300f4e F autoconf/tea/license.terms 13bd403c9610fd2b76ece0ab50c4c5eda933d523 -F autoconf/tea/pkgIndex.tcl.in 2c99a64a0eff5dc2ad8e9657bb564fae2dbdfdb6b77a4c49b4387bd5a25c42ef -F autoconf/tea/teaish.tcl dbed8b4cc299e459c6d221262f884bdb27029bdb218e0590ededbe65bb926284 +F autoconf/tea/pkgIndex.tcl.in dc80c325c47095f278c7b4cf0784382fa0048cde44836bbd778aea0c7e23ed1a +F autoconf/tea/teaish.tcl ee22d09a97dfcf77762942aea5b1b838a284a4a36b124064f1209e241bef6e7e F autoconf/tea/teaish.test.tcl cfe94e1fb79dd078f650295be59843d470125e0cc3a17a1414c1fb8d77f4aea6 -F autoconf/tea/teaish.tester.tcl.in 743fd0fe1e667f82fd8fc3ebe0a5c77763e4dbed7bbc8605a9d4b1d0663dac78 +F autoconf/tea/teaish.tester.tcl.in 63059e35289ac663c7d0052e6c0089a309fee75225e86e4ec5b3d9f2c1d9290a F autosetup/LICENSE 41a26aebdd2cd185d1e2b210f71b7ce234496979f6b35aef2cbf6b80cbed4ce4 F autosetup/README.autosetup a78ff8c4a3d2636a4268736672a74bf14a82f42687fcf0631a70c516075c031e F autosetup/README.md f324bb9f9bf1cc787122034df53fbfdfed28ee2657e6652b763d992ab0d04829 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 84e698f38429c142caaa66ac086410f2035691b2ad39ad2fc4e0ebc31dd58a5b -R 10019481ad9fb3b387e600d039fce87e +P c4c5dcb79c57f6e38cfe9b68b00e60e42d03ef30aeaefc5bf9dafed994849e1d +R 1aafbce6cec55668ed932a92db582aa3 U stephan -Z 32c947866489f54b1e21c649b883e5ef +Z da0b8bd6f0a90b2d384ef615e8494fec # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index fbdd7c571b..e48f2d6fc2 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -c4c5dcb79c57f6e38cfe9b68b00e60e42d03ef30aeaefc5bf9dafed994849e1d +c86315e538f4d75161faa72673927cde8be080c983f04a98491d1add14615038 From 680a9584c6eaa98e16d682f0e0bd57f4abc36350 Mon Sep 17 00:00:00 2001 From: stephan Date: Wed, 16 Apr 2025 22:25:02 +0000 Subject: [PATCH 115/120] Add docs explaining how to test the teaish build. FossilOrigin-Name: b53619ddb74fa250f03564d04e732248b4161d4d10d6f02268b7c95382d110ff --- doc/tcl-extension-testing.md | 66 ++++++++++++++++++++++++++++++++++++ manifest | 12 +++---- manifest.uuid | 2 +- 3 files changed, 73 insertions(+), 7 deletions(-) diff --git a/doc/tcl-extension-testing.md b/doc/tcl-extension-testing.md index fec7e0d668..eb2a8c3a3b 100644 --- a/doc/tcl-extension-testing.md +++ b/doc/tcl-extension-testing.md @@ -194,5 +194,71 @@ perspective on how to compile SQLite on Windows.
  4. `rm -rf %TCLBUILD%`
+## 4.0 Testing the TEA(ish) Build (unix only) + +This part requires following the setup instructions for Unix systems, +at the top of this document. + +The former TEA, now TEA(ish), build of this extension uses the same +code as the builds described above but is provided in a form more +convenient for downstream Tcl users. + +It lives in `autoconf/tea` and, as part of the `autoconf` bundle, +_cannot be tested directly from the canonical tree_. Instead it has to +be packaged. + +### 4.1 Teaish Setup + +Follow the same Tcl- and environment-related related setup described +in the first section of this document, up to and including the +installation of Tcl (unless, of course, it was already installed using +those same instructions). + +### 4.2 Teaish Testing + +
    +
  1. `cd $SQLITESOURCE` +
  2. Run either `make snapshot-tarball` or `make amalgamation-tarball` + ↑ + Those steps will leave behind a temp dir called `mkpkg_tmp_dir`, + under which the extension is most readily reached. It can optionally + be extracted from the generated tarball, but that tarball was + generated from this dir, and reusing this dir is a time saver + during development. +
  3. `cd mkpkg_tmp/tea` +
  4. `./configure --with-tcl=$TCLHOME` +
  5. `make test install`
    + ↑ Should run to completion without any errors. +
  6. `make uninstall`
    + ↑ Will uninstall the extension. This _can_ be run + in the same invocation as the `install` target, but only + if the `-j#` make flag is _not_ used. If it is, the + install/uninstall steps will race and make a mess of things. + Parallel builds do not help in this build, anyway, as there's + only a single C file to compile. +
+ +When actively developing and testing the teaish build, which requires +going through the tarball generation, there's a caveat about the +`mkpkg_tmp_dir` dir: it will be deleted every time a tarball is +built, the shell console which is parked in that +directory for testing needs to add `cd $PWD &&` to the start of the +build commands, like: + +> +``` +[user@host:.../mkpkg_tmp_dir/tea]$ \ + cd $PWD && ./configure CFLAGS=-O0 --with-tcl=$TCLHOME \ + && make test install uninstall +``` + +### 4.3 Teaish Cleanup + + +
    +
  1. `rm -rf $TCLHOME` +
  2. `cd $SQLITESOURCE; rm -fr mkpkg_tmp_dir; fossil clean -x` +
+ [Fossil]: https://fossil-scm.org/home [tcl-fossil]: https://core.tcl-lang.org/tcl diff --git a/manifest b/manifest index efe02e2ab9..b2ce5955eb 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Latest\supstream\steaish.\sMost\snotably\sit\sadds\sthe\sability\sfor\sthe\sextension\sto\sspecify\sa\sminimum\sTcl\sversion,\sand\sthis\sbuild\snow\senforces\sa\sminimum\sTcl\sof\s8.6. -D 2025-04-16T21:53:01.406 +C Add\sdocs\sexplaining\show\sto\stest\sthe\steaish\sbuild. +D 2025-04-16T22:25:02.780 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -63,7 +63,7 @@ F doc/json-enhancements.md e356fc834781f1f1aa22ee300027a270b2c960122468499bf347b F doc/jsonb.md ede3238186e3a90bb79d20b2a6a06d0f9429a38e069e9da0efbad0f2ed48b924 F doc/lemon.html 89ea833a6f71773ab1a9063fbb7fb9b32147bc0b1057b53ecab94a3b30c0aef5 F doc/pager-invariants.txt 83aa3a4724b2d7970cc3f3461f0295c46d4fc19a835a5781cbb35cb52feb0577 -F doc/tcl-extension-testing.md b10538db54c3eda7f8682c05328ced8a2043d3de7ddbd22ae3f2b6cc770006ce +F doc/tcl-extension-testing.md b88861804fc1eaf83249f8e206334189b61e150c360e1b80d0dcf91af82354f5 F doc/testrunner.md 15583cf8c7d8a1c3378fd5d4319ca769a14c4d950a5df9b015d01d5be290dc69 F doc/trusted-schema.md 33625008620e879c7bcfbbfa079587612c434fa094d338b08242288d358c3e8a F doc/vdbesort-memory.md 4da2639c14cd24a31e0af694b1a8dd37eaf277aff3867e9a8cc14046bc49df56 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P c4c5dcb79c57f6e38cfe9b68b00e60e42d03ef30aeaefc5bf9dafed994849e1d -R 1aafbce6cec55668ed932a92db582aa3 +P c86315e538f4d75161faa72673927cde8be080c983f04a98491d1add14615038 +R e22f6e8195a60e01cd4d511f333ebac2 U stephan -Z da0b8bd6f0a90b2d384ef615e8494fec +Z cdf29b539adbf4afb90ada6e24ecd013 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index e48f2d6fc2..9be9a3b1de 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -c86315e538f4d75161faa72673927cde8be080c983f04a98491d1add14615038 +b53619ddb74fa250f03564d04e732248b4161d4d10d6f02268b7c95382d110ff From 56747d184053e586848b22cce94fa8e0efa6f1aa Mon Sep 17 00:00:00 2001 From: drh <> Date: Thu, 17 Apr 2025 17:46:28 +0000 Subject: [PATCH 116/120] Increase the size of the output buffer for sqlite3_log(). FossilOrigin-Name: a64e8491c9863f890daa9f5d8f678728dc0d00bc1f3c238b50214ec545450fcf --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/printf.c | 11 ++++++++++- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/manifest b/manifest index b2ce5955eb..9b7c111670 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sdocs\sexplaining\show\sto\stest\sthe\steaish\sbuild. -D 2025-04-16T22:25:02.780 +C Increase\sthe\ssize\sof\sthe\soutput\sbuffer\sfor\ssqlite3_log(). +D 2025-04-17T17:46:28.539 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -781,7 +781,7 @@ F src/pcache.h 1497ce1b823cf00094bb0cf3bac37b345937e6f910890c626b16512316d3abf5 F src/pcache1.c 131ca0daf4e66b4608d2945ae76d6ed90de3f60539afbd5ef9ec65667a5f2fcd F src/pragma.c 30b535d0a66348df844ee36f890617b4cf45e9a22dcbc47ec3ca92909c50aaf1 F src/prepare.c 1832be043fce7d489959aae6f994c452d023914714c4d5457beaed51c0f3d126 -F src/printf.c 33fc0d7643c848a098afdcb6e1db6de12379d47084b1cd0912cfce1d09345e44 +F src/printf.c 3b91c334f528359145f4dde0dedd945bbb21044d0825ea064934d7222d61662c F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c F src/resolve.c 20e1fbe8f840ffc0cd835e33f68a802a22e34faa918d7a269f3de242fda02f99 F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P c86315e538f4d75161faa72673927cde8be080c983f04a98491d1add14615038 -R e22f6e8195a60e01cd4d511f333ebac2 -U stephan -Z cdf29b539adbf4afb90ada6e24ecd013 +P b53619ddb74fa250f03564d04e732248b4161d4d10d6f02268b7c95382d110ff +R 697ea128a22ed3f6aeba23f77c35f372 +U drh +Z a2dd1de2440a1a7a57581f1ac40bf684 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 9be9a3b1de..792da94e0d 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -b53619ddb74fa250f03564d04e732248b4161d4d10d6f02268b7c95382d110ff +a64e8491c9863f890daa9f5d8f678728dc0d00bc1f3c238b50214ec545450fcf diff --git a/src/printf.c b/src/printf.c index 166c11194e..8cb5a43c5e 100644 --- a/src/printf.c +++ b/src/printf.c @@ -1344,6 +1344,15 @@ char *sqlite3_snprintf(int n, char *zBuf, const char *zFormat, ...){ return zBuf; } +/* Maximum size of an sqlite3_log() message. */ +#if defined(SQLITE_MAX_LOG_MESSAGE) + /* Leave the definition as supplied */ +#elif SQLITE_PRINT_BUF_SIZE*10>10000 +# define SQLITE_MAX_LOG_MESSAGE 10000 +#else +# define SQLITE_MAX_LOG_MESSAGE (SQLITE_PRINT_BUF_SIZE*10) +#endif + /* ** This is the routine that actually formats the sqlite3_log() message. ** We house it in a separate routine from sqlite3_log() to avoid using @@ -1360,7 +1369,7 @@ char *sqlite3_snprintf(int n, char *zBuf, const char *zFormat, ...){ */ static void renderLogMsg(int iErrCode, const char *zFormat, va_list ap){ StrAccum acc; /* String accumulator */ - char zMsg[SQLITE_PRINT_BUF_SIZE*3]; /* Complete log message */ + char zMsg[SQLITE_MAX_LOG_MESSAGE]; /* Complete log message */ sqlite3StrAccumInit(&acc, 0, zMsg, sizeof(zMsg), 0); sqlite3_str_vappendf(&acc, zFormat, ap); From 10744c61adc1a3136086fee4f34a89e5fb94bd1e Mon Sep 17 00:00:00 2001 From: drh <> Date: Thu, 17 Apr 2025 19:01:54 +0000 Subject: [PATCH 117/120] When logging errors using sqlite3_log() and the error text includes the text of an SQL statement, but the SQL statement text at the end so that if the error message buffer overflows it is the SQL statement text that gets truncated, not the statement of the problem. FossilOrigin-Name: de0968226effb79f9d25539da7882fa5475e4ff2410870b45a63a6545deb5979 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/vdbe.c | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/manifest b/manifest index 9b7c111670..a2ce1a6072 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Increase\sthe\ssize\sof\sthe\soutput\sbuffer\sfor\ssqlite3_log(). -D 2025-04-17T17:46:28.539 +C When\slogging\serrors\susing\ssqlite3_log()\sand\sthe\serror\stext\sincludes\sthe\ntext\sof\san\sSQL\sstatement,\sbut\sthe\sSQL\sstatement\stext\sat\sthe\send\sso\sthat\sif\nthe\serror\smessage\sbuffer\soverflows\sit\sis\sthe\sSQL\sstatement\stext\sthat\sgets\ntruncated,\snot\sthe\sstatement\sof\sthe\sproblem. +D 2025-04-17T19:01:54.977 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -854,7 +854,7 @@ F src/upsert.c 215328c3f91623c520ec8672c44323553f12caeb4f01b1090ebdca99fdf7b4f1 F src/utf.c 3a20cbae9688af4c1e3754cc2520189d00762e37f60c2deb0b303360d166bba6 F src/util.c 36fb1150062957280777655976f3f9a75db236cb8207a0770ceae8d5ec17fcd3 F src/vacuum.c d580ceb395c1ae3d59da41cbfea60683ff7dd2b94ddf4d0f5657620159e2eeb7 -F src/vdbe.c b5deed01000b3970cfca089dc531cf9342afd96d00cc8b4ad26d303f088116ee +F src/vdbe.c eafa2e2ab45edc36c378c5a6f8d7083d30692c96a1f03945808895414dc5d347 F src/vdbe.h 31eddcffc1d14c76c2a20fe4e137e1ee43d44f370896fae14a067052801a3625 F src/vdbeInt.h 5446f60e89b2aa7cdf3ab0ec4e7b01b8732cd9d52d9092a0b8b1bf700768f784 F src/vdbeapi.c 28fab30ed0acc981aecfdcaab0a421503609078e29850eb28494816682baf0a7 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P b53619ddb74fa250f03564d04e732248b4161d4d10d6f02268b7c95382d110ff -R 697ea128a22ed3f6aeba23f77c35f372 +P a64e8491c9863f890daa9f5d8f678728dc0d00bc1f3c238b50214ec545450fcf +R c7314e61baa174725a2a70881e7614ea U drh -Z a2dd1de2440a1a7a57581f1ac40bf684 +Z 6a2f3e45e3ea371afd4913a2a62a4053 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 792da94e0d..2da6206783 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a64e8491c9863f890daa9f5d8f678728dc0d00bc1f3c238b50214ec545450fcf +de0968226effb79f9d25539da7882fa5475e4ff2410870b45a63a6545deb5979 diff --git a/src/vdbe.c b/src/vdbe.c index 6ded15c799..d4009b70f6 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -1318,7 +1318,7 @@ case OP_Halt: { sqlite3VdbeError(p, "%s", pOp->p4.z); } pcx = (int)(pOp - aOp); - sqlite3_log(pOp->p1, "abort at %d in [%s]: %s", pcx, p->zSql, p->zErrMsg); + sqlite3_log(pOp->p1, "abort at %d: %s; [%s]", pcx, p->zErrMsg, p->zSql); } rc = sqlite3VdbeHalt(p); assert( rc==SQLITE_BUSY || rc==SQLITE_OK || rc==SQLITE_ERROR ); @@ -9153,8 +9153,8 @@ abort_due_to_error: p->rc = rc; sqlite3SystemError(db, rc); testcase( sqlite3GlobalConfig.xLog!=0 ); - sqlite3_log(rc, "statement aborts at %d: [%s] %s", - (int)(pOp - aOp), p->zSql, p->zErrMsg); + sqlite3_log(rc, "statement aborts at %d: %s; [%s]", + (int)(pOp - aOp), p->zErrMsg, p->zSql); if( p->eVdbeState==VDBE_RUN_STATE ) sqlite3VdbeHalt(p); if( rc==SQLITE_IOERR_NOMEM ) sqlite3OomFault(db); if( rc==SQLITE_CORRUPT && db->autoCommit==0 ){ From 31e08190abee89ec5fa791b29053975416aa1df2 Mon Sep 17 00:00:00 2001 From: stephan Date: Thu, 17 Apr 2025 19:41:37 +0000 Subject: [PATCH 118/120] Upstream teaish, which simplifies how extension metadata are initialized and shrinks proj.tcl by 4k. FossilOrigin-Name: c72c00d34d70b36f847af19a2382299746448b5dd94a616f6b567389c5694c17 --- autoconf/tea/Makefile.in | 26 +- autoconf/tea/autosetup/core.tcl | 557 ++++++++++++++++------- autoconf/tea/autosetup/feature-tests.tcl | 72 ++- autoconf/tea/autosetup/tester.tcl | 23 +- autoconf/tea/pkgIndex.tcl.in | 14 +- autoconf/tea/teaish.tcl | 47 +- autosetup/proj.tcl | 228 +++++++--- manifest | 26 +- manifest.uuid | 2 +- 9 files changed, 677 insertions(+), 318 deletions(-) diff --git a/autoconf/tea/Makefile.in b/autoconf/tea/Makefile.in index 1eb22984ba..911717bc43 100644 --- a/autoconf/tea/Makefile.in +++ b/autoconf/tea/Makefile.in @@ -97,7 +97,7 @@ TCLLIBDIR = @TCLLIBDIR@ # CFLAGS.configure = CFLAGS as known at configure-time. # # This ordering is deliberate: flags populated via tcl's -# [teaish-add-cflags] should preceed CFLAGS and CPPFLAGS (which +# [teaish-cflags-add] should preceed CFLAGS and CPPFLAGS (which # typically come from the ./configure command-line invocation). # CFLAGS.configure = @SH_CFLAGS@ @TEAISH_CFLAGS@ @CFLAGS@ @CPPFLAGS@ $(TCL_INCLUDE_SPEC) @@ -107,7 +107,7 @@ CFLAGS.configure = @SH_CFLAGS@ @TEAISH_CFLAGS@ @CFLAGS@ @CPPFLAGS@ $(TCL_INCLUDE # LDFLAGS.configure = LDFLAGS as known at configure-time. # # This ordering is deliberate: flags populated via tcl's -# [teaish-add-ldflags] should preceed LDFLAGS (which typically +# [teaish-ldflags-add] should preceed LDFLAGS (which typically # comes from the ./configure command-line invocation). # LDFLAGS.configure = @SH_LDFLAGS@ @TEAISH_LDFLAGS@ @LDFLAGS@ $(TCL_STUB_LIB_SPEC) @@ -120,7 +120,7 @@ LDFLAGS.configure = @SH_LDFLAGS@ @TEAISH_LDFLAGS@ @LDFLAGS@ $(TCL_STUB_LIB_SPEC) # # tx.src is the list of source or object files to include in the # (single) compiler invocation. This will initially contain any -# sources passed to [teaish-add-src], but may also be appended to +# sources passed to [teaish-src-add], but may also be appended to # by teaish.make. # tx.src =@TEAISH_SRC@ @@ -139,8 +139,8 @@ tx.LDFLAGS = # # The list of 'dist' files may be appended to from teaish.make.in. -# It can also be set up from teaish.tcl using [teaish-add-dist] -# and/or [teaish-add-src -dist ...]. +# It can also be set up from teaish.tcl using [teaish-dist-add] +# and/or [teaish-src-add -dist ...]. # tx.dist.files = @TEAISH_DIST_FILES@ @@ -180,12 +180,6 @@ reconfigure: $(teaish.makefile): $(teaish__auto.def) $(teaish.makefile.in) \ @AUTODEPS@ -@if TEAISH_TEST_TCL_IN -#config.log: @TEAISH_TEST_TCL_IN@ -#@TEAISH_TEST_TCL_IN@: -#@TEAISH_TEST_TCL@: @TEAISH_TEST_TCL_IN@ -@endif - @TEAISH_TESTER_TCL_IN@: @TEAISH_TESTER_TCL@: @TEAISH_TESTER_TCL_IN@ config.log: @TEAISH_TESTER_TCL@ @@ -201,7 +195,7 @@ $(tx.dll): $(tx.src) config.log all: $(tx.dll) tclsh: $(teaish.makefile) config.log - @{ echo "#!/bin/sh"; echo "exec $(TCLSH) \"\$$@\""; } > $@ + @{ echo "#!/bin/sh"; echo 'exec $(TCLSH) "$$@"'; } > $@ @chmod +x $@ @echo "Created $@" @@ -392,15 +386,15 @@ dist: # - tx.src = list of the extension's source files, being sure to # prefix each with $(tx.dir) (if it's in the same dir as the # extension) so that out-of-tree builds can find them. Optionally, -# [define] TEAISH_SRC or pass them to [teaish-add-src]. +# [define] TEAISH_SRC or pass them to [teaish-src-add]. # # It may optionally set the following vars: # # - tx.CFLAGS = CFLAGS/CPPFLAGS. Optionally, [define] TEAISH_CFLAGS -# or pass them to [teaish-add-cflags]. +# or pass them to [teaish-cflags-add]. # # - tx.LDFLAGS = LDFLAGS. Optionally, [define] TEAISH_LDFLAGS or -# pass them to [teaish-add-ldflags]. +# pass them to [teaish-ldflags-add]. # # It may optionally hook into various targets as documented in # /doc/extensions.md in the canonical teaish source tree. @@ -425,7 +419,7 @@ Makefile: @TEAISH_MAKEFILE@ # # TEAISH_MAKEFILE_CODE may contain literal makefile code, which # gets pasted verbatim here. Either [define TEAISH_MAKEFILE_CODE -# ...] or use [teaish-add-make] to incrementally build up this +# ...] or use [teaish-make-add] to incrementally build up this # content. # @if TEAISH_MAKEFILE_CODE diff --git a/autoconf/tea/autosetup/core.tcl b/autoconf/tea/autosetup/core.tcl index 57d9246c7b..4c9aee4d66 100644 --- a/autoconf/tea/autosetup/core.tcl +++ b/autoconf/tea/autosetup/core.tcl @@ -23,14 +23,7 @@ use proj -define TEAISH_VERSION 0.1-beta -use system ; # Will output "Host System" and "Build System" lines -if {"--help" ni $::argv} { - proj-tweak-default-env-dirs - msg-result "TEA(ish) Version = [get-define TEAISH_VERSION]" - msg-result "Source dir = $::autosetup(srcdir)" - msg-result "Build dir = $::autosetup(builddir)" -} +define TEAISH_CORE_VERSION 0.1-beta # # API-internal settings and shared state. @@ -46,14 +39,51 @@ array set teaish__Config [proj-strip-hash-comments { # # This might no longer be needed. pkgindex-policy 0 + + # + # If 1+ then teaish__verbose will emit messages. + # + verbose 0 + + # + # Mapping of pkginfo -flags to their TEAISH_xxx define (if any). + # + pkginfo-f2d { + -name TEAISH_NAME + -pkgName TEAISH_PKGNAME + -libDir TEAISH_LIBDIR_NAME + -loadPrefix TEAISH_LOAD_PREFIX + -version TEAISH_VERSION + -vsatisfies TEAISH_VSATISFIES_TCL + -options {} + } + + # + # Queues for use with teaish-checks-queue and teaish-checks-run. + # + queued-checks-pre {} + queued-checks-post {} + }] set teaish__Config(core-dir) $::autosetup(libdir)/teaish +# +# Runs {*}$args if $lvl is <= the current verbosity level, else it has +# no side effects. +# +proc teaish__verbose {lvl args} { + if {$lvl <= $::teaish__Config(verbose)} { + {*}$args + } +} + +# +# @teaish-argv-has flags... # # Returns true if any arg in $::argv matches any of the given globs, # else returns false. # -proc teaish__argv_has {args} { +proc teaish-argv-has {args} { foreach glob $args { foreach arg $::argv { if {[string match $glob $arg]} { @@ -64,60 +94,51 @@ proc teaish__argv_has {args} { return 0 } +if {[teaish-argv-has --teaish-verbose --t-v]} { + # Check this early so that we can use verbose-only messages in the + # pre-options-parsing steps. + set ::teaish__Config(verbose) 1 + #teaish__verbose 1 msg-result "--teaish-verbose activated" +} + +msg-quiet use system ; # Outputs "Host System" and "Build System" lines +if {"--help" ni $::argv} { + teaish__verbose 1 msg-result "TEA(ish) Version = [get-define TEAISH_CORE_VERSION]" + teaish__verbose 1 msg-result "Source dir = $::autosetup(srcdir)" + teaish__verbose 1 msg-result "Build dir = $::autosetup(builddir)" +} + +# +# @teaish-configure-core # # Main entry point for the TEA-ish configure process. auto.def's primary # (ideally only) job should be to call this. # proc teaish-configure-core {} { - # - # "Declare" some defines... - # - foreach {f v} { - TEAISH_MAKEFILE "" - TEAISH_MAKEFILE_IN "" - TEAISH_DIST_FILES "" - TEAISH_TEST_TCL "" TEAISH_TEST_TCL_IN "" - TEAISH_PKGINIT_TCL "" TEAISH_PKGINIT_TCL_IN "" - TEAISH_PKGINDEX_TCL_IN "" TEAISH_PKGINDEX_TCL "" - TEAISH_TCL "" - TEAISH_CFLAGS "" - TEAISH_LDFLAGS "" - TEAISH_SRC "" - TEAISH_VSATISFIES_TCL "8.5" - } { - define $f $v - } + proj-tweak-default-env-dirs set gotExt 0; # True if an extension config is found - if {![teaish__argv_has --teaish-create-extension* --t-c-e*]} { + if {![teaish-argv-has --teaish-create-extension=* --t-c-e=*]} { # Don't look for an extension if we're in --t-c-e mode set gotExt [teaish__find_extension] } - if {$gotExt} { - set ttcl [get-define TEAISH_TCL] - proj-assert {[file exists $ttcl]} "Expecting to have found teaish.tcl by now" - uplevel 1 "source $ttcl" - if {"" eq [get-define TEAISH_NAME ""]} { - proj-fatal "$ttcl did not define TEAISH_NAME" - } elseif {"" eq [get-define TEAISH_VERSION ""]} { - proj-fatal "$ttcl did not define TEAISH_VERSION" - } - unset ttcl - }; # sourcing extension's teaish.tcl - # - # Set up the --flags... + # Set up the core --flags. This needs to come before teaish.tcl is + # sourced so that that file can use teaish-pkginfo-set to append + # options. # options-add [proj-strip-hash-comments { with-tcl:DIR => {Directory containing tclConfig.sh or a directory one level up from - that, from which we can derive a directory containing tclConfig.sh.} + that, from which we can derive a directory containing tclConfig.sh. + Defaults to the $TCL_HOME environment variable.} with-tclsh:PATH => {Full pathname of tclsh to use. It is used for trying to find tclConfig.sh. Warning: if its containing dir has multiple tclsh - versions, it may select the wrong tclConfig.sh!} + versions, it may select the wrong tclConfig.sh! + Defaults to the $TCLSH environment variable.} # TEA has --with-tclinclude but it appears to only be useful for # building an extension against an uninstalled copy of TCL's own @@ -151,10 +172,67 @@ proc teaish-configure-core {} { t-d-d teaish-dump-defines => {Dump all configure-defined vars to config.defines.txt} + t-v + teaish-verbose=0 + => {Enable more (often extraneous) messages from the teaish core.} + t-d teaish-debug => {Enable teaish-specific debug output} }]; # main options. + if {$gotExt} { + set ttcl [get-define TEAISH_TCL] + proj-assert {[file exists $ttcl]} "Expecting to have found teaish.tcl by now" + uplevel 1 [list source $ttcl] + proj-assert {"" ne [teaish-pkginfo-get -name]} + unset ttcl + # Set up some default values if the extension did not set them. + # This must happen _after_ it's sourced. + foreach {pflag key type val} { + - TEAISH_CFLAGS -v "" + - TEAISH_DIST_FILES -v "" + - TEAISH_LDFLAGS -v "" + - TEAISH_MAKEFILE -v "" + - TEAISH_MAKEFILE_CODE -v "" + - TEAISH_MAKEFILE_IN -v "" + - TEAISH_PKGINDEX_TCL -v "" + - TEAISH_PKGINDEX_TCL_IN -v "" + - TEAISH_PKGINIT_TCL -v "" + - TEAISH_PKGINIT_TCL_IN -v "" + - TEAISH_SRC -v "" + - TEAISH_TEST_TCL -v "" + - TEAISH_TEST_TCL_IN -v "" + + -version TEAISH_VERSION -v 0.0.0 + -pkgName TEAISH_PKGNAME -e {teaish-pkginfo-get -name} + -libDir TEAISH_LIBDIR_NAME -e {join [list \ + [teaish-pkginfo-get -pkgName] \ + [teaish-pkginfo-get -version]]} + -loadPrefix TEAISH_LOAD_PREFIX -e {string totitle [get-define TEAISH_PKGNAME ""]} + -vsatisfies TEAISH_VSATISFIES_TCL -v 8.5- + } { + set isDefOnly [expr {"-" eq $pflag}] + if {!$isDefOnly && [info exists ::teaish__Config($pflag)]} { + continue; + } + set got [get-define $key ""] + if {$isDefOnly && "" ne $got} { + continue + } + switch -exact -- $type { + -v {} + -e { set val [eval $val] } + default { proj-error "Invalid type flag: $type" } + } + #puts "***** defining default $pflag $key {$val} isDefOnly=$isDefOnly got=$got" + define $key $val + if {!$isDefOnly} { + set ::teaish__Config($pflag) $val + } + } + unset key type val + }; # sourcing extension's teaish.tcl + if {[llength [info proc teaish-options]] > 0} { # Add options defined by teaish-options, which is assumed to be # imported via TEAISH_TCL. @@ -180,8 +258,10 @@ proc teaish-configure-core {} { ted => teaish-extension-dir t-e-d => teaish-extension-dir t-f => teaish-force + t-v => teaish-verbose } + set ::teaish__Config(verbose) [opt-bool teaish-verbose] set ::teaish__Config(debug-enabled) [opt-bool teaish-debug] if {[proj-opt-was-provided teaish-create-extension]} { @@ -209,41 +289,15 @@ proc teaish-debug {msg} { # --flags. This is what will import the client-defined teaish.tcl. # proc teaish__configure-phase1 {} { - # Set up some default values if the user did not set them. - foreach {key val} [list \ - TEAISH_PKGNAME [get-define TEAISH_NAME] \ - TEAISH_VERSION 0.0.0 \ - TEAISH_MAKEFILE_CODE ""] { - if {"" eq [get-define $key ""]} { - #puts "***** defining default $key $val" - define $key $val - } - } - # Do it again for vars which rely on defaults derived from other - # vars. - foreach {key val} [list \ - TEAISH_LIBDIR_NAME \ - [join [list \ - [get-define TEAISH_PKGNAME ""] \ - [get-define TEAISH_VERSION ""]] \ - "" ] \ - TEAISH_LOAD_PREFIX [string totitle \ - [get-define TEAISH_PKGNAME ""]] \ - TEAISH_PKGNAME [get-define TEAISH_NAME]] { - if {"" eq [get-define $key ""]} { - #puts "***** defining default $key $val" - define $key $val - } - } - msg-result \ - "Configuring extension [proj-bold [get-define TEAISH_NAME] [get-define TEAISH_VERSION]]..." + [join [list "Configuring build of Tcl extension" \ + [proj-bold [teaish-pkginfo-get -name] \ + [teaish-pkginfo-get -version]] "..."]] uplevel 1 { use cc cc-db cc-shared cc-lib; # pkg-config } teaish__check_tcl - teaish__check_common_bins apply {{} { # # If --prefix or --exec-prefix are _not_ provided, use their @@ -260,48 +314,55 @@ proc teaish__configure-phase1 {} { exec-prefix exec_prefix TCL_EXEC_PREFIX } { if {![proj-opt-was-provided $flag]} { - set v [get-define $tclVar "???"] - proj-assert {"???" ne $v} "Expecting teach-check-tcl to have defined $tclVar" + if {"exec-prefix" eq $flag} { + # If --exec-prefix was not used, ensure that --exec-prefix + # derives from the --prefix we may have just redefined. + set v {${prefix}} + } else { + set v [get-define $tclVar "???"] + teaish__verbose 1 msg-result "Using \$$tclVar for --$flag=$v" + } + proj-assert {"???" ne $v} "Expecting teaish__check_tcl to have defined $tclVar" + #puts "*** $flag $uflag $tclVar = $v" proj-opt-set $flag $v define $uflag $v + # ^^^ As of here, all autotools-compatibility vars which derive # from --$flag, e.g. --libdir, still derive from the default # --$flag value which was active when system.tcl was # included. So long as those flags are not explicitly passed to # the configure script, those will be straightened out via # [proj-remap-autoconf-dir-vars]. - msg-result "Using \$$tclVar for --$flag=$v" } } }}; # --[exec-]prefix defaults + teaish__check_common_bins + # + # Set up library file names + # proj-file-extensions apply {{} { - set pkgname [get-define TEAISH_NAME] - set pkgver [get-define TEAISH_VERSION] + set name [teaish-pkginfo-get -name]; # _not_ -pkgName + set pkgver [teaish-pkginfo-get -version] set libname "lib" if {[string match *-cygwin [get-define host]]} { set libname cyg } - define TEAISH_DLL8_BASENAME $libname$pkgname$pkgver - define TEAISH_DLL9_BASENAME ${libname}tcl9$pkgname$pkgver + define TEAISH_DLL8_BASENAME $libname$name$pkgver + define TEAISH_DLL9_BASENAME ${libname}tcl9$name$pkgver set ext [get-define TARGET_DLLEXT] define TEAISH_DLL8 [get-define TEAISH_DLL8_BASENAME]$ext define TEAISH_DLL9 [get-define TEAISH_DLL9_BASENAME]$ext }} - define TEAISH_AUTOSETUP_DIR $::teaish__Config(core-dir) -# We'd need to import feature-tests.tcl too -# foreach ft [glob -nocomplain [get-define TEAISH_AUTOSETUP_DIR]/feature/*.tcl] { -# puts "Loading external feature test: $ft" -# upscope 1 "source $ft" -# } - + teaish-checks-run -pre if {[llength [info proc teaish-configure]] > 0} { # teaish-configure is assumed to be imported via # TEAISH_TCL teaish-configure } + teaish-checks-run -post if {0} { # Reminder: we cannot do a TEAISH_VSATISFIES_TCL check like the following @@ -313,8 +374,8 @@ proc teaish__configure-phase1 {} { if {$vsat ne "" && ![package vsatisfies [package provide Tcl] $vsat]} { error [join [list "Tcl package vsatisfies failed for" \ - [get-define TEAISH_NAME] \ - [get-define TEAISH_VERSION] \ + [teaish-pkginfo-get -name] \ + [teaish-pkginfo-get -version] \ ": expecting vsatisfies to match ($vsat)"]] } unset vsat @@ -326,7 +387,7 @@ proc teaish__configure-phase1 {} { # Without this, linking of an extension will not work on Cygwin or # Msys2. msg-result "Using USE_TCL_STUBS for Unix(ish)-on-Windows environment" - teaish-add-cflags -DUSE_TCL_STUBS=1 + teaish-cflags-add -DUSE_TCL_STUBS=1 } #define AS_LIBDIR $::autosetup(libdir) @@ -338,14 +399,14 @@ proc teaish__configure-phase1 {} { # when rebuilding for different --with-tcl=... values. # if {!$::teaish__Config(pkgindex-policy)} { - proj-fatal "Cannot determine which pkgIndex.tcl to use" + proj-error "Cannot determine which pkgIndex.tcl to use" } set tpi [proj-coalesce \ [get-define TEAISH_PKGINDEX_TCL_IN] \ [get-define TEAISH_PKGINDEX_TCL]] proj-assert {$tpi ne ""} \ "TEAISH_PKGINDEX_TCL should have been set up by now" - msg-result "Using pkgIndex from $tpi" + teaish__verbose 1 msg-result "Using pkgIndex from $tpi" }}; # $::teaish__Config(pkgindex-policy) set dEx $::teaish__Config(teaish-dir) @@ -354,12 +415,8 @@ proc teaish__configure-phase1 {} { proj-dot-ins-append $dSrc/Makefile.in proj-dot-ins-append $dSrc/teaish.tester.tcl.in - if {[get-define TEAISH_OUT_OF_EXT_TREE]} { - define TEAISH_ENABLE_DIST 0 - } else { - define TEAISH_ENABLE_DIST 1 - } - + define TEAISH_ENABLE_DIST [expr {![get-define TEAISH_OUT_OF_EXT_TREE]}] + define TEAISH_AUTOSETUP_DIR $::teaish__Config(core-dir) proj-setup-autoreconfig TEAISH_AUTORECONFIG foreach f { TEAISH_CFLAGS @@ -444,8 +501,8 @@ proc teaish__check_tcl {} { set srcdir $::autosetup(srcdir) msg-result "Checking for a suitable tcl... " set use_tcl 1 - set with_tclsh [opt-val with-tclsh] - set with_tcl [opt-val with-tcl] + set with_tclsh [opt-val with-tclsh [proj-get-env TCLSH]] + set with_tcl [opt-val with-tcl [proj-get-env TCL_HOME]] if {0} { # This misinteracts with the $TCL_PREFIX default: it will use the # autosetup-defined --prefix default @@ -468,7 +525,7 @@ proc teaish__check_tcl {} { # --with-tclsh was provided or found above. Validate it and use it # to trump any value passed via --with-tcl=DIR. if {![file-isexec $with_tclsh]} { - proj-fatal "TCL shell $with_tclsh is not executable" + proj-error "TCL shell $with_tclsh is not executable" } else { define TCLSH_CMD $with_tclsh #msg-result "Using tclsh: $with_tclsh" @@ -477,8 +534,8 @@ proc teaish__check_tcl {} { [catch {exec $with_tclsh $::autosetup(libdir)/find_tclconfig.tcl} result] == 0} { set with_tcl $result } - if {"" ne $with_tcl && [file isdir $with_tcl]} { - msg-result "$with_tclsh recommends the tclConfig.sh from $with_tcl" + if {"" ne $with_tcl && [file isdirectory $with_tcl]} { + teaish__verbose 1 msg-result "$with_tclsh recommends the tclConfig.sh from $with_tcl" } else { proj-warn "$with_tclsh is unable to recommend a tclConfig.sh" set use_tcl 0 @@ -502,7 +559,7 @@ proc teaish__check_tcl {} { } } if {"" eq $cfg} { - proj-fatal "No tclConfig.sh found under ${with_tcl}" + proj-error "No tclConfig.sh found under ${with_tcl}" } } else { # If we have not yet found a tclConfig.sh file, look in $libdir @@ -524,7 +581,7 @@ proc teaish__check_tcl {} { break } } - msg-result "Using tclConfig.sh: $cfg" + teaish__verbose 1 msg-result "Using tclConfig.sh = $cfg" break } define TCL_CONFIG_SH $cfg @@ -561,20 +618,20 @@ proc teaish__check_tcl {} { if {"" ne $with_tclsh && [catch {exec echo "puts stdout \$auto_path" | "$with_tclsh"} result] == 0} { foreach i $result { - if {[file isdir $i]} { + if {[file isdirectory $i]} { set tcllibdir $i/$extDirName break } } } else { - proj-fatal "Cannot determine TCLLIBDIR." + proj-error "Cannot determine TCLLIBDIR." } } define TCLLIBDIR $tcllibdir }; # find TCLLIBDIR if {[file-isexec $with_tclsh]} { - msg-result "Using tclsh: $with_tclsh" + teaish__verbose 1 msg-result "Using tclsh = $with_tclsh" if {$cfg ne ""} { define HAVE_TCL 1 } else { @@ -587,15 +644,17 @@ proc teaish__check_tcl {} { # to generate a working JimTCL then that will suffice for build-time # TCL purposes (see: proc sqlite-determine-codegen-tcl). if {![file-isexec $with_tclsh]} { - proj-fatal "Did not find tclsh" + proj-error "Did not find tclsh" } elseif {"" eq $cfg} { proj-indented-notice -error { Cannot find a usable tclConfig.sh file. Use --with-tcl=DIR to specify a directory where tclConfig.sh can be - found. + found, or --with-tclsh=/path/to/tclsh to allow the tclsh binary + to locate its tclConfig.sh. } } -}; # teaish-check-tcl + msg-result "Using Tcl [get-define TCL_VERSION]." +}; # teaish__check_tcl # # Searches $::argv and/or the build dir and/or the source dir for @@ -611,18 +670,18 @@ proc teaish__check_tcl {} { # proc teaish__find_extension {} { - msg-result "Looking for teaish extension..." + teaish__verbose 1 msg-result "Looking for teaish extension..." # Helper for the foreach loop below. set lambdaMT {{mustHave fid dir} { - if {[file isdir $dir]} { + if {[file isdirectory $dir]} { set f [file join $dir $fid] if {[file readable $f]} { return [file-normalize $f] } elseif {$mustHave} { - proj-fatal "Missing required $dir/$fid" + proj-error "Missing required $dir/$fid" } } elseif {$mustHave} { - proj-fatal "--teaish-extension-dir=$dir does not reference a directory" + proj-error "--teaish-extension-dir=$dir does not reference a directory" } return "" }} @@ -634,7 +693,7 @@ proc teaish__find_extension {} { #set extM ""; # teaish.make.in set dirBld $::autosetup(builddir); # dir we're configuring under set dirSrc $::autosetup(srcdir); # where teaish's configure script lives - set extT {}; # teaish.tcl + set extT ""; # teaish.tcl set largv {}; # rewritten $::argv set gotHelpArg 0; # got the --help foreach arg $::argv { @@ -647,11 +706,12 @@ proc teaish__find_extension {} { # teaish.tcl. regexp -- {--[^=]+=(.+)} $arg - extD set extD [file-normalize $extD] - if {![file isdir $extD]} { - proj-fatal "--teaish-extension-dir value is not a directory: $extD" + if {![file isdirectory $extD]} { + proj-error "--teaish-extension-dir value is not a directory: $extD" } set extT [apply $lambdaMT 1 teaish.tcl $extD] define TEAISH_DIR $extD + set ::teaish__Config(teaish-dir) $extD } --help { incr gotHelpArg @@ -691,7 +751,7 @@ If you are attempting an out-of-tree build, use } } if {![file readable $extT]} { - proj-fatal "extension tcl file is not readable: $extT" + proj-error "extension tcl file is not readable: $extT" } define TEAISH_TCL $extT @@ -703,18 +763,17 @@ If you are attempting an out-of-tree build, use } define TEAISH_DIR $dirExt set ::teaish__Config(teaish-dir) $dirExt - # are we building in-tree vis-a-vis the extension? set ::teaish__Config(blddir-is-extdir) \ [define TEAISH_ENABLE_DIST [expr {$dirBld eq $dirExt}]] set addDist {{file} { - teaish-add-dist [file tail $file] + teaish-dist-add [file tail $file] }} apply $addDist $extT - msg-result "Extension dir = [get-define TEAISH_DIR]" - msg-result "Extension config = $extT" + teaish__verbose 1 msg-result "Extension dir = [get-define TEAISH_DIR]" + teaish__verbose 1 msg-result "Extension config = $extT" - define TEAISH_NAME [file tail [file dirname $extT]] + teaish-pkginfo-set -name [file tail [file dirname $extT]] # # teaish.make[.in] provides some of the info for the main makefile, @@ -735,7 +794,7 @@ If you are attempting an out-of-tree build, use define TEAISH_MAKEFILE $extM } apply $addDist $extM - msg-result "Extension makefile = $extM" + teaish__verbose 1 msg-result "Extension makefile = $extM" } else { define TEAISH_MAKEFILE_IN "" define TEAISH_MAKEFILE "" @@ -754,7 +813,7 @@ If you are attempting an out-of-tree build, use define TEAISH_PKGINIT_TCL $extI } apply $addDist $extI - msg-result "Extension post-load init = $extI" + teaish__verbose 1 msg-result "Extension post-load init = $extI" define TEAISH_PKGINIT_TCL_TAIL \ [file tail [get-define TEAISH_PKGINIT_TCL]]; # for use in pkgIndex.tcl.in } @@ -838,14 +897,16 @@ If you are attempting an out-of-tree build, use return 1 }; # teaish__find_extension -# @teaish-add-cflags ?-p|prepend? ?-define? cflags... +# +# @teaish-cflags-add ?-p|prepend? ?-define? cflags... # # Equivalent to [proj-define-amend TEAISH_CFLAGS {*}$args]. # -proc teaish-add-cflags {args} { +proc teaish-cflags-add {args} { proj-define-amend TEAISH_CFLAGS {*}$args } +# # @teaish-define-to-cflag defineName... # # Uses [proj-define-to-cflag] to expand a list of [define] keys, each @@ -853,10 +914,11 @@ proc teaish-add-cflags {args} { # that to the current TEAISH_CFLAGS. # proc teaish-define-to-cflag {args} { - teaish-add-cflags [proj-define-to-cflag {*}$args] + teaish-cflags-add [proj-define-to-cflag {*}$args] } -# @teaish-add-ldflags ?-p|-prepend? ?-define? ldflags... +# +# @teaish-ldflags-add ?-p|-prepend? ?-define? ldflags... # # Equivalent to [proj-define-amend TEAISH_LDFLAGS {*}$args]. # @@ -865,26 +927,28 @@ proc teaish-define-to-cflag {args} { # historical, and not relevant on all environments, but it is # technically correct and still relevant on some environments. # -# See: teaish-prepend-ldflags +# See: teaish-ldflags-prepend # -proc teaish-add-ldflags {args} { +proc teaish-ldflags-add {args} { proj-define-amend TEAISH_LDFLAGS {*}$args } -# @teaish-prepend-ldflags args... # -# Functionally equivalent to [teaish-add-ldflags -p {*}$args] +# @teaish-ldflags-prepend args... # -proc teaish-prepend-ldflags {args} { - teaish-add-ldflags -p {*}$args +# Functionally equivalent to [teaish-ldflags-add -p {*}$args] +# +proc teaish-ldflags-prepend {args} { + teaish-ldflags-add -p {*}$args } -# @teaish-add-src ?-dist? ?-dir? src-files... +# +# @teaish-src-add ?-dist? ?-dir? src-files... # # Appends all non-empty $args to TEAISH_SRC. # # If passed -dist then it also passes each filename, as-is, to -# [teaish-add-dist]. +# [teaish-dist-add]. # # If passed -dir then each src-file has the TEAISH_DIR prepended to # it for before they're added to TEAISH_SRC. As often as not, that @@ -892,14 +956,14 @@ proc teaish-prepend-ldflags {args} { # sources, but there are cases where it's not desired (e.g. when using # a source file from outside of the extension's dir). # -proc teaish-add-src {args} { +proc teaish-src-add {args} { set i 0 proj-parse-simple-flags args flags { -dist 0 {return 1} -dir 0 {return 1} } if {$flags(-dist)} { - teaish-add-dist {*}$args + teaish-dist-add {*}$args } if {$flags(-dir)} { set xargs {} @@ -914,7 +978,8 @@ proc teaish-add-src {args} { proj-define-append TEAISH_SRC {*}$args } -# @teaish-add-dist files-or-dirs... +# +# @teaish-dist-add files-or-dirs... # # Equivalent to [proj-define-apend TEAISH_DIST_FILES ...]. # @@ -924,18 +989,19 @@ proc teaish-add-src {args} { # It is not legal to call this until TEAISH_DIR has been reliably set # (via teaish__find_extension). # -proc teaish-add-dist {args} { +proc teaish-dist-add {args} { if {$::teaish__Config(blddir-is-extdir)} { proj-define-amend TEAISH_DIST_FILES {*}$args } } -# teaish-add-install files... +# teaish-install-add files... # Equivalent to [proj-define-apend TEAISH_INSTALL_FILES ...]. -#proc teaish-add-install {args} { +#proc teaish-install-add {args} { # proj-define-amend TEAISH_INSTALL_FILES {*}$args #} +# # @teash-append-make args... # # Appends makefile code to the TEAISH_MAKEFILE_CODE define. Each @@ -950,7 +1016,7 @@ proc teaish-add-dist {args} { # Anything else is appended verbatim. This function adds no additional # spacing between each argument nor between subsequent invocations. # -proc teaish-add-make {args} { +proc teaish-make-add {args} { set out [get-define TEAISH_MAKEFILE_CODE ""] foreach a $args { switch -exact -- $a { @@ -965,6 +1031,7 @@ proc teaish-add-make {args} { define TEAISH_MAKEFILE_CODE $out } +# # @teaish-make-config-header filename # # Invokes autosetup's [make-config-header] and passes it $filename and @@ -985,6 +1052,7 @@ proc teaish-make-config-header {filename} { proj-touch $filename; # help avoid frequent unnecessary auto-reconfig } +# # @teaish-feature-cache-set ?$key? value # # Sets a feature-check cache entry with the given key. @@ -994,6 +1062,7 @@ proc teaish-feature-cache-set {{key 0} val} { proj-cache-set $key 1 $val } +# # @teaish-feature-cache-check ?$key? tgtVarName # # Checks for a feature-check cache entry with the given key. @@ -1010,6 +1079,7 @@ proc teaish-feature-cache-check {{key 0} tgtVar} { proj-cache-check $key 1 tgt } +# # @teaish-check-cached@ ?-nostatus? msg script # # A proxy for feature-test impls which handles caching of a feature @@ -1157,7 +1227,7 @@ proc teaish__defs_format {type value} { set value $::teaish__Config(defs-skip) } default { - proj-fatal \ + proj-error \ "Unknown [project-current-scope] -type ($type) called from" \ [proj-current-scope 1] } @@ -1223,15 +1293,15 @@ proc teaish-pragma {args} { if {[proj-first-file-found $flist tpi]} { if {[string match *.in $tpi]} { define TEAISH_PKGINDEX_TCL_IN $tpi - teaish-add-dist [file tail $tpi] + teaish-dist-add [file tail $tpi] define TEAISH_PKGINDEX_TCL [file rootname [file tail $pi]] } else { define TEAISH_PKGINDEX_TCL_IN "" define TEAISH_PKGINDEX_TCL $tpi - teaish-add-dist [file tail $tpi] + teaish-dist-add [file tail $tpi] } } else { - proj-fatal "teaish-pragma $arg found no package-local pkgIndex.tcl\[.in]" + proj-error "teaish-pragma $arg found no package-local pkgIndex.tcl\[.in]" } set ::teaish__Config(pkgindex-policy) 0x10 } @@ -1250,6 +1320,119 @@ proc teaish-pragma {args} { } } +# +# @teaish-pkginfo-set ...flags +# +# The preferred way to set up the initial package state. Used like: +# +# teaish-pkginfo-set -name foo -version 0.1.2 +# +# Where each flag corresponds to one piece of extension package info. +# +# -name TEAISH_NAME +# -pkgName TEAISH_PKGNAME +# -libDir TEAISH_LIBDIR_NAME +# -loadPrefix TEAISH_LOAD_PREFIX +# -version TEAISH_VERSION +# -vsatisfies TEAISH_VSATISFIES_TCL +# -options {...} optional [options-add] value +# +proc teaish-pkginfo-set {args} { + set sentinel "" + set f2d $::teaish__Config(pkginfo-f2d) + set flagDefs [list] + foreach {f d} $f2d { + lappend flagDefs $f => $sentinel + } + proj-parse-simple-flags args flags $flagDefs + if {[llength $args]} { + proj-error -up "Too many (or unknown) arguments to [proj-current-scope]: $args" + } + foreach {f d} $f2d { + if {$sentinel ne [set v $flags($f)]} { + switch -exact -- $f { + -options { + options-add $v + } + default { + define $d $v + } + } + set ::teaish__Config($f) $v + } + } +} + +# +# @teaish-pkginfo-get ?arg? +# +# If passed no arguments, it returns the extension config info in the +# same form accepted by teaish-pkginfo-set. +# +# If passed one -flagname arg then it returns the value of that config +# option. +# +# Else it treats arg as the name of caller-scoped variable to +# which this function assigns an array containing the configuration +# state of this extension, in the same structure accepted by +# teaish-pkginfo-set. In this case it returns an empty string. +# +proc teaish-pkginfo-get {args} { + set cases {} + set argc [llength $args] + set rv {} + switch -exact $argc { + 0 { + # Return a list of (-flag value) pairs + lappend cases default {{ + if {[info exists ::teaish__Config($flag)]} { + lappend rv $flag $::teaish__Config($flag) + } else { + lappend rv $flag [get-define $defName] + } + }} + } + + 1 { + set arg $args + if {[string match -* $arg]} { + # Return the corresponding -flag's value + lappend cases $arg {{ + if {[info exists ::teaish__Config($flag)]} { + return $::teaish__Config($flag) + } else { + return [get-define $defName] + } + }} + } else { + # Populate target with an array of (-flag value). + upvar $arg tgt + array set tgt {} + lappend cases default {{ + if {[info exists ::teaish__Config($flag)]} { + set tgt($flag) $::teaish__Config($flag) + } else { + set tgt($flag) [get-define $defName] + } + }} + } + } + + default { + proj-error "invalid arg count from [proj-current-scope 1]" + } + } + + foreach {flag defName} $::teaish__Config(pkginfo-f2d) { + switch -exact -- $flag [join $cases] + } + if {0 == $argc} { return $rv } +} + +#proc teaish-pget {flag} { +# teaish-pkginfo-get $flag +#} + # # @teaish-enable-dist ?yes? # @@ -1263,6 +1446,42 @@ proc teaish-enable-dist {{yes 1}} { define TEAISH_ENABLE_DIST $yes } +# +# @teaish-checks-queue -pre|-post args... +# +# Queues one or more arbitrary "feature test" functions to be run when +# teaish-checks-run is called. $flag must be one of -pre or -post to +# specify whether the tests should be run before or after +# teaish-configure is run. Each additional arg is the name of a +# feature-test proc. +# +proc teaish-checks-queue {flag args} { + if {$flag ni {-pre -post}} { + proj-error "illegal flag: $flag" + } + lappend ::teaish__Config(queued-checks${flag}) {*}$args +} + +# +# @teaish-checks-run -pre|-post +# +# Runs all feature checks queued using teaish-checks-queue +# then cleares the queue. +# +proc teaish-checks-run {flag} { + if {$flag ni {-pre -post}} { + proj-error "illegal flag: $flag" + } + #puts "*** running $flag: $::teaish__Config(queued-checks${flag})" + set foo 0 + foreach f $::teaish__Config(queued-checks${flag}) { + if {![teaish-feature-cache-check $f foo]} { + set v [$f] + teaish-feature-cache-set $f $v + } + } + set ::teaish__Config(queued-checks${flag}) {} +} # # Handles --teaish-create-extension=TARGET-DIR @@ -1270,7 +1489,7 @@ proc teaish-enable-dist {{yes 1}} { proc teaish__create_extension {dir} { set force [opt-bool teaish-force] if {"" eq $dir} { - proj-fatal "--teaish-create-extension=X requires a directory name." + proj-error "--teaish-create-extension=X requires a directory name." } file mkdir $dir set cwd [pwd] @@ -1295,28 +1514,46 @@ proc teaish__create_extension {dir} { set pkgName $name set version 0.0.1 set loadPrefix [string totitle $pkgName] - set content "define TEAISH_NAME ${name} -define TEAISH_VERSION ${version} -# define TEAISH_PKGNAME ${pkgName} -# define TEAISH_LIBDIR_NAME ${name}${version} -# define TEAISH_LOAD_PREFIX ${loadPrefix} -proc teaish-options {} { - # Return a list and/or use [options-add] to add new + set content "teaish-pkginfo-set \ + -name ${name} \ + -pkgName ${pkgName} \ + -version ${version} \ + -loadPrefix $loadPrefix \ + -libDir ${name}${version} + -vsatisfies 8.5- \ + -options { foo=1 => {Disable foo} } + +#proc teaish-options {} { + # Return a list and/or use \[options-add\] to add new # configure flags. This is called before teaish's # bootstrapping is finished, so only teaish-* # APIs which are explicitly noted as being safe # early on may be used here. Any autosetup-related # APIs may be used here. -} + # + # Return an empty string if there are no options to add + # or if they are added using \[options-add\]. +#} + proc teaish-configure {} { - set d \[get-define TEAISH_DIR] - teaish-add-src \$d/teaish.c - teaish-add-dist teaish.c + set d \[get-define TEAISH_DIR\] + teaish-src-add \$d/teaish.c + teaish-dist-add teaish.c + + # TODO: your code goes here.. } " proj-file-write teaish.tcl $content msg-result "Created teaish.tcl" + set content "# Teaish test script. +# When this tcl script is invoked via 'make test' it will have loaded +# the package, run any teaish.pkginit.tcl code, and loaded +# autosetup/teaish/tester.tcl. +" + proj-file-write teaish.test.tcl $content + msg-result "Created teaish.test.tcl" + set content [subst -nocommands -nobackslashes { #include static int diff --git a/autoconf/tea/autosetup/feature-tests.tcl b/autoconf/tea/autosetup/feature-tests.tcl index d6a54dd4d7..9d77092c82 100644 --- a/autoconf/tea/autosetup/feature-tests.tcl +++ b/autoconf/tea/autosetup/feature-tests.tcl @@ -27,7 +27,7 @@ proc teaish-check-libz {} { teaish-check-cached "Checking for libz" { set rc 0 if {[msg-quiet cc-check-includes zlib.h] && [msg-quiet proj-check-function-in-lib deflate z]} { - teaish-prepend-ldflags [define LDFLAGS_LIBZ [get-define lib_deflate]] + teaish-ldflags-prepend [define LDFLAGS_LIBZ [get-define lib_deflate]] undefine lib_deflate incr rc } @@ -38,7 +38,7 @@ proc teaish-check-libz {} { # @teaish-check-librt ?funclist? # # Checks whether -lrt is needed for any of the given functions. If -# so, appends -lrt via [teaish-prepend-ldflags] and returns 1, else +# so, appends -lrt via [teaish-ldflags-prepend] and returns 1, else # returns 0. It also defines LDFLAGS_LIBRT to the libs flag or an # empty string. # @@ -52,7 +52,7 @@ proc teaish-check-librt {{funclist {fdatasync nanosleep}}} { set ldrt [get-define lib_${func}] undefine lib_${func} if {"" ne $ldrt} { - teaish-prepend-ldflags -r [define LDFLAGS_LIBRT $ldrt] + teaish-ldflags-prepend -r [define LDFLAGS_LIBRT $ldrt] msg-result $ldrt return 1 } else { @@ -95,7 +95,7 @@ proc teaish-is-mingw {} { # Checks for whether dlopen() can be found and whether it requires # -ldl for linking. If found, returns 1, defines LDFLAGS_DLOPEN to the # linker flags (if any), and passes those flags to -# teaish-prepend-ldflags. It unconditionally defines HAVE_DLOPEN to 0 +# teaish-ldflags-prepend. It unconditionally defines HAVE_DLOPEN to 0 # or 1 (the its return result value). proc teaish-check-dlopen {} { teaish-check-cached -nostatus "Checking for dlopen()" { @@ -117,7 +117,7 @@ proc teaish-check-dlopen {} { } else { msg-result "not found" } - teaish-prepend-ldflags [define LDFLAGS_DLOPEN $lfl] + teaish-ldflags-prepend [define LDFLAGS_DLOPEN $lfl] define HAVE_DLOPEN $rc } } @@ -135,7 +135,7 @@ proc teaish-check-libmath {} { incr rc set lfl [get-define lib_ceil] undefine lib_ceil - teaish-prepend-ldflags $lfl + teaish-ldflags-prepend $lfl msg-checking "$lfl " } define LDFLAGS_LIBMATH $lfl @@ -143,7 +143,7 @@ proc teaish-check-libmath {} { } } -# @teaish-import-features ?-no-options? feature-names... +# @teaish-import-features ?-flags? feature-names... # # For each $name in feature-names... it invokes: # @@ -155,32 +155,60 @@ proc teaish-check-libmath {} { # after sourcing a file, it is called and its result is passed to # proj-append-options. This can be suppressed with the -no-options # flag. +# +# Flags: +# +# -no-options: disables the automatic running of +# teaish-check-NAME-options, +# +# -run: if the function teaish-check-NAME exists after importing +# then it is called. This flag must not be used when calling this +# function from teaish-options. This trumps both -pre and -post. +# +# -pre: if the function teaish-check-NAME exists after importing +# then it is passed to [teaish-checks-queue -pre]. +# +# -post: works like -pre but instead uses[teaish-checks-queue -post]. proc teaish-import-features {args} { + set pk "" set doOpt 1 - if {1} { - set xopt [list] - foreach arg $args { - switch -exact -- $arg { - -no-options { - set doOpt 0 - } - default { - lappend xopt $arg - } - } - } - set args $xopt + proj-parse-simple-flags args flags { + -no-options 0 {set doOpt 0} + -run 0 {expr 1} + -pre 0 {set pk -pre} + -post 0 {set pk -post} } + # + # TODO: never import the same module more than once. The "use" + # command is smart enough to not do that but we would need to + # remember whether or not any teaish-check-${arg}* procs have been + # called before, and skip them. + # + if {$flags(-run) && "" ne $pk} { + proj-error "Cannot use both -run and $pk" \ + " (called from [proj-current-scope 1])" + } + foreach arg $args { uplevel "use teaish/feature/$arg" if {$doOpt} { set n "teaish-check-${arg}-options" if {[llength [info proc $n]] > 0} { - set x [$n] - if {"" ne $x} { + if {"" ne [set x [$n]]} { options-add $x } } } + if {$flags(-run)} { + set n "teaish-check-${arg}" + if {[llength [info proc $n]] > 0} { + uplevel 1 $n + } + } elseif {"" ne $pk} { + set n "teaish-check-${arg}" + if {[llength [info proc $n]] > 0} { + teaish-checks-queue {*}$pk $n + } + } } } diff --git a/autoconf/tea/autosetup/tester.tcl b/autoconf/tea/autosetup/tester.tcl index d48d7af44a..199f64dafb 100644 --- a/autoconf/tea/autosetup/tester.tcl +++ b/autoconf/tea/autosetup/tester.tcl @@ -21,7 +21,7 @@ # intended to be run from autosetup code. Rather, they're for # use with/via teaish.tester.tcl. -######################################################################## +# # @test-current-scope ?lvl? # # Returns the name of the _calling_ proc from ($lvl + 1) levels up the @@ -52,23 +52,27 @@ proc test-msg {args} { # @test-warn # # Emits all arugments to stderr. +# proc test-warn {args} { puts stderr "WARNING: $args" } -######################################################################## +# # @test-error msg # # Triggers a test-failed error with a string describing the calling # scope and the provided message. +# proc test-fail {args} { #puts stderr "ERROR: \[[test-current-scope 1]]: $msg" #exit 1 error "FAIL: \[[test-current-scope 1]]: $args" } +# # Internal impl for assert-likes. Should not be called directly by # client code. +# proc test__assert {lvl script {msg ""}} { set src "expr \{ $script \}" # puts "XXXX evalling $src"; @@ -83,42 +87,46 @@ proc test__assert {lvl script {msg ""}} { } } -######################################################################## +# # @assert script ?message? # # Kind of like a C assert: if uplevel (eval) of [expr {$script}] is # false, a fatal error is triggered. The error message, by default, # includes the body of the failed assertion, but if $msg is set then # that is used instead. +# proc assert {script {msg ""}} { test__assert 1 $script $msg } -######################################################################## +# # @test-assert testId script ?msg? # # Works like [assert] but emits $testId to stdout first. +# proc test-assert {testId script {msg ""}} { puts "test $testId" test__assert 2 $script $msg } -######################################################################## +# # @test-expect testId script result # # Runs $script in the calling scope and compares its result to # $result. If they differ, it triggers an [assert]. +# proc test-expect {testId script result} { puts "test $testId" set x [uplevel 1 $script] test__assert 1 {$x eq $result} "\nEXPECTED: <<$result>>\nGOT: <<$x>>" } -######################################################################## +# # @test-catch cmd ?...args? # # Runs [cmd ...args], repressing any exception except to possibly log # the failure. Returns 1 if it caught anything, 0 if it didn't. +# proc test-catch {cmd args} { if {[catch { $cmd {*}$args @@ -133,6 +141,7 @@ if {![array exists ::teaish__BuildFlags]} { array set ::teaish__BuildFlags {} } +# # @teaish-build-flag2 flag tgtVar ?dflt? # # Caveat #1: only valid when called in the context of teaish's default @@ -165,11 +174,13 @@ proc teaish-build-flag2 {flag tgtVar {dflt ""}} { return 0 } +# # @teaish-build-flag flag ?dflt? # # Convenience form of teaish-build-flag2 which returns the # configure-time-defined value of $flag or "" if it's not defined (or # if it's an empty string). +# proc teaish-build-flag {flag {dflt ""}} { set tgt "" teaish-build-flag2 $flag tgt $dflt diff --git a/autoconf/tea/pkgIndex.tcl.in b/autoconf/tea/pkgIndex.tcl.in index 93fbe0ead1..6ed6bb68db 100644 --- a/autoconf/tea/pkgIndex.tcl.in +++ b/autoconf/tea/pkgIndex.tcl.in @@ -12,24 +12,24 @@ if {![package vsatisfies [package provide Tcl] @TEAISH_VSATISFIES_TCL@]} { } @endif if {[package vsatisfies [package provide Tcl] 9.0-]} { - package ifneeded @TEAISH_PKGNAME@ @TEAISH_VERSION@ [list apply {{dir} { - load [file join $dir @TEAISH_DLL9@] @TEAISH_LOAD_PREFIX@ + package ifneeded {@TEAISH_PKGNAME@} {@TEAISH_VERSION@} [list apply {{dir} { + load [file join $dir {@TEAISH_DLL9@}] @TEAISH_LOAD_PREFIX@ @if TEAISH_PKGINIT_TCL_TAIL - set initScript [file join $dir @TEAISH_PKGINIT_TCL_TAIL@] + set initScript [file join $dir {@TEAISH_PKGINIT_TCL_TAIL@}] if {[file exists $initScript]} { source -encoding utf-8 $initScript } @endif }} $dir] } else { - package ifneeded @TEAISH_PKGNAME@ @TEAISH_VERSION@ [list apply {{dir} { - if {[string tolower [file extension @TEAISH_DLL8@]] in [list .dll .dylib .so]} { - load [file join $dir @TEAISH_DLL8@] @TEAISH_LOAD_PREFIX@ + package ifneeded {@TEAISH_PKGNAME@} {@TEAISH_VERSION@} [list apply {{dir} { + if {[string tolower [file extension {@TEAISH_DLL8@}]] in [list .dll .dylib .so]} { + load [file join $dir {@TEAISH_DLL8@}] @TEAISH_LOAD_PREFIX@ } else { load {} @TEAISH_LOAD_PREFIX@ } @if TEAISH_PKGINIT_TCL_TAIL - set initScript [file join $dir @TEAISH_PKGINIT_TCL_TAIL@] + set initScript [file join $dir {@TEAISH_PKGINIT_TCL_TAIL@}] if {[file exists $initScript]} { source -encoding utf-8 $initScript } diff --git a/autoconf/tea/teaish.tcl b/autoconf/tea/teaish.tcl index 7d8490edf8..eedd9bdaf4 100644 --- a/autoconf/tea/teaish.tcl +++ b/autoconf/tea/teaish.tcl @@ -1,13 +1,16 @@ # Teaish configure script for the SQLite TCL extension -define TEAISH_NAME sqlite; # name used in dist tarballs and as the libdir prefix -define TEAISH_PKGNAME sqlite3; # name for purposes of Tcl_PkgProvide() -define TEAISH_LOAD_PREFIX Sqlite3; # 2nd arg to [load] -define TEAISH_VSATISFIES_TCL 8.6-; # builds with 8.5 but some tests fail -define TEAISH_VERSION [proj-file-content -trim [get-define TEAISH_DIR]/../VERSION] -proj-assert {[string match 3.*.* [get-define TEAISH_VERSION]]} -define TEAISH_LIBDIR_NAME \ - [join [list [get-define TEAISH_NAME] [get-define TEAISH_VERSION]] ""] +apply {{} { + set version [proj-file-content -trim [get-define TEAISH_DIR]/../VERSION] + proj-assert {[string match 3.*.* $version]} + teaish-pkginfo-set \ + -name sqlite \ + -pkgName sqlite3 \ + -version $version \ + -loadPrefix Sqlite3 \ + -vsatisfies 8.6- \ + -libDir sqlite$version +}} # # Object for communicating certain config-time state across various @@ -70,14 +73,14 @@ proc teaish-configure {} { use teaish/feature-tests set srcdir [get-define TEAISH_DIR] - teaish-add-src -dist -dir generic/tclsqlite3.c - teaish-add-cflags -I${srcdir}/.. ; # for sqlite3.[ch] + teaish-src-add -dist -dir generic/tclsqlite3.c + teaish-cflags-add -I${srcdir}/.. if {[proj-opt-was-provided override-sqlite-version]} { - define TEAISH_VERSION [opt-val override-sqlite-version] - proj-warn "overriding sqlite version number: [get-define TEAISH_VERSION]" + teaish-pkginfo-set -version [opt-val override-sqlite-version] + proj-warn "overriding sqlite version number:" [teaish-pkginfo-get -version] } elseif {[proj-opt-was-provided with-system-sqlite] && [opt-val with-system-sqlite] ne "0"} { - proj-fatal "when using --with-system-sqlite also use"\ + proj-fatal "when using --with-system-sqlite also use" \ "--override-sqlite-version to specify a library version number." } @@ -98,8 +101,8 @@ proc teaish-configure {} { if {[opt-bool with-system-sqlite]} { msg-result "Using system-level sqlite3." - teaish-add-cflags -DUSE_SYSTEM_SQLITE - teaish-add-ldflags -lsqlite3 + teaish-cflags-add -DUSE_SYSTEM_SQLITE + teaish-ldflags-add -lsqlite3 } teaish-check-librt @@ -141,7 +144,7 @@ proc sqlite-affirm-have-math {featureName} { user-notice "Forcing requirement of $lfl for $featureName" } define LDFLAGS_MATH $lfl - teaish-prepend-ldflags $lfl + teaish-ldflags-prepend $lfl } } @@ -230,7 +233,7 @@ proc sqlite-handle-common-feature-flags {} { if {[lsearch [get-define TARGET_DEBUG ""] -DSQLITE_DEBUG=1] > -1} { msg-result "Note: this is a debug build, so performance will suffer." } - teaish-add-cflags -define OPT_FEATURE_FLAGS + teaish-cflags-add -define OPT_FEATURE_FLAGS }; # sqlite-handle-common-feature-flags ######################################################################## @@ -252,7 +255,7 @@ proc sqlite-handle-threadsafe {} { incr enable set ldf [get-define lib_pthread_create] define LDFLAGS_PTHREAD $ldf - teaish-prepend-ldflags $ldf + teaish-ldflags-prepend $ldf undefine lib_pthread_create undefine lib_pthread_mutexattr_init } elseif {[proj-opt-was-provided threadsafe]} { @@ -314,7 +317,7 @@ proc sqlite-handle-load-extension {} { if {$found} { set ldf [get-define lib_dlopen] define LDFLAGS_DLOPEN $ldf - teaish-prepend-ldflags $ldf + teaish-ldflags-prepend $ldf undefine lib_dlopen } else { if {[proj-opt-was-provided load-extension]} { @@ -433,8 +436,8 @@ proc sqlite-handle-icu {} { msg-result "Enabling ICU collations." sqlite-add-feature-flag -DSQLITE_ENABLE_ICU_COLLATIONS } - teaish-prepend-ldflags $ldflags - teaish-add-cflags $cflags + teaish-ldflags-prepend $ldflags + teaish-cflags-add $cflags } elseif {[opt-bool icu-collations]} { proj-warn "ignoring --enable-icu-collations because neither --with-icu-ldflags nor --with-icu-config provided any linker flags" } else { @@ -478,7 +481,7 @@ proc sqlite-handle-math {} { set lfl [get-define lib_ceil] undefine lib_ceil define LDFLAGS_MATH $lfl - teaish-prepend-ldflags $lfl + teaish-ldflags-prepend $lfl sqlite-add-feature-flag -DSQLITE_ENABLE_MATH_FUNCTIONS msg-result "Enabling math SQL functions" } { diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl index d4fcdc590f..2e272a3b52 100644 --- a/autosetup/proj.tcl +++ b/autosetup/proj.tcl @@ -54,9 +54,10 @@ # ----- @module proj.tcl ----- # @section Project Helper APIs -######################################################################## +# # $proj__Config is an internal-use-only array for storing whatever generic # internal stuff we need stored. +# array set proj__Config { self-tests 0 } @@ -74,18 +75,19 @@ array set proj__Config { set proj__Config(dot-in-files) [list] set proj__Config(isatty) [isatty? stdout] -######################################################################## +# # @proj-warn msg # # Emits a warning message to stderr. All args are appended with a # space between each. +# proc proj-warn {args} { show-notices puts stderr [join [list "WARNING:" {*}$args] " "] } -######################################################################## -# @proj-error ?-up...? msg +# +# @proj-fatal ?-up...? msg... # # Emits an error message to stderr and exits with non-0. All args are # appended with a space between each. @@ -93,6 +95,7 @@ proc proj-warn {args} { # The calling scope's name is used in the error message. To instead # use the name of a call higher up in the stack, use -up once for each # additional level. +# proc proj-fatal {args} { show-notices set lvl 1 @@ -100,17 +103,33 @@ proc proj-fatal {args} { set args [lassign $args -] incr lvl } - puts stderr [join [list "ERROR: \[[proj-current-scope $lvl]]:" {*}$args] " "] + puts stderr [join [list "FATAL: \[[proj-current-scope $lvl]]: " {*}$args]] exit 1 } -######################################################################## +# +# @proj-error ?-up...? msg... +# +# Works like prop-fatal but uses [error] intead of [exit]. +# +proc proj-error {args} { + show-notices + set lvl 1 + while {"-up" eq [lindex $args 0]} { + set args [lassign $args -] + incr lvl + } + error [join [list "\[[proj-current-scope $lvl]]:" {*}$args]] +} + +# # @proj-assert script ?message? # # Kind of like a C assert: if uplevel (eval) of [expr {$script}] is # false, a fatal error is triggered. The error message, by default, # includes the body of the failed assertion, but if $msg is set then # that is used instead. +# proc proj-assert {script {msg ""}} { if {1 == [get-env proj-assert 0]} { msg-result [proj-bold "asserting: $script"] @@ -124,12 +143,13 @@ proc proj-assert {script {msg ""}} { } } -######################################################################## +# # @proj-bold str # # If this function believes that the current console might support # ANSI escape sequences then this returns $str wrapped in a sequence # to bold that text, else it returns $str as-is. +# proc proj-bold {args} { if {$::autosetup(iswin) || !$::proj__Config(isatty)} { return [join $args] @@ -137,7 +157,7 @@ proc proj-bold {args} { return "\033\[1m${args}\033\[0m" } -######################################################################## +# # @proj-indented-notice ?-error? ?-notice? msg # # Takes a multi-line message and emits it with consistent indentation. @@ -152,6 +172,7 @@ proc proj-bold {args} { # # If neither -notice nor -error are used, the message will be sent to # stdout without delay. +# proc proj-indented-notice {args} { set fErr "" set outFunc "puts" @@ -185,15 +206,16 @@ proc proj-indented-notice {args} { } } -######################################################################## +# # @proj-is-cross-compiling # # Returns 1 if cross-compiling, else 0. +# proc proj-is-cross-compiling {} { return [expr {[get-define host] ne [get-define build]}] } -######################################################################## +# # @proj-strip-hash-comments value # # Expects to receive string input, which it splits on newlines, strips @@ -201,6 +223,7 @@ proc proj-is-cross-compiling {} { # a '#', and returns a value containing the [append]ed results of each # remaining line with a \n between each. It does not strip out # comments which appear after the first non-whitespace character. +# proc proj-strip-hash-comments {val} { set x {} foreach line [split $val \n] { @@ -211,12 +234,13 @@ proc proj-strip-hash-comments {val} { return $x } -######################################################################## +# # @proj-cflags-without-werror # # Fetches [define $var], strips out any -Werror entries, and returns # the new value. This is intended for temporarily stripping -Werror # from CFLAGS or CPPFLAGS within the scope of a [define-push] block. +# proc proj-cflags-without-werror {{var CFLAGS}} { set rv {} foreach f [get-define $var ""] { @@ -228,7 +252,7 @@ proc proj-cflags-without-werror {{var CFLAGS}} { return [join $rv " "] } -######################################################################## +# # @proj-check-function-in-lib # # A proxy for cc-check-function-in-lib with the following differences: @@ -241,6 +265,7 @@ proc proj-cflags-without-werror {{var CFLAGS}} { # Returns the result of cc-check-function-in-lib (i.e. true or false). # The resulting linker flags are stored in the [define] named # lib_${function}. +# proc proj-check-function-in-lib {function libs {otherlibs {}}} { set found 0 define-push {LIBS CFLAGS} { @@ -252,13 +277,14 @@ proc proj-check-function-in-lib {function libs {otherlibs {}}} { return $found } -######################################################################## +# # @proj-search-for-header-dir ?-dirs LIST? ?-subdirs LIST? header # # Searches for $header in a combination of dirs and subdirs, specified # by the -dirs {LIST} and -subdirs {LIST} flags (each of which have # sane defaults). Returns either the first matching dir or an empty # string. The return value does not contain the filename part. +# proc proj-search-for-header-dir {header args} { set subdirs {include} set dirs {/usr /usr/local /mingw} @@ -285,7 +311,7 @@ proc proj-search-for-header-dir {header args} { return "" } -######################################################################## +# # @proj-find-executable-path ?-v? binaryName # # Works similarly to autosetup's [find-executable-path $binName] but: @@ -293,6 +319,7 @@ proc proj-search-for-header-dir {header args} { # - If the first arg is -v, it's verbose about searching, else it's quiet. # # Returns the full path to the result or an empty string. +# proc proj-find-executable-path {args} { set binName $args set verbose 0 @@ -312,7 +339,7 @@ proc proj-find-executable-path {args} { return $check } -######################################################################## +# # @proj-bin-define binName ?defName? # # Uses [proj-find-executable-path $binName] to (verbosely) search for @@ -322,6 +349,7 @@ proc proj-find-executable-path {args} { # The define'd name is: If $defName is not empty, it is used as-is. If # $defName is empty then "BIN_X" is used, where X is the upper-case # form of $binName with any '-' characters replaced with '_'. +# proc proj-bin-define {binName {defName {}}} { set check [proj-find-executable-path -v $binName] if {"" eq $defName} { @@ -331,7 +359,7 @@ proc proj-bin-define {binName {defName {}}} { return $check } -######################################################################## +# # @proj-first-bin-of bin... # # Looks for the first binary found of the names passed to this @@ -342,6 +370,7 @@ proc proj-bin-define {binName {defName {}}} { # any define'd name that function stores for the result (because the # caller has no sensible way of knowing which result it was unless # they pass only a single argument). +# proc proj-first-bin-of {args} { set rc "" foreach b $args { @@ -356,7 +385,7 @@ proc proj-first-bin-of {args} { return $rc } -######################################################################## +# # @proj-opt-was-provided key # # Returns 1 if the user specifically provided the given configure flag @@ -384,17 +413,19 @@ proc proj-first-bin-of {args} { # that new options set via that function will cause this function to # return true. (That's an unintended and unavoidable side-effect, not # specifically a feature which should be made use of.) +# proc proj-opt-was-provided {key} { dict exists $::autosetup(optset) $key } -######################################################################## +# # @proj-opt-set flag ?val? # # Force-set autosetup option $flag to $val. The value can be fetched # later with [opt-val], [opt-bool], and friends. # # Returns $val. +# proc proj-opt-set {flag {val 1}} { if {$flag ni $::autosetup(options)} { # We have to add this to autosetup(options) or else future calls @@ -405,29 +436,32 @@ proc proj-opt-set {flag {val 1}} { return $val } -######################################################################## +# # @proj-opt-exists flag # # Returns 1 if the given flag has been defined as a legal configure # option, else returns 0. +# proc proj-opt-exists {flag} { expr {$flag in $::autosetup(options)}; } -######################################################################## +# # @proj-val-truthy val # # Returns 1 if $val appears to be a truthy value, else returns # 0. Truthy values are any of {1 on true yes enabled} +# proc proj-val-truthy {val} { expr {$val in {1 on true yes enabled}} } -######################################################################## +# # @proj-opt-truthy flag # # Returns 1 if [opt-val $flag] appears to be a truthy value or # [opt-bool $flag] is true. See proj-val-truthy. +# proc proj-opt-truthy {flag} { if {[proj-val-truthy [opt-val $flag]]} { return 1 } set rc 0 @@ -438,10 +472,11 @@ proc proj-opt-truthy {flag} { return $rc } -######################################################################## +# # @proj-if-opt-truthy boolFlag thenScript ?elseScript? # # If [proj-opt-truthy $flag] is true, eval $then, else eval $else. +# proc proj-if-opt-truthy {boolFlag thenScript {elseScript {}}} { if {[proj-opt-truthy $boolFlag]} { uplevel 1 $thenScript @@ -450,13 +485,14 @@ proc proj-if-opt-truthy {boolFlag thenScript {elseScript {}}} { } } -######################################################################## +# # @proj-define-for-opt flag def ?msg? ?iftrue? ?iffalse? # # If [proj-opt-truthy $flag] then [define $def $iftrue] else [define # $def $iffalse]. If $msg is not empty, output [msg-checking $msg] and # a [msg-results ...] which corresponds to the result. Returns 1 if # the opt-truthy check passes, else 0. +# proc proj-define-for-opt {flag def {msg ""} {iftrue 1} {iffalse 0}} { if {"" ne $msg} { msg-checking "$msg " @@ -479,7 +515,7 @@ proc proj-define-for-opt {flag def {msg ""} {iftrue 1} {iffalse 0}} { return $rc } -######################################################################## +# # @proj-opt-define-bool ?-v? optName defName ?descr? # # Checks [proj-opt-truthy $optName] and calls [define $defName X] @@ -489,6 +525,7 @@ proc proj-define-for-opt {flag def {msg ""} {iftrue 1} {iffalse 0}} { # If args[0] is -v then the boolean semantics are inverted: if # the option is set, it gets define'd to 0, else 1. Returns the # define'd value. +# proc proj-opt-define-bool {args} { set invert 0 if {[lindex $args 0] eq "-v"} { @@ -517,7 +554,7 @@ proc proj-opt-define-bool {args} { return $rc } -######################################################################## +# # @proj-check-module-loader # # Check for module-loading APIs (libdl/libltdl)... @@ -537,6 +574,7 @@ proc proj-opt-define-bool {args} { # # Note that if it finds LIBLTDL it does not look for LIBDL, so will # report only that is has LIBLTDL. +# proc proj-check-module-loader {} { msg-checking "Looking for module-loader APIs... " if {99 ne [get-define LDFLAGS_MODULE_LOADER 99]} { @@ -582,25 +620,27 @@ proc proj-check-module-loader {} { return $rc } -######################################################################## +# # @proj-no-check-module-loader # # Sets all flags which would be set by proj-check-module-loader to # empty/falsy values, as if those checks had failed to find a module # loader. Intended to be called in place of that function when # a module loader is explicitly not desired. +# proc proj-no-check-module-loader {} { define HAVE_LIBDL 0 define HAVE_LIBLTDL 0 define LDFLAGS_MODULE_LOADER "" } -######################################################################## +# # @proj-file-conent ?-trim? filename # # Opens the given file, reads all of its content, and returns it. If # the first arg is -trim, the contents of the file named by the second # argument are trimmed before returning them. +# proc proj-file-content {args} { set trim 0 set fname $args @@ -615,11 +655,12 @@ proc proj-file-content {args} { return $rc } -######################################################################## +# # @proj-file-conent filename # # Returns the contents of the given file as an array of lines, with # the EOL stripped from each input line. +# proc proj-file-content-list {fname} { set fp [open $fname rb] set rc {} @@ -630,12 +671,13 @@ proc proj-file-content-list {fname} { return $rc } -######################################################################## +# # @proj-file-write ?-ro? fname content # # Works like autosetup's [writefile] but explicitly uses binary mode # to avoid EOL translation on Windows. If $fname already exists, it is # overwritten, even if it's flagged as read-only. +# proc proj-file-write {args} { if {"-ro" eq [lindex $args 0]} { lassign $args ro fname content @@ -655,7 +697,7 @@ proc proj-file-write {args} { } } -######################################################################## +# # @proj-check-compile-commands ?configFlag? # # Checks the compiler for compile_commands.json support. If passed an @@ -669,6 +711,7 @@ proc proj-file-write {args} { # # ACHTUNG: this test has a long history of false positive results # because of compilers reacting differently to the -MJ flag. +# proc proj-check-compile-commands {{configFlag {}}} { msg-checking "compile_commands.json support... " if {"" ne $configFlag && ![proj-opt-truthy $configFlag]} { @@ -693,16 +736,17 @@ proc proj-check-compile-commands {{configFlag {}}} { } } -######################################################################## +# # @proj-touch filename # # Runs the 'touch' external command on one or more files, ignoring any # errors. +# proc proj-touch {filename} { catch { exec touch {*}$filename } } -######################################################################## +# # @proj-make-from-dot-in ?-touch? infile ?outfile? # # Uses [make-template] to create makefile(-like) file(s) $outfile from @@ -723,6 +767,7 @@ proc proj-touch {filename} { # please the build process. # # Failures when running chmod or touch are silently ignored. +# proc proj-make-from-dot-in {args} { set fIn "" set fOut "" @@ -755,7 +800,7 @@ proc proj-make-from-dot-in {args} { } } -######################################################################## +# # @proj-check-profile-flag ?flagname? # # Checks for the boolean configure option named by $flagname. If set, @@ -768,6 +813,7 @@ proc proj-make-from-dot-in {args} { # order to avoid potential problems with escaping, space-containing # tokens, and interfering with autosetup's use of these vars, this # routine does not directly modify CFLAGS or LDFLAGS. +# proc proj-check-profile-flag {{flagname profile}} { #puts "flagname=$flagname ?[proj-opt-truthy $flagname]?" if {[proj-opt-truthy $flagname]} { @@ -787,7 +833,7 @@ proc proj-check-profile-flag {{flagname profile}} { return 0 } -######################################################################## +# # @proj-looks-like-windows ?key? # # Returns 1 if this appears to be a Windows environment (MinGw, @@ -798,6 +844,7 @@ proc proj-check-profile-flag {{flagname profile}} { # machine, i.e. the local host). If $key == "build" then some # additional checks may be performed which are not applicable when # $key == "host". +# proc proj-looks-like-windows {{key host}} { global autosetup switch -glob -- [get-define $key] { @@ -816,13 +863,14 @@ proc proj-looks-like-windows {{key host}} { return 0 } -######################################################################## +# # @proj-looks-like-mac ?key? # # Looks at either the 'host' (==compilation target platform) or # 'build' (==the being-built-on platform) define value and returns if # if that value seems to indicate that it represents a Mac platform, # else returns 0. +# proc proj-looks-like-mac {{key host}} { switch -glob -- [get-define $key] { *apple* { @@ -834,7 +882,7 @@ proc proj-looks-like-mac {{key host}} { } } -######################################################################## +# # @proj-exe-extension # # Checks autosetup's "host" and "build" defines to see if the build @@ -842,6 +890,7 @@ proc proj-looks-like-mac {{key host}} { # build environment is then BUILD_EXEEXT is [define]'d to ".exe", else # "". If the target, a.k.a. "host", is then TARGET_EXEEXT is # [define]'d to ".exe", else "". +# proc proj-exe-extension {} { set rH "" set rB "" @@ -855,7 +904,7 @@ proc proj-exe-extension {} { define TARGET_EXEEXT $rH } -######################################################################## +# # @proj-dll-extension # # Works like proj-exe-extension except that it defines BUILD_DLLEXT @@ -863,6 +912,7 @@ proc proj-exe-extension {} { # # Trivia: for .dylib files, the linker needs the -dynamiclib flag # instead of -shared. +# proc proj-dll-extension {} { set inner {{key} { switch -glob -- [get-define $key] { @@ -881,12 +931,13 @@ proc proj-dll-extension {} { define TARGET_DLLEXT [apply $inner host] } -######################################################################## +# # @proj-lib-extension # # Static-library counterpart of proj-dll-extension. Defines # BUILD_LIBEXT and TARGET_LIBEXT to the conventional static library # extension for the being-built-on resp. the target platform. +# proc proj-lib-extension {} { set inner {{key} { switch -glob -- [get-define $key] { @@ -904,23 +955,25 @@ proc proj-lib-extension {} { define TARGET_LIBEXT [apply $inner host] } -######################################################################## +# # @proj-file-extensions # # Calls all of the proj-*-extension functions. +# proc proj-file-extensions {} { proj-exe-extension proj-dll-extension proj-lib-extension } -######################################################################## +# # @proj-affirm-files-exist ?-v? filename... # # Expects a list of file names. If any one of them does not exist in # the filesystem, it fails fatally with an informative message. # Returns the last file name it checks. If the first argument is -v # then it emits msg-checking/msg-result messages for each file. +# proc proj-affirm-files-exist {args} { set rc "" set verbose 0 @@ -939,7 +992,7 @@ proc proj-affirm-files-exist {args} { return rc } -######################################################################## +# # @proj-check-emsdk # # Emscripten is used for doing in-tree builds of web-based WASM stuff, @@ -971,6 +1024,7 @@ proc proj-affirm-files-exist {args} { # but BIN_EMCC is then emcc was not found in the EMSDK_HOME, in which # case we have to rely on the fact that sourcing $EMSDK_ENV_SH from a # shell will add emcc to the $PATH. +# proc proj-check-emsdk {} { set emsdkHome [opt-val with-emsdk] define EMSDK_HOME "" @@ -1008,7 +1062,7 @@ proc proj-check-emsdk {} { return $rc } -######################################################################## +# # @proj-cc-check-Wl-flag ?flag ?args?? # # Checks whether the given linker flag (and optional arguments) can be @@ -1019,6 +1073,7 @@ proc proj-check-emsdk {} { # # If so, that flag string is returned, else an empty string is # returned. +# proc proj-cc-check-Wl-flag {args} { cc-with {-link 1} { # Try -Wl,flag,...args @@ -1037,7 +1092,7 @@ proc proj-cc-check-Wl-flag {args} { } } -######################################################################## +# # @proj-check-rpath # # Tries various approaches to handling the -rpath link-time @@ -1048,6 +1103,7 @@ proc proj-cc-check-Wl-flag {args} { # --exec-prefix=... or --libdir=... are explicitly passed to # configure then [get-define libdir] is used (noting that it derives # from exec-prefix by default). +# proc proj-check-rpath {} { if {[proj-opt-was-provided libdir] || [proj-opt-was-provided exec-prefix]} { @@ -1073,7 +1129,7 @@ proc proj-check-rpath {} { expr {"" ne [get-define LDFLAGS_RPATH]} } -######################################################################## +# # @proj-check-soname ?libname? # # Checks whether CC supports the -Wl,soname,lib... flag. If so, it @@ -1086,6 +1142,7 @@ proc proj-check-rpath {} { # LDFLAGS_SONAME_PREFIX. It is provided so that clients may # potentially avoid some end-user confusion by using their own lib's # name here (which shows up in the "checking..." output). +# proc proj-check-soname {{libname "libfoo.so.0"}} { cc-with {-link 1} { if {[cc-check-flags "-Wl,-soname,${libname}"]} { @@ -1098,7 +1155,7 @@ proc proj-check-soname {{libname "libfoo.so.0"}} { } } -######################################################################## +# # @proj-check-fsanitize ?list-of-opts? # # Checks whether CC supports -fsanitize=X, where X is each entry of @@ -1113,6 +1170,7 @@ proc proj-check-soname {{libname "libfoo.so.0"}} { # # Will, on many systems, resolve to "-fsanitize=address,bounds-check", # but may also resolve to "-fsanitize=address". +# proc proj-check-fsanitize {{opts {address bounds-strict}}} { set sup {} foreach opt $opts { @@ -1131,12 +1189,13 @@ proc proj-check-fsanitize {{opts {address bounds-strict}}} { return "" } -######################################################################## +# # Internal helper for proj-dump-defs-json. Expects to be passed a # [define] name and the variadic $args which are passed to # proj-dump-defs-json. If it finds a pattern match for the given # $name in the various $args, it returns the type flag for that $name, # e.g. "-str" or "-bare", else returns an empty string. +# proc proj-defs-type_ {name spec} { foreach {type patterns} $spec { foreach pattern $patterns { @@ -1148,20 +1207,22 @@ proc proj-defs-type_ {name spec} { return "" } -######################################################################## +# # Internal helper for proj-defs-format_: returns a JSON-ish quoted # form of the given string-type values. It only performs the most # basic of escaping. The input must not contain any control # characters. +# proc proj-quote-str_ {value} { return \"[string map [list \\ \\\\ \" \\\"] $value]\" } -######################################################################## +# # An internal impl detail of proj-dump-defs-json. Requires a data # type specifier, as used by make-config-header, and a value. Returns # the formatted value or the value $::proj__Config(defs-skip) if the caller # should skip emitting that value. +# set proj__Config(defs-skip) "-proj-defs-format_ sentinel" proc proj-defs-format_ {type value} { switch -exact -- $type { @@ -1200,7 +1261,7 @@ proc proj-defs-format_ {type value} { return $value } -######################################################################## +# # This function works almost identically to autosetup's # make-config-header but emits its output in JSON form. It is not a # fully-functional JSON emitter, and will emit broken JSON for @@ -1230,6 +1291,7 @@ proc proj-defs-format_ {type value} { # Neither is especially satisfactory (and the second is useless), and # handling of such values is subject to change if any such values ever # _really_ need to be processed by our source trees. +# proc proj-dump-defs-json {file args} { file mkdir [file dirname $file] set lines {} @@ -1248,7 +1310,7 @@ proc proj-dump-defs-json {file args} { } } -######################################################################## +# # @proj-xfer-option-aliases map # # Expects a list of pairs of configure flags which have been @@ -1283,6 +1345,7 @@ proc proj-dump-defs-json {file args} { # requires that the caller know all possible aliases. It's simpler, in # terms of options handling, if there's only a single canonical name # which each down-stream call of [opt-...] has to know. +# proc proj-xfer-options-aliases {mapping} { foreach {hidden - canonical} [proj-strip-hash-comments $mapping] { if {[proj-opt-was-provided $hidden]} { @@ -1295,7 +1358,7 @@ proc proj-xfer-options-aliases {mapping} { } } -######################################################################## +# # Arguable/debatable... # # When _not_ cross-compiling and CC_FOR_BUILD is _not_ explicitly @@ -1311,6 +1374,7 @@ proc proj-xfer-options-aliases {mapping} { # Sidebar: if we do this before the cc package is installed, it gets # reverted by that package. Ergo, the cc package init will tell the # user "Build C compiler...cc" shortly before we tell them otherwise. +# proc proj-redefine-cc-for-build {} { if {![proj-is-cross-compiling] && [get-define CC] ne [get-define CC_FOR_BUILD] @@ -1320,13 +1384,14 @@ proc proj-redefine-cc-for-build {} { } } -######################################################################## +# # @proj-which-linenoise headerFile # # Attempts to determine whether the given linenoise header file is of # the "antirez" or "msteveb" flavor. It returns 2 for msteveb, else 1 # (it does not validate that the header otherwise contains the # linenoise API). +# proc proj-which-linenoise {dotH} { set srcHeader [proj-file-content $dotH] if {[string match *userdata* $srcHeader]} { @@ -1336,7 +1401,7 @@ proc proj-which-linenoise {dotH} { } } -######################################################################## +# # @proj-remap-autoconf-dir-vars # # "Re-map" the autoconf-conventional --XYZdir flags into something @@ -1373,6 +1438,7 @@ proc proj-which-linenoise {dotH} { # post-processing, libdir would be cemented in as FOO/lib at # configure-time, so could be tedious to override properly via a make # invocation. +# proc proj-remap-autoconf-dir-vars {} { set prefix [get-define prefix] set exec_prefix [get-define exec_prefix $prefix] @@ -1406,13 +1472,14 @@ proc proj-remap-autoconf-dir-vars {} { } } -######################################################################## +# # @proj-env-file flag ?default? # # If a file named .env-$flag exists, this function returns a # trimmed copy of its contents, else it returns $dflt. The intended # usage is that things like developer-specific CFLAGS preferences can # be stored in .env-CFLAGS. +# proc proj-env-file {flag {dflt ""}} { set fn ".env-${flag}" if {[file readable $fn]} { @@ -1421,7 +1488,7 @@ proc proj-env-file {flag {dflt ""}} { return $dflt } -######################################################################## +# # @proj-get-env var ?default? # # Extracts the value of "environment" variable $var from the first of @@ -1432,11 +1499,12 @@ proc proj-env-file {flag {dflt ""}} { # - A file named .env-$var (see [proj-env-file]) # # If none of those are set, $dflt is returned. +# proc proj-get-env {var {dflt ""}} { return [get-env $var [proj-env-file $var $dflt]] } -######################################################################## +# # @proj-current-scope ?lvl? # # Returns the name of the _calling_ proc from ($lvl + 1) levels up the @@ -1444,6 +1512,7 @@ proc proj-get-env {var {dflt ""}} { # call). If $lvl would resolve to global scope "global scope" is # returned and if it would be negative then a string indicating such # is returned (as opposed to throwing an error). +# proc proj-current-scope {{lvl 0}} { #uplevel [expr {$lvl + 1}] {lindex [info level 0] 0} set ilvl [info level] @@ -1458,13 +1527,14 @@ proc proj-current-scope {{lvl 0}} { } -######################################################################## +# # Converts parts of tclConfig.sh to autosetup [define]s. # # Expects to be passed the name of a value tclConfig.sh or an empty # string. It converts certain parts of that file's contents to # [define]s (see the code for the whole list). If $tclConfigSh is an # empty string then it [define]s the various vars as empty strings. +# proc proj-tclConfig-sh-to-autosetup {tclConfigSh} { set shBody {} set tclVars { @@ -1511,7 +1581,7 @@ proc proj-tclConfig-sh-to-autosetup {tclConfigSh} { } } -######################################################################## +# # @proj-tweak-default-env-dirs # # This function is not useful before [use system] is called to set up @@ -1529,6 +1599,7 @@ proc proj-tclConfig-sh-to-autosetup {tclConfigSh} { # Similar modifications may be made for --mandir. # # Returns 1 if it modifies the environment, else 0. +# proc proj-tweak-default-env-dirs {} { set rc 0 switch -glob -- [get-define host] { @@ -1550,7 +1621,7 @@ proc proj-tweak-default-env-dirs {} { return $rc } -######################################################################## +# # @proj-dot-ins-append file ?fileOut ?postProcessScript?? # # Queues up an autosetup [make-template]-style file to be processed @@ -1569,6 +1640,7 @@ proc proj-tweak-default-env-dirs {} { # executable or perform validation on its contents. # # See [proj-dot-ins-process], [proj-dot-ins-list] +# proc proj-dot-ins-append {fileIn args} { set srcdir $::autosetup(srcdir) switch -exact -- [llength $args] { @@ -1589,17 +1661,18 @@ proc proj-dot-ins-append {fileIn args} { lappend ::proj__Config(dot-in-files) $fileIn } -######################################################################## +# # @proj-dot-ins-list # # Returns the current list of [proj-dot-ins-append]'d files, noting # that each entry is a 3-element list of (inputFileName, # outputFileName, postProcessScript). +# proc proj-dot-ins-list {} { return $::proj__Config(dot-in-files) } -######################################################################## +# # @proj-dot-ins-process ?-touch? ?-validate? ?-clear? # # Each file which has previously been passed to [proj-dot-ins-append] @@ -1620,6 +1693,7 @@ proc proj-dot-ins-list {} { # # -clear: after processing, empty the dot-ins list. This effectively # makes proj-dot-ins-append available for re-use. +# proc proj-dot-ins-process {args} { proj-parse-simple-flags args flags { -touch "" {return "-touch"} @@ -1647,7 +1721,7 @@ proc proj-dot-ins-process {args} { } } -######################################################################## +# # @proj-validate-no-unresolved-ats filenames... # # For each filename given to it, it validates that the file has no @@ -1661,6 +1735,7 @@ proc proj-dot-ins-process {args} { # validation to fail, as it's sometimes convenient to comment out # sections during development of a configure script and its # corresponding makefile(s). +# proc proj-validate-no-unresolved-ats {args} { foreach f $args { set lnno 1 @@ -1676,12 +1751,13 @@ proc proj-validate-no-unresolved-ats {args} { } } -######################################################################## +# # @proj-first-found fileList tgtVar # # Searches $fileList for an existing file. If one is found, its name is # assigned to tgtVar and 1 is returned, else tgtVar is not modified # and 0 is returned. +# proc proj-first-file-found {fileList tgtVar} { upvar $tgtVar tgt foreach f $fileList { @@ -1693,10 +1769,11 @@ proc proj-first-file-found {fileList tgtVar} { return 0 } -######################################################################## +# # Defines $defName to contain makefile recipe commands for re-running # the configure script with its current set of $::argv flags. This # can be used to automatically reconfigure. +# proc proj-setup-autoreconfig {defName} { set squote {{arg} { # Wrap $arg in single-quotes if it looks like it might need that @@ -1713,11 +1790,12 @@ proc proj-setup-autoreconfig {defName} { } } -######################################################################## +# # @prop-append-to defineName args... # # A proxy for Autosetup's [define-append]. Appends all non-empty $args # to [define-append $defineName]. +# proc proj-define-append {defineName args} { foreach a $args { if {"" ne $a} { @@ -1726,7 +1804,7 @@ proc proj-define-append {defineName args} { } } -######################################################################## +# # @prod-define-amend ?-p|-prepend? ?-define? FLAG args... # # A proxy for Autosetup's [define-append]. @@ -1744,6 +1822,7 @@ proc proj-define-append {defineName args} { # technically correct and still relevant on some environments. # # See: proj-append-to +# proc proj-define-amend {args} { set defName "" set prepend 0 @@ -1783,6 +1862,7 @@ proc proj-define-amend {args} { } } +# # @proj-define-to-cflag ?-list? defineName... # # Treat each argument as the name of a [define] @@ -1798,6 +1878,7 @@ proc proj-define-amend {args} { # By default it returns the result as string of all -D... flags, # but if passed the -list flag it will return a list of the # individual CFLAGS. +# proc proj-define-to-cflag {args} { set rv {} set xargs {} @@ -1878,6 +1959,7 @@ if {0} { # Internal cache for use via proj-cache-*. array set proj__Cache {} +# # @proj-cache-key ?addLevel? arg # # Helper to generate cache keys for [proj-cache-*]. @@ -1901,6 +1983,7 @@ proc proj-cache-key {{addLevel 0} arg} { return $arg } +# # @proj-cache-set ?key? ?addLevel? value # # Sets a feature-check cache entry with the given key. @@ -1913,6 +1996,7 @@ proc proj-cache-set {{key 0} {addLevel 0} val} { set ::proj__Cache($key) $val } +# # @proj-cache-remove ?key? ?addLevel? # # Removes an entry from the proj-cache. @@ -1926,6 +2010,7 @@ proc proj-cache-remove {{key 0} {addLevel 0}} { return $rv; } +# # @proj-cache-check ?$key? ?addLevel? tgtVarName # # Checks for a feature-check cache entry with the given key. @@ -1950,6 +2035,7 @@ proc proj-cache-check {{key 0} {addLevel 0} tgtVar} { return $rc } +# # @proj-coalesce ...args # # Returns the first argument which is not empty (eq ""), or an empty @@ -1963,6 +2049,7 @@ proc proj-coalesce {args} { return "" } +# # @proj-parse-simple-flags ... # # An experiment. Do not use. @@ -2064,7 +2151,7 @@ proc proj-parse-simple-flags {argvName tgtArrayName prototype} { set rv {} set skipMode 0 set n [llength $argv] - for {set i 0} {$i < $n} {} { + for {set i 0} {$i < $n} {incr i} { set arg [lindex $argv $i] if {$skipMode} { lappend rv $arg @@ -2080,12 +2167,12 @@ proc proj-parse-simple-flags {argvName tgtArrayName prototype} { set tgt($arg) "" } else { #puts "**** running scripts($arg) $scripts($arg)" - set code [catch {uplevel 1 $scripts($arg)} rc xopt] + set code [catch {uplevel 1 $scripts($arg)} xrc xopt] #puts "**** tgt($arg)=$scripts($arg) code=$code rc=$rc" if {$code in {0 2}} { - set tgt($arg) $rc + set tgt($arg) $xrc } else { - return {*}$xopt $rc + return {*}$xopt $xrc } } incr rc @@ -2093,7 +2180,6 @@ proc proj-parse-simple-flags {argvName tgtArrayName prototype} { incr skipMode lappend rv $arg } - incr i } set argv $rv return $rc diff --git a/manifest b/manifest index a2ce1a6072..2a8589e62e 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C When\slogging\serrors\susing\ssqlite3_log()\sand\sthe\serror\stext\sincludes\sthe\ntext\sof\san\sSQL\sstatement,\sbut\sthe\sSQL\sstatement\stext\sat\sthe\send\sso\sthat\sif\nthe\serror\smessage\sbuffer\soverflows\sit\sis\sthe\sSQL\sstatement\stext\sthat\sgets\ntruncated,\snot\sthe\sstatement\sof\sthe\sproblem. -D 2025-04-17T19:01:54.977 +C Upstream\steaish,\swhich\ssimplifies\show\sextension\smetadata\sare\sinitialized\sand\sshrinks\sproj.tcl\sby\s4k. +D 2025-04-17T19:41:37.075 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -22,18 +22,18 @@ F autoconf/Makefile.msc 5bc67d3912444c40c6f96d003e5c90663e51abb83d204a520110b1b2 F autoconf/README.first f1d3876e9a7852c22f275a6f06814e64934cecbc0b5b9617d64849094c1fd136 F autoconf/README.txt b749816b8452b3af994dc6d607394bef3df1736d7e09359f1087de8439a52807 F autoconf/auto.def 3d994f3a9cc9b712dbce92a5708570ddcf3b988141b6eb738f2ed16127a9f0ac -F autoconf/tea/Makefile.in 2f716371a21f2d2ad1244c932f9ba12c083c9b4bd066590a51cb20c08f8b7ca6 +F autoconf/tea/Makefile.in 41159d167c3b1a9bab7253f268d1ad1dc71ab8a9a6ccc9744a313aba40249a6a F autoconf/tea/README.txt 656d4686c509d375f5988ff3deda94f65fe6cd8358cd55d1f1dcc7b6e2ff73aa F autoconf/tea/auto.def 81e2617cfb90d53c19b53b3ec632cd2893bf32f2e5dd272b1116fadf2ea86c2d F autoconf/tea/autosetup/README.txt b40071e6f8506500a2f7f71d5fc69e0bf87b9d7678dd9da1e5b4d0acbf40b1ca -F autoconf/tea/autosetup/core.tcl 94b4f452606f75249aba667e4a4a577112a181112c24201856c8dbef8424f134 -F autoconf/tea/autosetup/feature-tests.tcl 3ccf2fd1cad368c7ed958a869d8b915fada7f164a6b382c7381540c4892476f8 -F autoconf/tea/autosetup/tester.tcl 610b158c12112bfcbfe3a0eb18cacaccd914241a37a7a38a7fdd73822b7b3cab +F autoconf/tea/autosetup/core.tcl dea4684df6c5765a8fa866b4a6d79c73ba413ad37bb7c70e1be3631cd9eb2831 +F autoconf/tea/autosetup/feature-tests.tcl 307cac35806817fc87bd0d92004364ee682c0e99f2ab505291500493ab6c7a5f +F autoconf/tea/autosetup/tester.tcl a201ef9e91dde182e73015d09f94a3c40dd534ce38642167ebfd5884801d1e5a F autoconf/tea/configure d0b12b984edca6030d1976375b80157ac78b5b90a5b4f0dcee39357f63f4a80b x F autoconf/tea/doc/sqlite3.n 9a97f4f717ceab73004ea412af7960625c1cb24b5c25e4ae4c8b5d8fa4300f4e F autoconf/tea/license.terms 13bd403c9610fd2b76ece0ab50c4c5eda933d523 -F autoconf/tea/pkgIndex.tcl.in dc80c325c47095f278c7b4cf0784382fa0048cde44836bbd778aea0c7e23ed1a -F autoconf/tea/teaish.tcl ee22d09a97dfcf77762942aea5b1b838a284a4a36b124064f1209e241bef6e7e +F autoconf/tea/pkgIndex.tcl.in a41b98633e184703136914e588638423047eae71244a30061ccd8edf92498436 +F autoconf/tea/teaish.tcl 2bc7ca287baa076daca513ff9342c00f499b1cceb8302a93d4a6231b00b52504 F autoconf/tea/teaish.test.tcl cfe94e1fb79dd078f650295be59843d470125e0cc3a17a1414c1fb8d77f4aea6 F autoconf/tea/teaish.tester.tcl.in 63059e35289ac663c7d0052e6c0089a309fee75225e86e4ec5b3d9f2c1d9290a F autosetup/LICENSE 41a26aebdd2cd185d1e2b210f71b7ce234496979f6b35aef2cbf6b80cbed4ce4 @@ -51,7 +51,7 @@ F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e F autosetup/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1821baf61bc86a7e F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba -F autosetup/proj.tcl 5d214dd3e9ffc7cf8dfda0b2f047c76316bbe70ad5bb0d715fee75c8676daeea +F autosetup/proj.tcl 11e46ff237ca96d07fd14fe96132f8e77fee6442d8baa2e808bbe95016583c56 F autosetup/sqlite-config.tcl bde169c42d5d5331485ae7785f5dd19ca1aa01315787e8306441c472ad4e4201 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P a64e8491c9863f890daa9f5d8f678728dc0d00bc1f3c238b50214ec545450fcf -R c7314e61baa174725a2a70881e7614ea -U drh -Z 6a2f3e45e3ea371afd4913a2a62a4053 +P de0968226effb79f9d25539da7882fa5475e4ff2410870b45a63a6545deb5979 +R ea2362589cd7cb111ab49baa9c4d20ad +U stephan +Z c20158b68dfe96121ce3497954c5dd64 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 2da6206783..0400ecc4de 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -de0968226effb79f9d25539da7882fa5475e4ff2410870b45a63a6545deb5979 +c72c00d34d70b36f847af19a2382299746448b5dd94a616f6b567389c5694c17 From f857482ed10200a6511e1c8a0f36bcf516fb2f75 Mon Sep 17 00:00:00 2001 From: drh <> Date: Fri, 18 Apr 2025 14:47:56 +0000 Subject: [PATCH 119/120] Add an appropriate _declspec to the declaration of the sqlite3_dbdata_init() function in the recovery extension. FossilOrigin-Name: 00313d15270b36fce44f7784c97ddc42517e23c209c1ccc4d814ef06b11528c0 --- ext/recover/dbdata.c | 3 +++ manifest | 14 +++++++------- manifest.uuid | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/ext/recover/dbdata.c b/ext/recover/dbdata.c index 001840b17e..225f1a9b3f 100644 --- a/ext/recover/dbdata.c +++ b/ext/recover/dbdata.c @@ -1008,6 +1008,9 @@ static int sqlite3DbdataRegister(sqlite3 *db){ return rc; } +#ifdef _WIN32 +__declspec(dllexport) +#endif int sqlite3_dbdata_init( sqlite3 *db, char **pzErrMsg, diff --git a/manifest b/manifest index 2a8589e62e..af1aeb2efa 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Upstream\steaish,\swhich\ssimplifies\show\sextension\smetadata\sare\sinitialized\sand\sshrinks\sproj.tcl\sby\s4k. -D 2025-04-17T19:41:37.075 +C Add\san\sappropriate\s_declspec\sto\sthe\sdeclaration\sof\sthe\ssqlite3_dbdata_init()\nfunction\sin\sthe\srecovery\sextension. +D 2025-04-18T14:47:56.507 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -509,7 +509,7 @@ F ext/rbu/rbuvacuum4.test ffccd22f67e2d0b380d2889685742159dfe0d19a3880ca3d2d1d69 F ext/rbu/sqlite3rbu.c c208f72f20784bf2f39244b6cdf8019724a706e1246be289e7621c42aad54695 F ext/rbu/sqlite3rbu.h e3a5bf21e09ca93ce4e8740e00d6a853e90a697968ec0ea98f40826938bdb68e F ext/rbu/test_rbu.c 8b6e64e486c28c41ef29f6f4ea6be7b3091958987812784904f5e903f6b56418 -F ext/recover/dbdata.c 5295f4f922b60d7035b6b9fd5846b13071b9d97ed7fad8496837bb7640d24771 +F ext/recover/dbdata.c 10d3c56968a9af6853722a47280805ad1564714d79ea45ac6f7da14bb57fd137 F ext/recover/recover1.test e16d78e94183562abff569967b18b7c77451d7044365516cd0fe14713a284851 F ext/recover/recover_common.tcl a61306c1eb45c0c3fc45652c35b2d4ec19729e340bdf65a272ce4c229cefd85a F ext/recover/recoverbuild.test c74170e0f7b02456af41838afeb5353fdb985a48cc2331d661bbabbca7c6b8e3 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P de0968226effb79f9d25539da7882fa5475e4ff2410870b45a63a6545deb5979 -R ea2362589cd7cb111ab49baa9c4d20ad -U stephan -Z c20158b68dfe96121ce3497954c5dd64 +P c72c00d34d70b36f847af19a2382299746448b5dd94a616f6b567389c5694c17 +R 87a340268826e4e34cb74cdf99929e58 +U drh +Z 9337bbf6f2732c8c8765cfbe21ec024f # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 0400ecc4de..ffadc39c4d 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -c72c00d34d70b36f847af19a2382299746448b5dd94a616f6b567389c5694c17 +00313d15270b36fce44f7784c97ddc42517e23c209c1ccc4d814ef06b11528c0 From c4e7cf68ceeaec85adae8e2bb9b503ffeeb89dd2 Mon Sep 17 00:00:00 2001 From: dan Date: Sat, 19 Apr 2025 20:08:04 +0000 Subject: [PATCH 120/120] Update to comments in sqlite3session.h. FossilOrigin-Name: ea9acb5573f4d71a314e4467d30477a1d01c8db648985750a42b3c047f404c9c --- ext/session/sqlite3session.h | 7 ++++--- manifest | 14 +++++++------- manifest.uuid | 2 +- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/ext/session/sqlite3session.h b/ext/session/sqlite3session.h index 3405dd064d..232c27e507 100644 --- a/ext/session/sqlite3session.h +++ b/ext/session/sqlite3session.h @@ -358,9 +358,10 @@ void sqlite3session_table_filter( ** is inserted while a session object is enabled, then later deleted while ** the same session object is disabled, no INSERT record will appear in the ** changeset, even though the delete took place while the session was disabled. -** Or, if one field of a row is updated while a session is disabled, and -** another field of the same row is updated while the session is enabled, the -** resulting changeset will contain an UPDATE change that updates both fields. +** Or, if one field of a row is updated while a session is enabled, and +** then another field of the same row is updated while the session is disabled, +** the resulting changeset will contain an UPDATE change that updates both +** fields. */ int sqlite3session_changeset( sqlite3_session *pSession, /* Session object */ diff --git a/manifest b/manifest index af1aeb2efa..ddbb92a052 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\san\sappropriate\s_declspec\sto\sthe\sdeclaration\sof\sthe\ssqlite3_dbdata_init()\nfunction\sin\sthe\srecovery\sextension. -D 2025-04-18T14:47:56.507 +C Update\sto\scomments\sin\ssqlite3session.h. +D 2025-04-19T20:08:04.182 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -618,7 +618,7 @@ F ext/session/sessionsize.test 8fcf4685993c3dbaa46a24183940ab9f5aa9ed0d23e5fb63b F ext/session/sessionstat1.test 5e718d5888c0c49bbb33a7a4f816366db85f59f6a4f97544a806421b85dc2dec F ext/session/sessionwor.test 6fd9a2256442cebde5b2284936ae9e0d54bde692d0f5fd009ecef8511f4cf3fc F ext/session/sqlite3session.c 7a8816d56940c464c74706dfb02f18129b290655df1ccb8648228a7d436141f2 -F ext/session/sqlite3session.h 532561f5b181bc623c25bfa0ecfd1f115bc9a2b42ec96fee8a67b1a10f3cc42c +F ext/session/sqlite3session.h 9b58d8f8052145bc302a72391b898f41a47d5138c8a757818bd4dc467874f5f3 F ext/session/test_session.c af162108e8dc40cb9fe0e876e0155cecabcb49e82e5939677d21451e36160283 F ext/wasm/EXPORTED_FUNCTIONS.fiddle.in 27450c8b8c70875a260aca55435ec927068b34cef801a96205adb81bdcefc65c F ext/wasm/GNUmakefile 24d7e6f446528fa67f5ade6c3c7d7e46e1ac52649d6264cbe24539c1dab608e1 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P c72c00d34d70b36f847af19a2382299746448b5dd94a616f6b567389c5694c17 -R 87a340268826e4e34cb74cdf99929e58 -U drh -Z 9337bbf6f2732c8c8765cfbe21ec024f +P 00313d15270b36fce44f7784c97ddc42517e23c209c1ccc4d814ef06b11528c0 +R 8e876785cd8a9f724c2edd8d86d424db +U dan +Z ad6897ab80a5e3b64556d94fd097e39b # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index ffadc39c4d..16310575a6 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -00313d15270b36fce44f7784c97ddc42517e23c209c1ccc4d814ef06b11528c0 +ea9acb5573f4d71a314e4467d30477a1d01c8db648985750a42b3c047f404c9c