From 0064c43a889aeb886b4ad7e3f5ef593ae68ac203 Mon Sep 17 00:00:00 2001 From: drh <> Date: Sun, 27 Oct 2024 10:48:06 +0000 Subject: [PATCH 01/15] Improvements to the PATTERN option of the "testrunner.tcl joblist" command. The pattern match is case insensitive and applies to the state and displaytype in addition to displayname. FossilOrigin-Name: 63a8f60f98115d4ee6e40de3ae775770aba76e19df6ddde68bccb7967b0200dc --- manifest | 12 ++++++------ manifest.uuid | 2 +- test/testrunner.tcl | 4 +++- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index 0803ac4932..a5433fd4b9 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Help\ssystems\sstill\susing\sTcl8.6\sto\scompile\stclsqlite.c\sby\schanging\sa\ntypedef\sinto\sa\s#define. -D 2024-10-27T10:33:47.353 +C Improvements\sto\sthe\sPATTERN\soption\sof\sthe\s"testrunner.tcl\sjoblist"\scommand.\nThe\spattern\smatch\sis\scase\sinsensitive\sand\sapplies\sto\sthe\sstate\sand\sdisplaytype\nin\saddition\sto\sdisplayname. +D 2024-10-27T10:48:06.296 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md b6e6c1baf38e4339bd3f1e0e5e5bfd0a9a93d133360691b2785c2d4b2f2dcec2 @@ -1736,7 +1736,7 @@ F test/temptable2.test 76821347810ecc88203e6ef0dd6897b6036ac788e9dd3e6b04fd4d163 F test/temptable3.test d11a0974e52b347e45ee54ef1923c91ed91e4637 F test/temptrigger.test 38f0ca479b1822d3117069e014daabcaacefffcc F test/tester.tcl 7b44f1a9b9a2de8112695b908afc21dd9a68cd2d44e84b73f1b27b53492c0d59 -F test/testrunner.tcl bc1a8d21a1aa3a5cf7c4883cbee4b6748790fe960fad06ca5db74ec914bd6525 x +F test/testrunner.tcl 4e764b0da245add9670d1010a69a3ac5474a5dfe15e1d3183294c23cca43ef13 x F test/testrunner_data.tcl ba4aeea28aa03cfa6fe7e57782ddecb7a7b91c3a0b3251583cb4f0ee002de6a6 F test/thread001.test a0985c117eab62c0c65526e9fa5d1360dd1cac5b03bde223902763274ce21899 F test/thread002.test c24c83408e35ba5a952a3638b7ac03ccdf1ce4409289c54a050ac4c5f1de7502 @@ -2237,8 +2237,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 6dfda7f5799f5a2448d3bd57fe9422de100bd8f4f9e53e97f73eeb85c3707b0f -R acfe37f64308f303e7877171f580928d +P 82ab8ff399aafa3a1faec9c85e9d6bdd26636f28f3ea22287999a868bb78db57 +R 0d75fc44cce96c36a84fecce905e5052 U drh -Z 48fd3c7997c1ca83de275f6cc35d4431 +Z 2356ac73b439e525952354a1e2e52d93 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 554a1a3270..85767773f8 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -82ab8ff399aafa3a1faec9c85e9d6bdd26636f28f3ea22287999a868bb78db57 +63a8f60f98115d4ee6e40de3ae775770aba76e19df6ddde68bccb7967b0200dc diff --git a/test/testrunner.tcl b/test/testrunner.tcl index 964465d9b2..09c9f8ac24 100755 --- a/test/testrunner.tcl +++ b/test/testrunner.tcl @@ -663,7 +663,9 @@ if {[llength $argv]>=1 set SQL {SELECT displaytype, displayname, state FROM jobs} if {$pattern!=""} { regsub -all {[^a-zA-Z0-9*.-/]} $pattern ? pattern - append SQL " WHERE displayname GLOB '*$pattern*'" + set pattern [string tolower $pattern] + append SQL \ + " WHERE lower(concat(state,' ',displaytype,' ',displayname)) GLOB '*$pattern*'" } append SQL " ORDER BY starttime" From 346f1e0ed94b0afe95c288ad1295268e48af4dc1 Mon Sep 17 00:00:00 2001 From: dan Date: Sun, 27 Oct 2024 15:58:28 +0000 Subject: [PATCH 02/15] Fix test code added by [ba358d26]. FossilOrigin-Name: b7da7980d33e2f2d5d0a4384a43eff39e1a2de4f53b8b4074eea48598a35b9d7 --- ext/fts5/fts5_tcl.c | 4 ++-- manifest | 14 +++++++------- manifest.uuid | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ext/fts5/fts5_tcl.c b/ext/fts5/fts5_tcl.c index df4b2daa41..dc5811ce4d 100644 --- a/ext/fts5/fts5_tcl.c +++ b/ext/fts5/fts5_tcl.c @@ -1631,7 +1631,7 @@ static int SQLITE_TCLAPI f5tDropCorruptTable( */ void f5tFree(void *p){ char *x = (char *)p; - free(&x[-8]); + ckfree(&x[-8]); } /* @@ -1644,7 +1644,7 @@ void f5tStrFunc(sqlite3_context *pCtx, int nArg, sqlite3_value **apArg){ zText = sqlite3_value_text(apArg[0]); if( zText ){ int nText = sqlite3Strlen30(zText); - char *zCopy = (char*)malloc(nText+8); + char *zCopy = (char*)ckalloc(nText+8); if( zCopy==0 ){ sqlite3_result_error_nomem(pCtx); }else{ diff --git a/manifest b/manifest index a5433fd4b9..5fc5d28931 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Improvements\sto\sthe\sPATTERN\soption\sof\sthe\s"testrunner.tcl\sjoblist"\scommand.\nThe\spattern\smatch\sis\scase\sinsensitive\sand\sapplies\sto\sthe\sstate\sand\sdisplaytype\nin\saddition\sto\sdisplayname. -D 2024-10-27T10:48:06.296 +C Fix\stest\scode\sadded\sby\s[ba358d26]. +D 2024-10-27T15:58:28.881 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md b6e6c1baf38e4339bd3f1e0e5e5bfd0a9a93d133360691b2785c2d4b2f2dcec2 @@ -120,7 +120,7 @@ F ext/fts5/fts5_hash.c adda4272be401566a6e0ba1acbe70ee5cb97fce944bc2e04dc707152a F ext/fts5/fts5_index.c 368a968570ce12ba40223e284a588d9f93ee23a0133727f0df1fcd64086b1fb6 F ext/fts5/fts5_main.c 50eb059e51d730e8e0c77df4e568b018079e112a755c094488b0d5b1aa06afbb F ext/fts5/fts5_storage.c 337b05e4c66fc822d031e264d65bde807ec2fab08665ca2cc8aaf9c5fa06792c -F ext/fts5/fts5_tcl.c 9b390c318e36c0dc53af14e20198f55aa3ed46a39350ed7f46bc034e422fe778 +F ext/fts5/fts5_tcl.c 055a52c54a72171f0adbdf674e21ee0b36798eeec7b99243913c43d8aa6496a7 F ext/fts5/fts5_test_mi.c 08c11ec968148d4cb4119d96d819f8c1f329812c568bac3684f5464be177d3ee F ext/fts5/fts5_test_tok.c 3cb0a9b508b30d17ef025ccddd26ae3dc8ddffbe76c057616e59a9aa85d36f3b F ext/fts5/fts5_tokenize.c 033e2e43b8e852c0ef6cecc611266d61e2346e52ec7dcfb76a428fe56a07efa9 @@ -2237,8 +2237,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 82ab8ff399aafa3a1faec9c85e9d6bdd26636f28f3ea22287999a868bb78db57 -R 0d75fc44cce96c36a84fecce905e5052 -U drh -Z 2356ac73b439e525952354a1e2e52d93 +P 63a8f60f98115d4ee6e40de3ae775770aba76e19df6ddde68bccb7967b0200dc +R 3f7cd00e3e49e0565ff5c1eb686e6334 +U dan +Z 219db953539c68d8f9036d10ef1d93d0 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 85767773f8..46f5a11977 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -63a8f60f98115d4ee6e40de3ae775770aba76e19df6ddde68bccb7967b0200dc +b7da7980d33e2f2d5d0a4384a43eff39e1a2de4f53b8b4074eea48598a35b9d7 From 6d05f9af814503db015a83627f3a80a77494c5a2 Mon Sep 17 00:00:00 2001 From: drh <> Date: Sun, 27 Oct 2024 16:12:58 +0000 Subject: [PATCH 03/15] Fix build errors in fts5_tcl.c on Mac. FossilOrigin-Name: 133fff8bd79d46f74eeeee677a929b611f3af79cbc492864211e61e2a35846e9 --- ext/fts5/fts5_tcl.c | 5 +++-- manifest | 14 +++++++------- manifest.uuid | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/ext/fts5/fts5_tcl.c b/ext/fts5/fts5_tcl.c index dc5811ce4d..dd2ed82c9e 100644 --- a/ext/fts5/fts5_tcl.c +++ b/ext/fts5/fts5_tcl.c @@ -21,6 +21,7 @@ #include "fts5.h" #include #include +#include #ifdef SQLITE_DEBUG extern int sqlite3_fts5_may_be_corrupt; @@ -1643,14 +1644,14 @@ void f5tStrFunc(sqlite3_context *pCtx, int nArg, sqlite3_value **apArg){ zText = sqlite3_value_text(apArg[0]); if( zText ){ - int nText = sqlite3Strlen30(zText); + sqlite3_int64 nText = strlen(zText); char *zCopy = (char*)ckalloc(nText+8); if( zCopy==0 ){ sqlite3_result_error_nomem(pCtx); }else{ zCopy += 8; memcpy(zCopy, zText, nText); - sqlite3_result_text(pCtx, zCopy, nText, f5tFree); + sqlite3_result_text64(pCtx, zCopy, nText, f5tFree, SQLITE_UTF8); } } } diff --git a/manifest b/manifest index 5fc5d28931..c5fc4c5b26 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\stest\scode\sadded\sby\s[ba358d26]. -D 2024-10-27T15:58:28.881 +C Fix\sbuild\serrors\sin\sfts5_tcl.c\son\sMac. +D 2024-10-27T16:12:58.185 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md b6e6c1baf38e4339bd3f1e0e5e5bfd0a9a93d133360691b2785c2d4b2f2dcec2 @@ -120,7 +120,7 @@ F ext/fts5/fts5_hash.c adda4272be401566a6e0ba1acbe70ee5cb97fce944bc2e04dc707152a F ext/fts5/fts5_index.c 368a968570ce12ba40223e284a588d9f93ee23a0133727f0df1fcd64086b1fb6 F ext/fts5/fts5_main.c 50eb059e51d730e8e0c77df4e568b018079e112a755c094488b0d5b1aa06afbb F ext/fts5/fts5_storage.c 337b05e4c66fc822d031e264d65bde807ec2fab08665ca2cc8aaf9c5fa06792c -F ext/fts5/fts5_tcl.c 055a52c54a72171f0adbdf674e21ee0b36798eeec7b99243913c43d8aa6496a7 +F ext/fts5/fts5_tcl.c 5b16a249962809b2aaaab964bf58838ea72f30b8b12373cafe612f8cc71e2a40 F ext/fts5/fts5_test_mi.c 08c11ec968148d4cb4119d96d819f8c1f329812c568bac3684f5464be177d3ee F ext/fts5/fts5_test_tok.c 3cb0a9b508b30d17ef025ccddd26ae3dc8ddffbe76c057616e59a9aa85d36f3b F ext/fts5/fts5_tokenize.c 033e2e43b8e852c0ef6cecc611266d61e2346e52ec7dcfb76a428fe56a07efa9 @@ -2237,8 +2237,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 63a8f60f98115d4ee6e40de3ae775770aba76e19df6ddde68bccb7967b0200dc -R 3f7cd00e3e49e0565ff5c1eb686e6334 -U dan -Z 219db953539c68d8f9036d10ef1d93d0 +P b7da7980d33e2f2d5d0a4384a43eff39e1a2de4f53b8b4074eea48598a35b9d7 +R a534ed4b3db6daee016a753585ff9b49 +U drh +Z 8a0f59c10b6f6bb02e3fc54754d114cf # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 46f5a11977..361f79d273 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -b7da7980d33e2f2d5d0a4384a43eff39e1a2de4f53b8b4074eea48598a35b9d7 +133fff8bd79d46f74eeeee677a929b611f3af79cbc492864211e61e2a35846e9 From 9905e7e22bca3c5ef07d77aed1e09823697d345d Mon Sep 17 00:00:00 2001 From: stephan Date: Sun, 27 Oct 2024 18:46:11 +0000 Subject: [PATCH 04/15] When readline is enabled, attempt to determine whether the completion API is compatible and, if it's not, disable it in the shell app. FossilOrigin-Name: 4564dbe4ac0040803b5d139c9fff22a60a45b4769d80ad7c824456cc6b9f1722 --- auto.def | 20 ++++++++++++++++++++ autosetup/hwaci-common.tcl | 2 +- manifest | 18 +++++++++--------- manifest.uuid | 2 +- src/shell.c.in | 5 +++-- 5 files changed, 34 insertions(+), 13 deletions(-) diff --git a/auto.def b/auto.def index 074e75c10b..8b9e71fd23 100644 --- a/auto.def +++ b/auto.def @@ -907,6 +907,26 @@ proc sqlite-check-line-editing {} { define HAVE_READLINE 1 add-shell-opt -DHAVE_READLINE=1 user-notice "Using readline flags: $rlInc $rlLib" + + # Now check whether rl_completion_matches() has a signature we can use. + # cctest is producing unexpected test output when using: + # -includes {stdio.h readline/readline.h} + # so we have to use -source instead and write the whole test app inline + if {[cctest \ + -cflags $rlInc -libs $rlLib -nooutput 1 -source { + #include + #include + static char * rcg(const char *z, int i){return 0;} + int main(void) { + char ** x = rl_completion_matches("one", rcg); + return 0; + } + }]} { + user-notice "Readline completion enabled" + } else { + user-notice "WARNING: readline completion disabled due to rl_completion_matches() signature mismatch" + add-shell-opt -DSQLITE_OMIT_READLINE_COMPLETION + } return "readline" } diff --git a/autosetup/hwaci-common.tcl b/autosetup/hwaci-common.tcl index f7ff89f3a3..9c11a21ae5 100644 --- a/autosetup/hwaci-common.tcl +++ b/autosetup/hwaci-common.tcl @@ -548,7 +548,7 @@ proc hwaci-looks-like-windows {{key host}} { } if {$key eq "build"} { # These apply only to the local OS, not a cross-compilation target, - # as the above check can potentially. + # as the above check potentially can. if {$::autosetup(iswin)} { return 1 } if {[find-an-executable cygpath] ne "" || $::tcl_platform(os)=="Windows NT"} { return 1 diff --git a/manifest b/manifest index c5fc4c5b26..de949837a5 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sbuild\serrors\sin\sfts5_tcl.c\son\sMac. -D 2024-10-27T16:12:58.185 +C When\sreadline\sis\senabled,\sattempt\sto\sdetermine\swhether\sthe\scompletion\sAPI\sis\scompatible\sand,\sif\sit's\snot,\sdisable\sit\sin\sthe\sshell\sapp. +D 2024-10-27T18:46:11.275 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md b6e6c1baf38e4339bd3f1e0e5e5bfd0a9a93d133360691b2785c2d4b2f2dcec2 @@ -13,7 +13,7 @@ F art/icon-80x90.gif 65509ce3e5f86a9cd64fe7fca2d23954199f31fe44c1e09e208c80fb83d F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2 F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90 F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2 -F auto.def fbbacb5a62b32a5d6f831694cca4d429ea58f6f6a7e7d04bdd8918f08e372b89 +F auto.def ec6ba41a7e40137dc0fbff5a9898886a76bba6c3fe88f4b2ffba7ec02ca9cb46 F autoconf/INSTALL 83e4a25da9fd053c7b3665eaaaf7919707915903 F autoconf/Makefile.am adedc1324b6a87fdd1265ddd336d2fb7d4f36a0e77b86ea553ae7cc4ea239347 F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac @@ -47,7 +47,7 @@ F autosetup/cc-lib.tcl 493c5935b5dd3bf9bd4eca89b07c8b1b1a9356d61783035144e21795f F autosetup/cc-shared.tcl 4f024e94a47f427ba61de1739f6381ef0080210f9fae89112d5c1de1e5460d78 F autosetup/cc.tcl 7e2fe943ae9d45cf39e9f5b05b6230df8e719415edea5af06c30eb68680bde14 F autosetup/default.auto 5cdf016de2140e50f1db190a02039dc42fb390af1dda4cc4853e3042a9ef0e82 -F autosetup/hwaci-common.tcl 247f02d8c92999c0e76e033371c7dd41fee326e70de0251044d00b75562b0a3a +F autosetup/hwaci-common.tcl 0e8643bcacf4fd73be0b194faf21b18a7229dd61347eb204a368fef45a0bee87 F autosetup/jimsh0.c 27ea5f221359ef6c58780fc6c185aadbf8d3bee9a021331a3e5de0eba0dc6de6 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba F autosetup/system.tcl 3a39d6e0b3bfba526fd39afe07c1d0d325e5a31925013a1ba7c671e1128e31bb @@ -788,7 +788,7 @@ F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c F src/resolve.c c8a5372b97b2a2e972a280676f06ddb5b74e885d3b1f5ce383f839907b57ef68 F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97 F src/select.c 4b14337a2742f0c0beeba490e9a05507e9b4b12184b9cd12773501d08d48e3fe -F src/shell.c.in 0662f9bcf0725461778d0254a06150e5d61c08c5a87a7281ccdf45552050c79d +F src/shell.c.in 2fb0947424944f8baa1b4efdfd9eca70dc0691bbc1cb4d283db7fc142937fa3a F src/sqlite.h.in 29fc900a58f394c7488d093fd7a8dcb14d3fa6399d5178cb20adcf88dbedfe39 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h 3f046c04ea3595d6bfda99b781926b17e672fd6d27da2ba6d8d8fc39981dcb54 @@ -2237,8 +2237,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P b7da7980d33e2f2d5d0a4384a43eff39e1a2de4f53b8b4074eea48598a35b9d7 -R a534ed4b3db6daee016a753585ff9b49 -U drh -Z 8a0f59c10b6f6bb02e3fc54754d114cf +P 133fff8bd79d46f74eeeee677a929b611f3af79cbc492864211e61e2a35846e9 +R 0ec65f180d97227b7302a157e1743b13 +U stephan +Z fda94993ae5f9ecaf502d7e40734c943 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 361f79d273..2a7ae021c4 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -133fff8bd79d46f74eeeee677a929b611f3af79cbc492864211e61e2a35846e9 +4564dbe4ac0040803b5d139c9fff22a60a45b4769d80ad7c824456cc6b9f1722 diff --git a/src/shell.c.in b/src/shell.c.in index bbf08f8098..df0c3500de 100644 --- a/src/shell.c.in +++ b/src/shell.c.in @@ -5759,7 +5759,8 @@ void close_db(sqlite3 *db){ } } -#if HAVE_READLINE || HAVE_EDITLINE +#if (HAVE_READLINE || HAVE_EDITLINE) \ + && !defined(SQLITE_OMIT_READLINE_COMPLETION) /* ** Readline completion callbacks */ @@ -13259,7 +13260,7 @@ int SQLITE_CDECL wmain(int argc, wchar_t **wargv){ } } if( zHistory ){ shell_read_history(zHistory); } -#if HAVE_READLINE || HAVE_EDITLINE +#if (HAVE_READLINE || HAVE_EDITLINE) && !defined(SQLITE_OMIT_READLINE_COMPLETION) rl_attempted_completion_function = readline_completion; #elif HAVE_LINENOISE linenoiseSetCompletionCallback(linenoise_completion, NULL); From 6bb44daae4a7c38a14aeae2ccf886addb5b1aa87 Mon Sep 17 00:00:00 2001 From: stephan Date: Sun, 27 Oct 2024 19:26:54 +0000 Subject: [PATCH 05/15] When ICU is enabled, ensure that the CLI shell build enables its feature flag and include LDFLAGS_ICU in sqlite3.pc. FossilOrigin-Name: abec913c00564ee5453075f45b1a6680e92ee1b1e61e3b19e4cf74e46785d3bf --- auto.def | 1 + manifest | 14 +++++++------- manifest.uuid | 2 +- sqlite3.pc.in | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/auto.def b/auto.def index 8b9e71fd23..97ed72569e 100644 --- a/auto.def +++ b/auto.def @@ -982,6 +982,7 @@ if {"" ne [define LDFLAGS_ICU [join [opt-val with-icu-lib ""]]]} { # Flags sets seen in the wild for ICU: # {-licui18n -licuuc -licudata} {-licui18n -licuuc} add-feature-flag -DSQLITE_ENABLE_ICU + add-shell-opt -DSQLITE_ENABLE_ICU msg-result "Enabling ICU support with libs: [get-define LDFLAGS_ICU]" if {[opt-bool icu-collations]} { msg-result "Enabling ICU collations." diff --git a/manifest b/manifest index de949837a5..3fbf97aad1 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C When\sreadline\sis\senabled,\sattempt\sto\sdetermine\swhether\sthe\scompletion\sAPI\sis\scompatible\sand,\sif\sit's\snot,\sdisable\sit\sin\sthe\sshell\sapp. -D 2024-10-27T18:46:11.275 +C When\sICU\sis\senabled,\sensure\sthat\sthe\sCLI\sshell\sbuild\senables\sits\sfeature\sflag\sand\sinclude\sLDFLAGS_ICU\sin\ssqlite3.pc. +D 2024-10-27T19:26:54.435 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md b6e6c1baf38e4339bd3f1e0e5e5bfd0a9a93d133360691b2785c2d4b2f2dcec2 @@ -13,7 +13,7 @@ F art/icon-80x90.gif 65509ce3e5f86a9cd64fe7fca2d23954199f31fe44c1e09e208c80fb83d F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2 F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90 F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2 -F auto.def ec6ba41a7e40137dc0fbff5a9898886a76bba6c3fe88f4b2ffba7ec02ca9cb46 +F auto.def 580df10aeb7d12fb939a5f503cd30d2a5d619ac6bb8e94cd3f3f8b425388da13 F autoconf/INSTALL 83e4a25da9fd053c7b3665eaaaf7919707915903 F autoconf/Makefile.am adedc1324b6a87fdd1265ddd336d2fb7d4f36a0e77b86ea553ae7cc4ea239347 F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac @@ -717,7 +717,7 @@ F mptest/multiwrite01.test dab5c5f8f9534971efce679152c5146da265222d F spec.template 86a4a43b99ebb3e75e6b9a735d5fd293a24e90ca F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b F sqlite3.1 acdff36db796e2d00225b911d3047d580cd136547298435426ce9d40347973cc -F sqlite3.pc.in 02db2fa13bcfb301bf8af5ab06984bed583e78a678a557902726eada3bbb7ff1 +F sqlite3.pc.in 0977c03a4da7c4204bd60e784a0efb8d51a190448aba78a4e973fe7192bdaf03 F sqlite_cfg.h.in be1d075cf77134d53fdf5cc2c0919842e7e02a648c66a56e735af25ccdcaff91 F src/alter.c aa93e37e4a36a0525bbb2a2aeda20d2018f0aa995542c7dc658e031375e3f532 F src/analyze.c 9a8b67239d899ac12289db5db3f5bfe7f7a0ad1277f80f87ead1d048085876eb @@ -2237,8 +2237,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 133fff8bd79d46f74eeeee677a929b611f3af79cbc492864211e61e2a35846e9 -R 0ec65f180d97227b7302a157e1743b13 +P 4564dbe4ac0040803b5d139c9fff22a60a45b4769d80ad7c824456cc6b9f1722 +R 862234bfe7dc3dea608ab0b1a9f6ed4c U stephan -Z fda94993ae5f9ecaf502d7e40734c943 +Z 08f197b7ace262c34243258f45fb1526 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 2a7ae021c4..139804b3dc 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -4564dbe4ac0040803b5d139c9fff22a60a45b4769d80ad7c824456cc6b9f1722 +abec913c00564ee5453075f45b1a6680e92ee1b1e61e3b19e4cf74e46785d3bf diff --git a/sqlite3.pc.in b/sqlite3.pc.in index 73d65dea23..a9f941b1e4 100644 --- a/sqlite3.pc.in +++ b/sqlite3.pc.in @@ -9,5 +9,5 @@ Name: SQLite Description: SQL database engine Version: @PACKAGE_VERSION@ Libs: -L${libdir} -lsqlite3 -Libs.private: @LDFLAGS_MATH@ @LDFLAGS_ZLIB@ +Libs.private: @LDFLAGS_MATH@ @LDFLAGS_ZLIB@ @LDFLAGS_ICU@ Cflags: -I${includedir} From f6e86e38ac16621d7f97db398043426064075090 Mon Sep 17 00:00:00 2001 From: stephan Date: Sun, 27 Oct 2024 20:04:23 +0000 Subject: [PATCH 06/15] Rename --with-readline-lib/inc to --with-readline-ldflags/cflags, for clarity, but retain the older names as aliases using autosetup's "hidden alias" feature. Rename the newly-added --with-icu-lib to --with-icu-ldflags (with no backwards compatibility). FossilOrigin-Name: e50a03f9f2a40a5e65f874ffff234a7b397ce4ebdc7b360d4e6ade7575577c38 --- auto.def | 43 +++++++++++++++++++++++++------------- autosetup/hwaci-common.tcl | 21 +++++++++++++++++++ manifest | 14 ++++++------- manifest.uuid | 2 +- 4 files changed, 58 insertions(+), 22 deletions(-) diff --git a/auto.def b/auto.def index 97ed72569e..3ced03f751 100644 --- a/auto.def +++ b/auto.def @@ -163,15 +163,21 @@ set flags { largefile=1 => {Disable large file support} shared=1 => {Disable build of shared libary} static=1 => {Disable build of static library} - with-readline-lib:LDFLAGS + # --with-readline-lib is a legacy name, now a backwards-compatible + # alias for --with-readline-ldflags. + with-readline-lib: + with-readline-ldflags:LDFLAGS => {Readline LDFLAGS, e.g. -lreadline -lncurses} - with-readline-inc:CFLAGS + # --with-readline-inc is a legacy name, now a backwards-compatible + # alias for --with-readline-ldflags. + with-readline-inc: + with-readline-cflags:CFLAGS => {Readline CFLAGS, e.g. -I/path/to/includes} with-readline-header:PATH - => {Full path to readline.h, from which --with-readline-inc will be derived} + => {Full path to readline.h, from which --with-readline-cflags will be derived} with-linenoise:DIR => {Source directory for linenoise.c and linenoise.h} - with-icu-lib:LDFLAGS => {Enable SQLITE_ENABLE_ICU and add the given linker flags for the ICU libraries} - icu-collations=0 => {Enable SQLITE_ENABLE_ICU_COLLATIONS. Requires --with-icu-lib=...} + with-icu-ldflags:LDFLAGS => {Enable SQLITE_ENABLE_ICU and add the given linker flags for the ICU libraries} + icu-collations=0 => {Enable SQLITE_ENABLE_ICU_COLLATIONS. Requires --with-icu-ldflags=...} amalgamation=1 => {Disable the amalgamation and instead build all files separately} load-extension=1 => {Disable loading of external extensions} math=1 => {Disable math functions} @@ -201,6 +207,15 @@ if {"" ne $DUMP_DEFINES_JSON} { options [subst $flags] unset flags +# Apply values from hidden --flag aliases over to their canonical +# forms. +foreach {hidden flag canonical} { + with-readline-inc => with-readline-cflags + with-readline-lib => with-readline-ldflags +} { + hwaci-xfer-opt-alias $hidden $canonical +} + set srcdir $::autosetup(srcdir) set top_srcdir [get-define abs_top_srcdir] set PACKAGE_VERSION [readfile $srcdir/VERSION] @@ -817,7 +832,7 @@ proc sqlite-check-line-editing {} { # # However, a workaround which works on the available systems is: # - # --with-readline-lib=-ledit + # --with-readline-ldflags=-ledit # # And then let it detect readline.h. We "could" re-map # --enable-editline to do exactly that but it seems likely to @@ -827,7 +842,7 @@ proc sqlite-check-line-editing {} { WARNING: the --enable-editline flag is not supported due to non-availability of systems which have it in a form which the sqlite3 CLI shell expects to see. On some systems this can be - worked around by passing --with-readline-lib=-ledit instead of + worked around by passing --with-readline-ldflags=-ledit instead of --enable-editline, which will attempt to use the readline.h supplied by libreadline but link against -ledit. } @@ -837,12 +852,12 @@ proc sqlite-check-line-editing {} { return "none" } - # Transform with-readline-header=X to with-readline-inc=-I... + # Transform with-readline-header=X to with-readline-cflags=-I... set v [opt-val with-readline-header] hwaci-opt-set with-readline-header "" if {"" ne $v} { if {"auto" eq $v} { - hwaci-opt-set with-readline-inc auto + hwaci-opt-set with-readline-cflags auto } else { set v [file dirname $v] if {[string match */*line $v]} { @@ -853,12 +868,12 @@ proc sqlite-check-line-editing {} { # work! set v [file dirname $v] } - hwaci-opt-set with-readline-inc "-I$v" + hwaci-opt-set with-readline-cflags "-I$v" } } # Look for readline.h - set rlInc [opt-val with-readline-inc auto] + set rlInc [opt-val with-readline-cflags auto] if {"auto" eq $rlInc} { set rlInc "" if {!$::cross_compiling} { @@ -880,7 +895,7 @@ proc sqlite-check-line-editing {} { # If readline.h was found/specified, look for libreadline... set rlLib "" if {"" ne $rlInc} { - set rlLib [opt-val with-readline-lib] + set rlLib [opt-val with-readline-ldflags] if {"" eq $rlLib || "auto" eq $rlLib} { set rlLib "" set libTerm "" @@ -978,7 +993,7 @@ unset emccsh ######################################################################## # ICU -if {"" ne [define LDFLAGS_ICU [join [opt-val with-icu-lib ""]]]} { +if {"" ne [define LDFLAGS_ICU [join [opt-val with-icu-ldflags ""]]]} { # Flags sets seen in the wild for ICU: # {-licui18n -licuuc -licudata} {-licui18n -licuuc} add-feature-flag -DSQLITE_ENABLE_ICU @@ -989,7 +1004,7 @@ if {"" ne [define LDFLAGS_ICU [join [opt-val with-icu-lib ""]]]} { add-feature-flag -DSQLITE_ENABLE_ICU_COLLATIONS } } elseif {[opt-bool icu-collations]} { - hwaci-warn "ignoring --enable-icu-collations because --with-icu-lib was not specified" + hwaci-warn "ignoring --enable-icu-collations because --with-icu-ldflags was not specified" } ######################################################################## diff --git a/autosetup/hwaci-common.tcl b/autosetup/hwaci-common.tcl index 9c11a21ae5..4c3c0585c8 100644 --- a/autosetup/hwaci-common.tcl +++ b/autosetup/hwaci-common.tcl @@ -975,3 +975,24 @@ proc hwaci-dump-defs-json {file args} { msg-result "Created $file" } } + +######################################################################## +# Expects configure flags with the given names to have been registered +# with autosetup. If [opt-val $hidden] has a value but [opt-val +# $canonical] does not, it copies the former over the latter. If both +# have explicit values a fatal usage error is triggered. +# +# Autosetup accounts for hidden aliases in [options] lists but does no +# further handling of them, e.g. fetching [opt-val foo] will not, even +# if foo is an alias for bar, see a value passed in as --bar=baz. +proc hwaci-xfer-opt-alias {hidden canonical} { + set x [opt-val $hidden "-9-9-9-"] + if {"-9-9-9-" ne $x} { + set y [opt-val $canonical "-0-0-0-"] + if {"-0-0-0-" eq $y} { + hwaci-opt-set $canonical $x + } else { + hwaci-fatal "both --$canonical and its hidden alias --$hidden were used. Use only one or the other." + } + } +} diff --git a/manifest b/manifest index 3fbf97aad1..5796e3c9c0 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C When\sICU\sis\senabled,\sensure\sthat\sthe\sCLI\sshell\sbuild\senables\sits\sfeature\sflag\sand\sinclude\sLDFLAGS_ICU\sin\ssqlite3.pc. -D 2024-10-27T19:26:54.435 +C Rename\s--with-readline-lib/inc\sto\s--with-readline-ldflags/cflags,\sfor\sclarity,\sbut\sretain\sthe\solder\snames\sas\saliases\susing\sautosetup's\s"hidden\salias"\sfeature.\sRename\sthe\snewly-added\s--with-icu-lib\sto\s--with-icu-ldflags\s(with\sno\sbackwards\scompatibility). +D 2024-10-27T20:04:23.738 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md b6e6c1baf38e4339bd3f1e0e5e5bfd0a9a93d133360691b2785c2d4b2f2dcec2 @@ -13,7 +13,7 @@ F art/icon-80x90.gif 65509ce3e5f86a9cd64fe7fca2d23954199f31fe44c1e09e208c80fb83d F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2 F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90 F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2 -F auto.def 580df10aeb7d12fb939a5f503cd30d2a5d619ac6bb8e94cd3f3f8b425388da13 +F auto.def 7f4a0a1421306ed8bca11d54b754f01dbf76054d17894c7c88fad0c05e2fadba F autoconf/INSTALL 83e4a25da9fd053c7b3665eaaaf7919707915903 F autoconf/Makefile.am adedc1324b6a87fdd1265ddd336d2fb7d4f36a0e77b86ea553ae7cc4ea239347 F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac @@ -47,7 +47,7 @@ F autosetup/cc-lib.tcl 493c5935b5dd3bf9bd4eca89b07c8b1b1a9356d61783035144e21795f F autosetup/cc-shared.tcl 4f024e94a47f427ba61de1739f6381ef0080210f9fae89112d5c1de1e5460d78 F autosetup/cc.tcl 7e2fe943ae9d45cf39e9f5b05b6230df8e719415edea5af06c30eb68680bde14 F autosetup/default.auto 5cdf016de2140e50f1db190a02039dc42fb390af1dda4cc4853e3042a9ef0e82 -F autosetup/hwaci-common.tcl 0e8643bcacf4fd73be0b194faf21b18a7229dd61347eb204a368fef45a0bee87 +F autosetup/hwaci-common.tcl 7839c061ae85648d1440ef95f75f4c1f18008458b7a3a81beaebeb7d2470a0dc F autosetup/jimsh0.c 27ea5f221359ef6c58780fc6c185aadbf8d3bee9a021331a3e5de0eba0dc6de6 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba F autosetup/system.tcl 3a39d6e0b3bfba526fd39afe07c1d0d325e5a31925013a1ba7c671e1128e31bb @@ -2237,8 +2237,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 4564dbe4ac0040803b5d139c9fff22a60a45b4769d80ad7c824456cc6b9f1722 -R 862234bfe7dc3dea608ab0b1a9f6ed4c +P abec913c00564ee5453075f45b1a6680e92ee1b1e61e3b19e4cf74e46785d3bf +R 8c93632539b57f8beda5bb3056f97174 U stephan -Z 08f197b7ace262c34243258f45fb1526 +Z 46a44527cb166d23de983b40142b0922 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 139804b3dc..c1c05dc35c 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -abec913c00564ee5453075f45b1a6680e92ee1b1e61e3b19e4cf74e46785d3bf +e50a03f9f2a40a5e65f874ffff234a7b397ce4ebdc7b360d4e6ade7575577c38 From 5be20f3927288832218667051671c4d87418c6bc Mon Sep 17 00:00:00 2001 From: stephan Date: Sun, 27 Oct 2024 20:14:49 +0000 Subject: [PATCH 07/15] Doc additions and minor cleanups in the --flag alias handling. FossilOrigin-Name: 37a1da038195365cd7eb866b3aa749ad8060a656ac38063520fdb70cf0a0e5f1 --- auto.def | 6 ++++-- autosetup/hwaci-common.tcl | 20 +++++++++++++------- manifest | 14 +++++++------- manifest.uuid | 2 +- 4 files changed, 25 insertions(+), 17 deletions(-) diff --git a/auto.def b/auto.def index 3ced03f751..0f6cc74a06 100644 --- a/auto.def +++ b/auto.def @@ -207,9 +207,11 @@ if {"" ne $DUMP_DEFINES_JSON} { options [subst $flags] unset flags -# Apply values from hidden --flag aliases over to their canonical +# +# Carry values from hidden --flag aliases over to their canonical flag # forms. -foreach {hidden flag canonical} { +# +foreach {hidden => canonical} { with-readline-inc => with-readline-cflags with-readline-lib => with-readline-ldflags } { diff --git a/autosetup/hwaci-common.tcl b/autosetup/hwaci-common.tcl index 4c3c0585c8..bb9836f7dc 100644 --- a/autosetup/hwaci-common.tcl +++ b/autosetup/hwaci-common.tcl @@ -979,17 +979,23 @@ proc hwaci-dump-defs-json {file args} { ######################################################################## # Expects configure flags with the given names to have been registered # with autosetup. If [opt-val $hidden] has a value but [opt-val -# $canonical] does not, it copies the former over the latter. If both -# have explicit values a fatal usage error is triggered. +# $canonical] does not, it copies the former over the latter. If +# $hidden has no value set, this is a no-op. If both have explicit +# values a fatal usage error is triggered. # -# Autosetup accounts for hidden aliases in [options] lists but does no -# further handling of them, e.g. fetching [opt-val foo] will not, even -# if foo is an alias for bar, see a value passed in as --bar=baz. +# Motivation: autosetup accounts for hidden aliases in [options] lists +# but does no further handling of them. For example, when --foo is a +# hidden alias of the canonical flag --bar, and a user passes --foo=X, +# [opt-val bar] returns no value. i.e. the script must check both +# [opt-val foo] and [opt-val bar], despite them being aliases. The +# intent is that this function be passed each such mapping immediately +# after [options] is processed, to carry over any values from hidden +# aliases into their canonical names, so that in the above example +# [opt-value bar] will return X if --foo=X is passed in. proc hwaci-xfer-opt-alias {hidden canonical} { set x [opt-val $hidden "-9-9-9-"] if {"-9-9-9-" ne $x} { - set y [opt-val $canonical "-0-0-0-"] - if {"-0-0-0-" eq $y} { + if {"-0-0-0-" eq [opt-val $canonical "-0-0-0-"]} { hwaci-opt-set $canonical $x } else { hwaci-fatal "both --$canonical and its hidden alias --$hidden were used. Use only one or the other." diff --git a/manifest b/manifest index 5796e3c9c0..bab329676f 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Rename\s--with-readline-lib/inc\sto\s--with-readline-ldflags/cflags,\sfor\sclarity,\sbut\sretain\sthe\solder\snames\sas\saliases\susing\sautosetup's\s"hidden\salias"\sfeature.\sRename\sthe\snewly-added\s--with-icu-lib\sto\s--with-icu-ldflags\s(with\sno\sbackwards\scompatibility). -D 2024-10-27T20:04:23.738 +C Doc\sadditions\sand\sminor\scleanups\sin\sthe\s--flag\salias\shandling. +D 2024-10-27T20:14:49.852 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md b6e6c1baf38e4339bd3f1e0e5e5bfd0a9a93d133360691b2785c2d4b2f2dcec2 @@ -13,7 +13,7 @@ F art/icon-80x90.gif 65509ce3e5f86a9cd64fe7fca2d23954199f31fe44c1e09e208c80fb83d F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2 F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90 F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2 -F auto.def 7f4a0a1421306ed8bca11d54b754f01dbf76054d17894c7c88fad0c05e2fadba +F auto.def a5cc3792cfe6e82561c810f5f6383186ee5ce73cdde4ca06b70f18252ec38f84 F autoconf/INSTALL 83e4a25da9fd053c7b3665eaaaf7919707915903 F autoconf/Makefile.am adedc1324b6a87fdd1265ddd336d2fb7d4f36a0e77b86ea553ae7cc4ea239347 F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac @@ -47,7 +47,7 @@ F autosetup/cc-lib.tcl 493c5935b5dd3bf9bd4eca89b07c8b1b1a9356d61783035144e21795f F autosetup/cc-shared.tcl 4f024e94a47f427ba61de1739f6381ef0080210f9fae89112d5c1de1e5460d78 F autosetup/cc.tcl 7e2fe943ae9d45cf39e9f5b05b6230df8e719415edea5af06c30eb68680bde14 F autosetup/default.auto 5cdf016de2140e50f1db190a02039dc42fb390af1dda4cc4853e3042a9ef0e82 -F autosetup/hwaci-common.tcl 7839c061ae85648d1440ef95f75f4c1f18008458b7a3a81beaebeb7d2470a0dc +F autosetup/hwaci-common.tcl f8b683adc42ac4a9d1a950118f024b8b7d2b90460ee39c5a9a0feb8e7ad9d179 F autosetup/jimsh0.c 27ea5f221359ef6c58780fc6c185aadbf8d3bee9a021331a3e5de0eba0dc6de6 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba F autosetup/system.tcl 3a39d6e0b3bfba526fd39afe07c1d0d325e5a31925013a1ba7c671e1128e31bb @@ -2237,8 +2237,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P abec913c00564ee5453075f45b1a6680e92ee1b1e61e3b19e4cf74e46785d3bf -R 8c93632539b57f8beda5bb3056f97174 +P e50a03f9f2a40a5e65f874ffff234a7b397ce4ebdc7b360d4e6ade7575577c38 +R 689f8e7c0b273a0d5f61c39635b6551a U stephan -Z 46a44527cb166d23de983b40142b0922 +Z 9c99ac6705fb06550102fd68e4fd933c # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index c1c05dc35c..d17d4d17dd 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e50a03f9f2a40a5e65f874ffff234a7b397ce4ebdc7b360d4e6ade7575577c38 +37a1da038195365cd7eb866b3aa749ad8060a656ac38063520fdb70cf0a0e5f1 From 2005250d7f585e26b313e7c3e3a09ca261c3272f Mon Sep 17 00:00:00 2001 From: stephan Date: Sun, 27 Oct 2024 20:46:09 +0000 Subject: [PATCH 08/15] Generic cleanups in auto.def and hwaci-common.tcl. FossilOrigin-Name: 428e542452bac99d48950f1f62b65b4e235636540b946151747e2d5b59dbfd99 --- auto.def | 16 ++++------ autosetup/hwaci-common.tcl | 65 +++++++++++++++++++++++++++----------- manifest | 14 ++++---- manifest.uuid | 2 +- 4 files changed, 62 insertions(+), 35 deletions(-) diff --git a/auto.def b/auto.def index 0f6cc74a06..9ea09c8d11 100644 --- a/auto.def +++ b/auto.def @@ -163,15 +163,15 @@ set flags { largefile=1 => {Disable large file support} shared=1 => {Disable build of shared libary} static=1 => {Disable build of static library} - # --with-readline-lib is a legacy name, now a backwards-compatible - # alias for --with-readline-ldflags. + # --with-readline-lib is a backwards-compatible alias for + # --with-readline-ldflags with-readline-lib: - with-readline-ldflags:LDFLAGS + with-readline-ldflags:=auto => {Readline LDFLAGS, e.g. -lreadline -lncurses} - # --with-readline-inc is a legacy name, now a backwards-compatible - # alias for --with-readline-ldflags. + # --with-readline-inc is a backwards-compatible alias for + # --with-readline-cflags with-readline-inc: - with-readline-cflags:CFLAGS + with-readline-cflags:=auto => {Readline CFLAGS, e.g. -I/path/to/includes} with-readline-header:PATH => {Full path to readline.h, from which --with-readline-cflags will be derived} @@ -211,11 +211,9 @@ unset flags # Carry values from hidden --flag aliases over to their canonical flag # forms. # -foreach {hidden => canonical} { +hwaci-xfer-options-aliases { with-readline-inc => with-readline-cflags with-readline-lib => with-readline-ldflags -} { - hwaci-xfer-opt-alias $hidden $canonical } set srcdir $::autosetup(srcdir) diff --git a/autosetup/hwaci-common.tcl b/autosetup/hwaci-common.tcl index bb9836f7dc..611238f080 100644 --- a/autosetup/hwaci-common.tcl +++ b/autosetup/hwaci-common.tcl @@ -93,6 +93,21 @@ proc hwaci-lshift_ {listVar {count 1}} { return $r } +######################################################################## +# Expects to receive string input, which it splits on newlines, strips +# out any lines which begin with an number of whitespace followed by a +# '#', and returns a value containing the [append]ed results of each +# remaining line with a \n between each. +proc hwaci-strip-comments {val} { + set x {} + foreach line [split $val \n] { + if {![string match "#*" [string trimleft $line]]} { + append x $line \n + } + } + return $x +} + ######################################################################## # A proxy for cc-check-function-in-lib which "undoes" any changes that # routine makes to the LIBS define. Returns the result of @@ -977,28 +992,42 @@ proc hwaci-dump-defs-json {file args} { } ######################################################################## -# Expects configure flags with the given names to have been registered -# with autosetup. If [opt-val $hidden] has a value but [opt-val +# Expects a list of pairs of configure flags with the given names to +# have been registered with autosetup, in this form: +# +# { alias1 => canonical1 +# aliasN => canonicalN ... } +# +# The names must not have their leading -- part and must be in the +# form which autosetup will expect for passing to [opt-val NAME] and +# friends. +# +# Commend lines are permitted in the input. +# +# If [opt-val $hidden] has a value but [opt-val # $canonical] does not, it copies the former over the latter. If # $hidden has no value set, this is a no-op. If both have explicit # values a fatal usage error is triggered. # -# Motivation: autosetup accounts for hidden aliases in [options] lists -# but does no further handling of them. For example, when --foo is a -# hidden alias of the canonical flag --bar, and a user passes --foo=X, -# [opt-val bar] returns no value. i.e. the script must check both -# [opt-val foo] and [opt-val bar], despite them being aliases. The -# intent is that this function be passed each such mapping immediately -# after [options] is processed, to carry over any values from hidden -# aliases into their canonical names, so that in the above example -# [opt-value bar] will return X if --foo=X is passed in. -proc hwaci-xfer-opt-alias {hidden canonical} { - set x [opt-val $hidden "-9-9-9-"] - if {"-9-9-9-" ne $x} { - if {"-0-0-0-" eq [opt-val $canonical "-0-0-0-"]} { - hwaci-opt-set $canonical $x - } else { - hwaci-fatal "both --$canonical and its hidden alias --$hidden were used. Use only one or the other." +# Motivation: autosetup enables "hidden aliases" in [options] lists, +# and elides the aliases from --help output but does no further +# handling of them. For example, when --alias is a hidden alias of +# --canonical and a user passes --alias=X, [opt-val canonical] returns +# no value. i.e. the script must check both [opt-val alias] and +# [opt-val canonical]. The intent here is that this function be +# passed such mappings immediately after [options] is called, +# to carry over any values from hidden aliases into their canonical +# names, so that in the above example [opt-value canonical] will +# return X if --alias=X is passed in. +proc hwaci-xfer-options-aliases {mapping} { + foreach {hidden => canonical} [hwaci-strip-comments $mapping] { + set x [opt-val $hidden "~9~9~9~"] + if {"~9~9~9~" ne $x} { + if {"~0~0~0~" eq [opt-val $canonical "~0~0~0~"]} { + hwaci-opt-set $canonical $x + } else { + hwaci-fatal "both --$canonical and its alias --$hidden were used. Use only one or the other." + } } } } diff --git a/manifest b/manifest index bab329676f..9d55604594 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Doc\sadditions\sand\sminor\scleanups\sin\sthe\s--flag\salias\shandling. -D 2024-10-27T20:14:49.852 +C Generic\scleanups\sin\sauto.def\sand\shwaci-common.tcl. +D 2024-10-27T20:46:09.058 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md b6e6c1baf38e4339bd3f1e0e5e5bfd0a9a93d133360691b2785c2d4b2f2dcec2 @@ -13,7 +13,7 @@ F art/icon-80x90.gif 65509ce3e5f86a9cd64fe7fca2d23954199f31fe44c1e09e208c80fb83d F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2 F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90 F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2 -F auto.def a5cc3792cfe6e82561c810f5f6383186ee5ce73cdde4ca06b70f18252ec38f84 +F auto.def dd9bda48dc2a4c515d1a518f342b992c1cdea46c0d4e20a25d515ab423de2d49 F autoconf/INSTALL 83e4a25da9fd053c7b3665eaaaf7919707915903 F autoconf/Makefile.am adedc1324b6a87fdd1265ddd336d2fb7d4f36a0e77b86ea553ae7cc4ea239347 F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac @@ -47,7 +47,7 @@ F autosetup/cc-lib.tcl 493c5935b5dd3bf9bd4eca89b07c8b1b1a9356d61783035144e21795f F autosetup/cc-shared.tcl 4f024e94a47f427ba61de1739f6381ef0080210f9fae89112d5c1de1e5460d78 F autosetup/cc.tcl 7e2fe943ae9d45cf39e9f5b05b6230df8e719415edea5af06c30eb68680bde14 F autosetup/default.auto 5cdf016de2140e50f1db190a02039dc42fb390af1dda4cc4853e3042a9ef0e82 -F autosetup/hwaci-common.tcl f8b683adc42ac4a9d1a950118f024b8b7d2b90460ee39c5a9a0feb8e7ad9d179 +F autosetup/hwaci-common.tcl c6a68fe4ad416db70260bc0f8a85ee9f52d6976ca796aaa8ae013a1bf632b49d F autosetup/jimsh0.c 27ea5f221359ef6c58780fc6c185aadbf8d3bee9a021331a3e5de0eba0dc6de6 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba F autosetup/system.tcl 3a39d6e0b3bfba526fd39afe07c1d0d325e5a31925013a1ba7c671e1128e31bb @@ -2237,8 +2237,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P e50a03f9f2a40a5e65f874ffff234a7b397ce4ebdc7b360d4e6ade7575577c38 -R 689f8e7c0b273a0d5f61c39635b6551a +P 37a1da038195365cd7eb866b3aa749ad8060a656ac38063520fdb70cf0a0e5f1 +R 4a5971ae5787ab5ca5bc6c1b2940924e U stephan -Z 9c99ac6705fb06550102fd68e4fd933c +Z f7c559f6f234bc23301783ef1baa5b93 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index d17d4d17dd..bc0860a133 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -37a1da038195365cd7eb866b3aa749ad8060a656ac38063520fdb70cf0a0e5f1 +428e542452bac99d48950f1f62b65b4e235636540b946151747e2d5b59dbfd99 From 3a92a5c4b3c6596ad025b8876929a185044bd2b1 Mon Sep 17 00:00:00 2001 From: stephan Date: Sun, 27 Oct 2024 22:18:33 +0000 Subject: [PATCH 09/15] Re-order the auto.def flags logical groups. Add some discrete bold formatting to select configure output. Remove some dead code. Account for behavior misunderstanding of user-notice. Add the start of a 'make help' target. General cosmetic cleanups. FossilOrigin-Name: ab95ee33dfe56bd3b223f978626e6014414881c30443a2b88c782de724c39ae1 --- auto.def | 250 ++++++++++++++----------------------- autosetup/hwaci-common.tcl | 88 +++++++++---- main.mk | 9 ++ manifest | 16 +-- manifest.uuid | 2 +- 5 files changed, 176 insertions(+), 189 deletions(-) diff --git a/auto.def b/auto.def index 9ea09c8d11..07502b966f 100644 --- a/auto.def +++ b/auto.def @@ -14,31 +14,6 @@ # use cc cc-db cc-shared cc-lib hwaci-common pkg-config -# Are we cross-compiling? -set cross_compiling [hwaci-is-cross-compiling] -if {0 - && !$cross_compiling - && "nope" eq [get-env CC_FOR_BUILD "nope"] - && [get-define CC] ne [get-define CC_FOR_BUILD]} { - # Arguable/debatable... - # - # When _not_ cross-compiling and CC_FOR_BUILD is _not_ explcitely - # specified, force CC_FOR_BUILD to be the same as CC, so that: - # - # ./configure CC=clang - # - # will use CC_FOR_BUILD=clang, instead of cc, for building in-tree - # tools. This is based off of an email discussion and is thought to - # be likely to cause less confusion than seeing 'cc' invocations - # will when the user passes CC=clang. - # - # 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: - msg-result "Re-defining CC_FOR_BUILD to CC=[get-define CC]. To avoid this, explicitly pass CC_FOR_BUILD=..." - define CC_FOR_BUILD [get-define CC] -} - # $DUMP_DEFINES_TXT is the file emitted by --dump-defines, intended # only for build debugging and not part of the public build interface. set DUMP_DEFINES_TXT ./config.defines.txt @@ -151,34 +126,16 @@ set DUMP_DEFINES_JSON ""; #./config.defines.json # ######################################################################## set flags { + # with-debug:=1 => {Enable debug build flags} - with-tclsh:PATH => {Full pathname of tclsh to use} - with-tcl:DIR => {Directory containing tclConfig.sh} - tcl=1 => {Disable components which require TCL-dev} - test-status => {Enable status of tests} + shared=1 => {Disable build of shared libary} + static=1 => {Disable build of static library (mostly)} + amalgamation=1 => {Disable the amalgamation and instead build all files separately.} + # + # threadsafe=1 => {Disable mutexing} with-tempstore:=no => {Use an in-ram database for temporary tables: never,no,yes,always} - editline=0 => {BSD editline support} - readline=1 => {Disable readline support} largefile=1 => {Disable large file support} - shared=1 => {Disable build of shared libary} - static=1 => {Disable build of static library} - # --with-readline-lib is a backwards-compatible alias for - # --with-readline-ldflags - with-readline-lib: - with-readline-ldflags:=auto - => {Readline LDFLAGS, e.g. -lreadline -lncurses} - # --with-readline-inc is a backwards-compatible alias for - # --with-readline-cflags - with-readline-inc: - with-readline-cflags:=auto - => {Readline CFLAGS, e.g. -I/path/to/includes} - with-readline-header:PATH - => {Full path to readline.h, from which --with-readline-cflags will be derived} - with-linenoise:DIR => {Source directory for linenoise.c and linenoise.h} - with-icu-ldflags:LDFLAGS => {Enable SQLITE_ENABLE_ICU and add the given linker flags for the ICU libraries} - icu-collations=0 => {Enable SQLITE_ENABLE_ICU_COLLATIONS. Requires --with-icu-ldflags=...} - amalgamation=1 => {Disable the amalgamation and instead build all files separately} load-extension=1 => {Disable loading of external extensions} math=1 => {Disable math functions} json=1 => {Disable JSON functions} @@ -192,12 +149,44 @@ set flags { geopoly => {Enable the GEOPOLY extension} rtree => {Enable the RTREE extension} session => {Enable the SESSION extension} - gcov=0 => {Enable coverage testing using gcov} - linemacros => {Enable #line macros in the amalgamation.} + # + # + with-tclsh:PATH => {Full pathname of tclsh to use} + with-tcl:DIR => {Directory containing tclConfig.sh} + tcl=1 => {Disable components which require TCL-dev} + # + # + readline=1 => {Disable readline support} + # --with-readline-lib is a backwards-compatible alias for + # --with-readline-ldflags + with-readline-lib: + with-readline-ldflags:=auto + => {Readline LDFLAGS, e.g. -lreadline -lncurses} + # --with-readline-inc is a backwards-compatible alias for + # --with-readline-cflags + with-readline-inc: + with-readline-cflags:=auto + => {Readline CFLAGS, e.g. -I/path/to/includes} + with-readline-header:PATH + => {Full path to readline.h, from which --with-readline-cflags will be derived} + with-linenoise:DIR => {Source directory for linenoise.c and linenoise.h} + editline=0 => {BSD editline support} + # + # + with-icu-ldflags:LDFLAGS => {Enable SQLITE_ENABLE_ICU and add the given linker flags for the ICU libraries} + icu-collations=0 => {Enable SQLITE_ENABLE_ICU_COLLATIONS. Requires --with-icu-ldflags=...} + # + # with-wasi-sdk:=/opt/wasi-sdk => {Top-most dir of the wasi-sdk for a WASI build} with-emsdk:DIR => {Top-most dir of the Emscripten SDK installation} + # + # + test-status => {Enable status of tests} + gcov=0 => {Enable coverage testing using gcov} + linemacros => {Enable #line macros in the amalgamation.} dump-defines=0 => {Dump autosetup defines to $DUMP_DEFINES_TXT (for build debugging)} + # } if {"" ne $DUMP_DEFINES_JSON} { lappend flags \ @@ -227,7 +216,7 @@ define PACKAGE_BUGREPORT [get-define PACKAGE_URL]/forum msg-result "srcdir = $srcdir" msg-result "top_srcdir = $top_srcdir" -msg-result "VERSION = $PACKAGE_VERSION" +msg-result [hwaci-bold "Configuring SQLite version $PACKAGE_VERSION"] define-append SQLITE_AUTOREMAKE cd '$srcdir' && '$top_srcdir/configure' #{*}$::autosetup(argv) breaks with --flag='val with spaces', so... @@ -235,90 +224,36 @@ foreach arg $::autosetup(argv) { define-append SQLITE_AUTOREMAKE '$arg' } -set outOfTreeBuild 0 + +# Are we cross-compiling? +set cross_compiling [hwaci-is-cross-compiling] if {![file exists sqlite3.pc.in]} { msg-result "This appears to be an out-of-tree build." - set outOfTreeBuild 1 } cc-check-tools ld ar +define OPT_FEATURE_FLAGS {} ; # -DSQLITE_OMIT/ENABLE flags. +define OPT_SHELL {} ; # CFLAGS for the sqlite3 CLI app ######################################################################## -# The build process allows for using a cross-compiler. But the default -# action is to target the same platform that we are running on. The -# configure script needs to discover the following properties of the -# build and target systems: -# -# srcdir -# -# The is the name of the directory that contains the -# "configure" shell script. All source files are -# located relative to this directory. -# -# bindir -# -# The name of the directory where executables should be -# written by the "install" target of the makefile. -# -# program_prefix -# -# Add this prefix to the names of all executables that run -# on the target machine. Default: "" -# -# ENABLE_SHARED -# -# True if shared libraries should be generated. -# -# BUILD_CC -# -# The name of a command that is used to convert C -# source files into executables that run on the build -# platform. -# -# BUILD_CFLAGS -# -# Switches that the build compiler needs in order to construct -# command-line programs. -# -# BUILD_LIBS -# -# Libraries that the build compiler needs in order to construct -# command-line programs. -# -# TCL_* -# -# Lots of values are read in from the tclConfig.sh script, -# if that script is available. This values are used for -# constructing and installing the TCL extension. -# -# TARGET_READLINE_LIBS -# -# This is the library directives passed to the target linker -# that cause the executable to link against the readline library. -# This might be a switch like "-lreadline" or pathnames of library -# file like "../../src/libreadline.a". -# -# TARGET_READLINE_INC -# -# This variables define the directory that contain header -# files for the readline library. If the compiler is able -# to find on its own, then this can be blank. - -# -# OPT_FEATURE_FLAGS = -DSQLITE_OMIT/ENABLE flags. -define OPT_FEATURE_FLAGS {} -define OPT_SHELL {}; # CFLAGS for the sqlite3 CLI app - # Adds $args, if not empty, to OPT_FEATURE_FLAGS. -proc add-feature-flag {args} { +# If the first arg is -shell then it strips that arg +# and passes the remaining args th sqlite-add-shell-opt +# before adding them to OPF_FEATURE_FLAGS. +proc sqlite-add-feature-flag {args} { + set shell "" + if {"-shell" eq [lindex $args 0]} { + set args [lassign $args shell] + } if {"" ne $args} { + if {"" ne $shell} { + sqlite-add-shell-opt {*}$args + } define-append OPT_FEATURE_FLAGS {*}$args } } -# add-feature-flag -DSQLITE_JUST_TESTING=3 - -# Adds $args, if not empty, to OPT_SHELL. -proc add-shell-opt {args} { +# Appends $args, if not empty, to OPT_SHELL. +proc sqlite-add-shell-opt {args} { if {"" ne $args} { define-append OPT_SHELL {*}$args } @@ -328,11 +263,11 @@ hwaci-file-extensions if {".exe" eq [get-define TARGET_EXEEXT]} { define SQLITE_OS_UNIX 0 define SQLITE_OS_WIN 1 - # todo? add -DSQLITE_OS_WIN=1 to CFLAGS? + # todo? add -DSQLITE_OS_WIN=1 to CFLAGS or CFLAGS_sqlite3_os? } else { define SQLITE_OS_UNIX 1 define SQLITE_OS_WIN 0 - # todo? add -DSQLITE_OS_UNIX=1 to CFLAGS? + # todo? add -DSQLITE_OS_UNIX=1 to CFLAGS or CFLAGS_sqlite3_os } ######### @@ -448,7 +383,7 @@ if {[cc-check-includes zlib.h] && [hwaci-check-function-in-lib deflate z]} { # Note that -DSQLITE_HAVE_ZLIB=1 is handled separately from the # other feature flags in the autotools build. Do we need to emulate # that? - add-shell-opt -DSQLITE_HAVE_ZLIB=1 + sqlite-add-shell-opt -DSQLITE_HAVE_ZLIB=1 } else { define HAVE_ZLIB 0 define LDFLAGS_ZLIB "" @@ -745,7 +680,7 @@ unset cgtcl msg-checking "Support threadsafe operation? " hwaci-if-opt-truthy threadsafe { msg-result yes - add-feature-flag -DSQLITE_THREADSAFE=1 + sqlite-add-feature-flag -DSQLITE_THREADSAFE=1 if {![hwaci-check-function-in-lib pthread_create pthread] || ![hwaci-check-function-in-lib pthread_mutexattr_init pthread]} { user-error "Missing required pthread bits" @@ -754,7 +689,7 @@ hwaci-if-opt-truthy threadsafe { undefine lib_pthread_create } { msg-result no - add-feature-flag -DSQLITE_THREADSAFE=0 + sqlite-add-feature-flag -DSQLITE_THREADSAFE=0 define LDFLAGS_PTHREAD "" } @@ -799,6 +734,7 @@ if {1} { # Returns a string describing which line-editing approach to use, or # "none" if no option is available. proc sqlite-check-line-editing {} { + msg-result "Checking for line-editing capability..." define HAVE_READLINE 0 define HAVE_LINENOISE 0 define HAVE_EDITLINE 0 @@ -815,10 +751,10 @@ proc sqlite-check-line-editing {} { } elseif {![file exists $dirLn/linenoise.h] } { hwaci-fatal "Cannot find linenoise.h in $dirLn" } - user-notice "Using linenoise from $dirLn" + msg-result "Using linenoise from $dirLn" define CFLAGS_READLINE "-I$dirLn $dirLn/linenoise.c" define HAVE_LINENOISE 1 - add-shell-opt -DHAVE_LINENOISE=1 + sqlite-add-shell-opt -DHAVE_LINENOISE=1 return "linenoise" } elseif {[opt-bool editline]} { # --enable-editline. The problem is finding a system which has it @@ -848,7 +784,7 @@ proc sqlite-check-line-editing {} { } return "none" } elseif {![opt-bool readline]} { - user-notice "Readline support explicitly disabled with --disable-readline" + msg-result "Readline support explicitly disabled with --disable-readline" return "none" } @@ -920,8 +856,8 @@ proc sqlite-check-line-editing {} { define LDFLAGS_READLINE $rlLib define CFLAGS_READLINE $rlInc define HAVE_READLINE 1 - add-shell-opt -DHAVE_READLINE=1 - user-notice "Using readline flags: $rlInc $rlLib" + sqlite-add-shell-opt -DHAVE_READLINE=1 + msg-result "Using readline flags: $rlInc $rlLib" # Now check whether rl_completion_matches() has a signature we can use. # cctest is producing unexpected test output when using: @@ -937,10 +873,10 @@ proc sqlite-check-line-editing {} { return 0; } }]} { - user-notice "Readline completion enabled" + msg-result "Readline completion enabled" } else { user-notice "WARNING: readline completion disabled due to rl_completion_matches() signature mismatch" - add-shell-opt -DSQLITE_OMIT_READLINE_COMPLETION + sqlite-add-shell-opt -DSQLITE_OMIT_READLINE_COMPLETION } return "readline" } @@ -958,7 +894,7 @@ hwaci-if-opt-truthy load-extension { } } { define LDFLAGS_DLOPEN "" - add-feature-flag {-DSQLITE_OMIT_LOAD_EXTENSION=1} + sqlite-add-feature-flag {-DSQLITE_OMIT_LOAD_EXTENSION=1} msg-result "Disabling loadable extensions." } @@ -968,7 +904,7 @@ hwaci-if-opt-truthy math { } define LDFLAGS_MATH [get-define lib_ceil] undefine lib_ceil - add-feature-flag {-DSQLITE_ENABLE_MATH_FUNCTIONS} + sqlite-add-feature-flag {-DSQLITE_ENABLE_MATH_FUNCTIONS} msg-result "Enabling math SQL functions [get-define LDFLAGS_MATH]" } { define LDFLAGS_MATH "" @@ -992,16 +928,18 @@ if {![get-define HAVE_WASI_SDK] && [hwaci-check-emsdk]} { unset emccsh ######################################################################## -# ICU +# ICU - International Components for Unicode if {"" ne [define LDFLAGS_ICU [join [opt-val with-icu-ldflags ""]]]} { # Flags sets seen in the wild for ICU: - # {-licui18n -licuuc -licudata} {-licui18n -licuuc} - add-feature-flag -DSQLITE_ENABLE_ICU - add-shell-opt -DSQLITE_ENABLE_ICU + # - -licui18n -licuuc -licudata + # - -licui18n -licuuc + # - /usr/local/bin/icu-config --ldflags + sqlite-add-feature-flag -shell -DSQLITE_ENABLE_ICU msg-result "Enabling ICU support with libs: [get-define LDFLAGS_ICU]" if {[opt-bool icu-collations]} { msg-result "Enabling ICU collations." - add-feature-flag -DSQLITE_ENABLE_ICU_COLLATIONS + sqlite-add-feature-flag -shell -DSQLITE_ENABLE_ICU_COLLATIONS + # Recall that shell.c builds with sqlite3.c } } elseif {[opt-bool icu-collations]} { hwaci-warn "ignoring --enable-icu-collations because --with-icu-ldflags was not specified" @@ -1014,7 +952,7 @@ if {"" ne [define LDFLAGS_ICU [join [opt-val with-icu-ldflags ""]]]} { # required linker flags (which may be empty even if the math APIs are # found, depending on the OS). proc affirm-have-math {why} { - if {![hwaci-check-function-in-lib log m]} { + if {![msg-quiet hwaci-check-function-in-lib log m]} { user-error "Missing math APIs for $why" } define LDFLAGS_MATH [get-define lib_log ""] @@ -1023,6 +961,7 @@ proc affirm-have-math {why} { ######################################################################## # Handle various SQLITE_ENABLE_... feature flags. +msg-result "Feature flags..." foreach {boolFlag featureFlag ifSetEvalThis} { all {} { hwaci-opt-set fts4 @@ -1043,33 +982,33 @@ foreach {boolFlag featureFlag ifSetEvalThis} { hwaci-warn "not enabling memsys3 because memsys5 is enabled." expr 0 } else { - add-feature-flag -DSQLITE_ENABLE_MEMSYS3 + sqlite-add-feature-flag -DSQLITE_ENABLE_MEMSYS3 } } } { hwaci-if-opt-truthy $boolFlag { - add-feature-flag $featureFlag + sqlite-add-feature-flag $featureFlag if {0 != [eval $ifSetEvalThis] && "all" ne $boolFlag} { - msg-result "Enabling $boolFlag" + msg-result " - Enabling $boolFlag" } } { - msg-result "Not enabling $boolFlag" + msg-result " - Not enabling $boolFlag" } } ######################################################################## # Invert the above loop's logic for some explicit SQLITE_OMIT_... -# cases. If config option $boolFlag is set, [add-feature-flag +# cases. If config option $boolFlag is set, [sqlite-add-feature-flag # $featureFlag], where $featureFlag is intended to be # -DSQLITE_OMIT_... foreach {boolFlag featureFlag} { json -DSQLITE_OMIT_JSON } { if {[hwaci-opt-truthy $boolFlag]} { - msg-result "Enabling $boolFlag" + msg-result " - Enabling $boolFlag" } else { - add-feature-flag $featureFlag - msg-result "Disabling $boolFlag" + sqlite-add-feature-flag $featureFlag + msg-result " - Disabling $boolFlag" } } @@ -1155,9 +1094,8 @@ if {"" ne $DUMP_DEFINES_JSON} { ######################################################################## # Some build-dev/debug-only output hwaci-if-opt-truthy dump-defines { - global DUMP_DEFINES_TXT - msg-result "--dump-defines is creating $DUMP_DEFINES_TXT" - make-config-header $DUMP_DEFINES_TXT \ + msg-result "--dump-defines is creating $::DUMP_DEFINES_TXT" + make-config-header $::DUMP_DEFINES_TXT \ -bare {SQLITE_OS* SQLITE_DEBUG USE_*} \ -str {BIN_* CC LD AR LDFLAG* OPT_*} \ -auto {*} @@ -1170,4 +1108,4 @@ hwaci-if-opt-truthy dump-defines { } } -msg-result "Done! Now run make." +msg-result [hwaci-bold "Source tree is configured! Run make to build it."] diff --git a/autosetup/hwaci-common.tcl b/autosetup/hwaci-common.tcl index 611238f080..1cde5703c7 100644 --- a/autosetup/hwaci-common.tcl +++ b/autosetup/hwaci-common.tcl @@ -12,25 +12,28 @@ # Routines for Steve Bennett's autosetup which are common to trees # managed in and around the umbrella of the SQLite project. # -# Routines with a suffix of _ are intended for internal use, -# within this file, and are not part of the API which auto.def files -# should rely on. -# # This file was initially derived from one used in the libfossil -# project, authored by the same person who ported it here, noted here -# only as an indication that there are no licensing issue despite this -# code having at least two near-twins running around in other trees. +# 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 at least two near-twins running around a +# handful of third-party source trees. # ######################################################################## # -# Design notes: by and large, autosetup prefers to update global state -# with the results of feature checks, e.g. whether the compiler -# supports flag --X. In this developer's opinion that (A) causes more -# confusion than it solves[^1] and (B) adds an unnecessary layer of -# "voodoo" between the autosetup user and its internals. This module, -# in contrast, instead injects the results of its own tests into -# well-defined variables and leaves the integration of those values to -# the caller's discretion. +# Design notes: +# +# - Symbols with a suffix of _ are intended for internal use within +# this file, and are not part of the API which auto.def files should +# rely on. +# +# - By and large, autosetup prefers to update global state with the +# results of feature checks, e.g. whether the compiler supports flag +# --X. In this developer's opinion that (A) causes more confusion +# than it solves[^1] and (B) adds an unnecessary layer of "voodoo" +# between the autosetup user and its internals. This module, in +# contrast, instead injects the results of its own tests into +# well-defined variables and leaves the integration of those values +# to the caller's discretion. # # [1]: As an example: testing for the -rpath flag, using # cc-check-flags, can break later checks which use @@ -45,25 +48,37 @@ # $hwaci_ is an internal-use-only array for storing whatever generic # internal stuff we need stored. array set hwaci_ {} +set hwaci_(isatty) [isatty? stdout] proc hwaci-warn {msg} { puts stderr "WARNING: $msg" } -#proc hwaci-notice {msg} { -# puts stderr "NOTICE: $msg" -#} proc hwaci-fatal {msg} { - user-error "ERROR: $msg" + show-notices + puts stderr "ERROR: $msg" + exit 1 +} + +######################################################################## +# 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 hwaci-bold {str} { + if {$::autosetup(iswin) || !$::hwaci_(isatty)} { + return $str + } + return "\033\[1m${str}\033\[0m" } ######################################################################## # Takes a multi-line message and emits it with consistent indentation -# using user-notice (which means its rendering will be delayed until -# the next time autosetup goes to output a message). +# using [user-notice] (which means its rendering will (A) go to stderr +# and (B) be delayed until the next time autosetup goes to output a +# message). proc hwaci-indented-notice {msg} { set lines [split $msg \n] foreach line $lines { - user-notice " [string trim $line]" + user-notice " [string trimleft $line]" } } @@ -98,7 +113,7 @@ proc hwaci-lshift_ {listVar {count 1}} { # out any lines which begin with an number of whitespace followed by a # '#', and returns a value containing the [append]ed results of each # remaining line with a \n between each. -proc hwaci-strip-comments {val} { +proc hwaci-strip-hash-comments_ {val} { set x {} foreach line [split $val \n] { if {![string match "#*" [string trimleft $line]]} { @@ -1020,7 +1035,7 @@ proc hwaci-dump-defs-json {file args} { # names, so that in the above example [opt-value canonical] will # return X if --alias=X is passed in. proc hwaci-xfer-options-aliases {mapping} { - foreach {hidden => canonical} [hwaci-strip-comments $mapping] { + foreach {hidden => canonical} [hwaci-strip-hash-comments_ $mapping] { set x [opt-val $hidden "~9~9~9~"] if {"~9~9~9~" ne $x} { if {"~0~0~0~" eq [opt-val $canonical "~0~0~0~"]} { @@ -1031,3 +1046,28 @@ proc hwaci-xfer-options-aliases {mapping} { } } } + +######################################################################## +# Arguable/debatable... +# +# When _not_ cross-compiling and CC_FOR_BUILD is _not_ explcitely +# specified, force CC_FOR_BUILD to be the same as CC, so that: +# +# ./configure CC=clang +# +# will use CC_FOR_BUILD=clang, instead of cc, for building in-tree +# tools. This is based off of an email discussion and is thought to +# be likely to cause less confusion than seeing 'cc' invocations +# will when the user passes CC=clang. +# +# 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: +proc hwaci-redefine-cc-for-build {} { + if {![hwaci-is-cross-compiling] + && "nope" eq [get-env CC_FOR_BUILD "nope"] + && [get-define CC] ne [get-define CC_FOR_BUILD]} { + user-notice "Re-defining CC_FOR_BUILD to CC=[get-define CC]. To avoid this, explicitly pass CC_FOR_BUILD=..." + define CC_FOR_BUILD [get-define CC] + } +} diff --git a/main.mk b/main.mk index 3b58767c2b..2c8f64324e 100644 --- a/main.mk +++ b/main.mk @@ -2075,6 +2075,15 @@ sqlite3.dll: $(LIBOBJ) sqlite3.def $(T.cc.sqlite) $(LDFLAGS.shobj) -o $@ sqlite3.def \ -Wl,"--strip-all" $(LIBOBJ) +# +# Emit a list of commonly-used targets +help: + @echo "Frequently-used high-level make targets:"; \ + echo " - all (default) = builds most components"; \ + echo " - clean = cleans up most build products"; \ + echo " - distclean = cleans up all build products"; \ + echo "...and many more" + # Remove build products sufficient so that subsequent makes will recompile # everything from scratch. Do not remove: diff --git a/manifest b/manifest index 9d55604594..b44839c988 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Generic\scleanups\sin\sauto.def\sand\shwaci-common.tcl. -D 2024-10-27T20:46:09.058 +C Re-order\sthe\sauto.def\sflags\slogical\sgroups.\sAdd\ssome\sdiscrete\sbold\sformatting\sto\sselect\sconfigure\soutput.\sRemove\ssome\sdead\scode.\sAccount\sfor\sbehavior\smisunderstanding\sof\suser-notice.\sAdd\sthe\sstart\sof\sa\s'make\shelp'\starget.\sGeneral\scosmetic\scleanups. +D 2024-10-27T22:18:33.718 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md b6e6c1baf38e4339bd3f1e0e5e5bfd0a9a93d133360691b2785c2d4b2f2dcec2 @@ -13,7 +13,7 @@ F art/icon-80x90.gif 65509ce3e5f86a9cd64fe7fca2d23954199f31fe44c1e09e208c80fb83d F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2 F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90 F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2 -F auto.def dd9bda48dc2a4c515d1a518f342b992c1cdea46c0d4e20a25d515ab423de2d49 +F auto.def 10eac711b57bce9705555c052e8970e62aa6754b91e1ff37a51c50b040cc4897 F autoconf/INSTALL 83e4a25da9fd053c7b3665eaaaf7919707915903 F autoconf/Makefile.am adedc1324b6a87fdd1265ddd336d2fb7d4f36a0e77b86ea553ae7cc4ea239347 F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac @@ -47,7 +47,7 @@ F autosetup/cc-lib.tcl 493c5935b5dd3bf9bd4eca89b07c8b1b1a9356d61783035144e21795f F autosetup/cc-shared.tcl 4f024e94a47f427ba61de1739f6381ef0080210f9fae89112d5c1de1e5460d78 F autosetup/cc.tcl 7e2fe943ae9d45cf39e9f5b05b6230df8e719415edea5af06c30eb68680bde14 F autosetup/default.auto 5cdf016de2140e50f1db190a02039dc42fb390af1dda4cc4853e3042a9ef0e82 -F autosetup/hwaci-common.tcl c6a68fe4ad416db70260bc0f8a85ee9f52d6976ca796aaa8ae013a1bf632b49d +F autosetup/hwaci-common.tcl bc48c6ddfcd33a0eaf17f1709cde60622ff29c479e0356e8c6bcabe5b58a4d51 F autosetup/jimsh0.c 27ea5f221359ef6c58780fc6c185aadbf8d3bee9a021331a3e5de0eba0dc6de6 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba F autosetup/system.tcl 3a39d6e0b3bfba526fd39afe07c1d0d325e5a31925013a1ba7c671e1128e31bb @@ -707,7 +707,7 @@ F ext/wasm/wasmfs.make bc8bb227f35d5bd3863a7bd2233437c37472a0d81585979f058f9b9b5 F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8 F magic.txt 5ade0bc977aa135e79e3faaea894d5671b26107cc91e70783aa7dc83f22f3ba0 -F main.mk d943a2d0a0deb14daea10e036ef3a55e1b641cd57f5893a2fba29e65cc33acc0 +F main.mk 7533ef1b3a1338b96445a672ba6dbfa48279f05089a0555ff8822dcd1dcb000a F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271 F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504 F mptest/crash01.test 61e61469e257df0850df4293d7d4d6c2af301421 @@ -2237,8 +2237,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 37a1da038195365cd7eb866b3aa749ad8060a656ac38063520fdb70cf0a0e5f1 -R 4a5971ae5787ab5ca5bc6c1b2940924e +P 428e542452bac99d48950f1f62b65b4e235636540b946151747e2d5b59dbfd99 +R c11fb367c51c71ad6dcdc1b5cebfcffd U stephan -Z f7c559f6f234bc23301783ef1baa5b93 +Z 989475d21f0d39382974a32645a7533c # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index bc0860a133..31638cc682 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -428e542452bac99d48950f1f62b65b4e235636540b946151747e2d5b59dbfd99 +ab95ee33dfe56bd3b223f978626e6014414881c30443a2b88c782de724c39ae1 From e550d98bbf89f90c8bb547f7e54d03c9e1b4dae7 Mon Sep 17 00:00:00 2001 From: stephan Date: Sun, 27 Oct 2024 22:34:07 +0000 Subject: [PATCH 10/15] Expand the 'make help' target and clean up some overly-noisy configure output. FossilOrigin-Name: c895766ed31f55c02f05d357333e9cf45e82ec5af4d8b0491270e4fda7a57d42 --- auto.def | 12 +++++++----- main.mk | 20 +++++++++++++++++--- manifest | 14 +++++++------- manifest.uuid | 2 +- 4 files changed, 32 insertions(+), 16 deletions(-) diff --git a/auto.def b/auto.def index 07502b966f..b4201b79c1 100644 --- a/auto.def +++ b/auto.def @@ -873,9 +873,9 @@ proc sqlite-check-line-editing {} { return 0; } }]} { - msg-result "Readline completion enabled" } else { user-notice "WARNING: readline completion disabled due to rl_completion_matches() signature mismatch" + show-notices sqlite-add-shell-opt -DSQLITE_OMIT_READLINE_COMPLETION } return "readline" @@ -989,10 +989,12 @@ foreach {boolFlag featureFlag ifSetEvalThis} { hwaci-if-opt-truthy $boolFlag { sqlite-add-feature-flag $featureFlag if {0 != [eval $ifSetEvalThis] && "all" ne $boolFlag} { - msg-result " - Enabling $boolFlag" + msg-result " + $boolFlag" } } { - msg-result " - Not enabling $boolFlag" + if {"all" ne $boolFlag} { + msg-result " - $boolFlag" + } } } @@ -1005,10 +1007,10 @@ foreach {boolFlag featureFlag} { json -DSQLITE_OMIT_JSON } { if {[hwaci-opt-truthy $boolFlag]} { - msg-result " - Enabling $boolFlag" + msg-result " + $boolFlag" } else { sqlite-add-feature-flag $featureFlag - msg-result " - Disabling $boolFlag" + msg-result " - $boolFlag" } } diff --git a/main.mk b/main.mk index 2c8f64324e..a815354471 100644 --- a/main.mk +++ b/main.mk @@ -2078,11 +2078,25 @@ sqlite3.dll: $(LIBOBJ) sqlite3.def # # Emit a list of commonly-used targets help: - @echo "Frequently-used high-level make targets:"; \ - echo " - all (default) = builds most components"; \ + @echo; echo "Frequently-used high-level make targets:"; echo; \ + echo " - all [default] = builds most components"; \ echo " - clean = cleans up most build products"; \ echo " - distclean = cleans up all build products"; \ - echo "...and many more" + echo " - install = installs activated components"; \ + echo; echo "Testing-related targets:"; echo; \ + echo " - test = a number of sanity checks"; \ + echo " - quicktest = minimal tests"; \ + echo " - releasetest = pre-release tests"; \ + echo " - devtest = Minimum tests required before code check-ins"; \ + echo " - mdevtest = A variant of devtest"; \ + echo " - sdevtest = A variant of devtest"; \ + echo " - tcltest = Runs test/veryquick.test"; \ + echo " - testrunner = Like tcltest but spread across multiple cores"; \ + echo " - fuzztest = The core fuzz tester (see target docs for important info)"; \ + echo " - valgrindfuzz = Runs fuzztest under valgrind"; \ + echo " - soaktest = Really, really long tests"; \ + echo " - alltest = Runs most or all TCL tests"; \ + echo # Remove build products sufficient so that subsequent makes will recompile diff --git a/manifest b/manifest index b44839c988..d9d6800c4b 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Re-order\sthe\sauto.def\sflags\slogical\sgroups.\sAdd\ssome\sdiscrete\sbold\sformatting\sto\sselect\sconfigure\soutput.\sRemove\ssome\sdead\scode.\sAccount\sfor\sbehavior\smisunderstanding\sof\suser-notice.\sAdd\sthe\sstart\sof\sa\s'make\shelp'\starget.\sGeneral\scosmetic\scleanups. -D 2024-10-27T22:18:33.718 +C Expand\sthe\s'make\shelp'\starget\sand\sclean\sup\ssome\soverly-noisy\sconfigure\soutput. +D 2024-10-27T22:34:07.986 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md b6e6c1baf38e4339bd3f1e0e5e5bfd0a9a93d133360691b2785c2d4b2f2dcec2 @@ -13,7 +13,7 @@ F art/icon-80x90.gif 65509ce3e5f86a9cd64fe7fca2d23954199f31fe44c1e09e208c80fb83d F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2 F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90 F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2 -F auto.def 10eac711b57bce9705555c052e8970e62aa6754b91e1ff37a51c50b040cc4897 +F auto.def ccbcecdf3a348fb463cd11e5fbcc1b2954059103e99531bf84d18a5f56c1351f F autoconf/INSTALL 83e4a25da9fd053c7b3665eaaaf7919707915903 F autoconf/Makefile.am adedc1324b6a87fdd1265ddd336d2fb7d4f36a0e77b86ea553ae7cc4ea239347 F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac @@ -707,7 +707,7 @@ F ext/wasm/wasmfs.make bc8bb227f35d5bd3863a7bd2233437c37472a0d81585979f058f9b9b5 F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8 F magic.txt 5ade0bc977aa135e79e3faaea894d5671b26107cc91e70783aa7dc83f22f3ba0 -F main.mk 7533ef1b3a1338b96445a672ba6dbfa48279f05089a0555ff8822dcd1dcb000a +F main.mk 4b0bcec36d5cc83fd60d9c10666f1493c8835cec11b67b3c980ae021e225db03 F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271 F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504 F mptest/crash01.test 61e61469e257df0850df4293d7d4d6c2af301421 @@ -2237,8 +2237,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 428e542452bac99d48950f1f62b65b4e235636540b946151747e2d5b59dbfd99 -R c11fb367c51c71ad6dcdc1b5cebfcffd +P ab95ee33dfe56bd3b223f978626e6014414881c30443a2b88c782de724c39ae1 +R 4f2f3f9048608d15144b74fa8694e059 U stephan -Z 989475d21f0d39382974a32645a7533c +Z f0d4b898dbccc821754c02bc4f1ee2af # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 31638cc682..dd090aaa96 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -ab95ee33dfe56bd3b223f978626e6014414881c30443a2b88c782de724c39ae1 +c895766ed31f55c02f05d357333e9cf45e82ec5af4d8b0491270e4fda7a57d42 From 1682fedaa0bade7f1ba5efba056374ccf81f5085 Mon Sep 17 00:00:00 2001 From: stephan Date: Mon, 28 Oct 2024 00:56:31 +0000 Subject: [PATCH 11/15] Add --with-icu-config flag to use the icu-config binary to find the required ldflags for linking the ICU libraries. FossilOrigin-Name: 64f33bb125102b3fec3901f4b56098429509ec0b6ce6e6b88af2393c344ac864 --- auto.def | 88 ++++++++++++++++++++++++++++++++------ autosetup/hwaci-common.tcl | 11 ++++- manifest | 14 +++--- manifest.uuid | 2 +- 4 files changed, 94 insertions(+), 21 deletions(-) diff --git a/auto.def b/auto.def index b4201b79c1..a1a7043a01 100644 --- a/auto.def +++ b/auto.def @@ -173,8 +173,10 @@ set flags { editline=0 => {BSD editline support} # # - with-icu-ldflags:LDFLAGS => {Enable SQLITE_ENABLE_ICU and add the given linker flags for the ICU libraries} - icu-collations=0 => {Enable SQLITE_ENABLE_ICU_COLLATIONS. Requires --with-icu-ldflags=...} + with-icu-ldflags:LDFLAGS + => {Enable SQLITE_ENABLE_ICU and add the given linker flags for the ICU libraries} + icu-collations=0 => {Enable SQLITE_ENABLE_ICU_COLLATIONS. Requires --with-icu-ldflags=...} + with-icu-config:=auto => {Enable SQLITE_ENABLE_ICU and fetch linker flags from the given icu-config binary} # # with-wasi-sdk:=/opt/wasi-sdk @@ -878,6 +880,26 @@ proc sqlite-check-line-editing {} { show-notices sqlite-add-shell-opt -DSQLITE_OMIT_READLINE_COMPLETION } + + # Now check whether rl_completion_matches() has a signature we can use. + # cctest is producing unexpected test output when using: + # -includes {stdio.h readline/readline.h} + # so we have to use -source instead and write the whole test app inline + if {[cctest \ + -cflags $rlInc -libs $rlLib -nooutput 1 -source { + #include + #include + static char * rcg(const char *z, int i){return 0;} + int main(void) { + char ** x = rl_completion_matches("one", rcg); + return 0; + } + }]} { + user-notice "Readline completion enabled" + } else { + user-notice "WARNING: readline completion disabled due to rl_completion_matches() signature mismatch" + add-shell-opt -DSQLITE_OMIT_READLINE_COMPLETION + } return "readline" } @@ -929,21 +951,63 @@ unset emccsh ######################################################################## # ICU - International Components for Unicode -if {"" ne [define LDFLAGS_ICU [join [opt-val with-icu-ldflags ""]]]} { +# +# Handles these flags: +# +# --with-icu-ldflags=LDFLAGS +# --with-icu-config[=/path/to/icu-config] +# --enable-icu-collations +# +# If both icu-ldflags and 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 can automatically enable ICU if the +# icu-config binary is found, we specifically do not. ICU is always an +# opt-in feature. +proc sqlite-check-icu {} { + define LDFLAGS_ICU [join [opt-val with-icu-ldflags ""]] # Flags sets seen in the wild for ICU: # - -licui18n -licuuc -licudata # - -licui18n -licuuc # - /usr/local/bin/icu-config --ldflags - sqlite-add-feature-flag -shell -DSQLITE_ENABLE_ICU - msg-result "Enabling ICU support with libs: [get-define LDFLAGS_ICU]" - if {[opt-bool icu-collations]} { - msg-result "Enabling ICU collations." - sqlite-add-feature-flag -shell -DSQLITE_ENABLE_ICU_COLLATIONS - # Recall that shell.c builds with sqlite3.c + if {[hwaci-opt-was-provided with-icu-config]} { + set bin [opt-val with-icu-config] + if {"auto" eq $bin} { + set bin [hwaci-first-bin-of \ + [get-define prefix]/bin/icu-config \ + /usr/local/bin/icu-config \ + /usr/bin/icu-config] + if {"" eq $bin} { + hwaci-fatal "--with-icu-config=auto cannot find icu-config binary" + } + } + if {[file-isexec $bin]} { + set x [exec $bin --ldflags] + if {"" eq $x} { + hwaci-fatal "$bin --ldflags returned no data" + } + define-append LDFLAGS_ICU $x + } else { + hwaci-fatal "--with-icu-config=$bin does not refer to an executable" + } } -} elseif {[opt-bool icu-collations]} { - hwaci-warn "ignoring --enable-icu-collations because --with-icu-ldflags was not specified" -} + set flags [define LDFLAGS_ICU [string trim [get-define LDFLAGS_ICU]]] + if {"" ne $flags} { + sqlite-add-feature-flag -shell -DSQLITE_ENABLE_ICU + msg-result "Enabling ICU support with libs: $flags" + if {[opt-bool icu-collations]} { + msg-result "Enabling ICU collations." + sqlite-add-feature-flag -shell -DSQLITE_ENABLE_ICU_COLLATIONS + # Recall that shell.c builds with sqlite3.c + } + } elseif {[opt-bool icu-collations]} { + hwaci-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-check-icu +sqlite-check-icu ######################################################################## # Check for log(3) in libm and die with an error if it is not diff --git a/autosetup/hwaci-common.tcl b/autosetup/hwaci-common.tcl index 1cde5703c7..126cad2550 100644 --- a/autosetup/hwaci-common.tcl +++ b/autosetup/hwaci-common.tcl @@ -187,7 +187,7 @@ proc hwaci-find-executable-path {args} { set verbose 0 if {[lindex $args 0] eq "-v"} { set verbose 1 - set binName [lrange $args 1 end] + set args [lassign $args - binName] msg-checking "Looking for $binName ... " } set check [find-executable-path $binName] @@ -255,6 +255,15 @@ proc hwaci-require-bash {} { return $bash } +######################################################################## +# Returns 1 if the user specifically provided the given configure +# flag, else 0. This can be used to distinguish between options which +# have a default value and those which were specifically provided by +# the user. +proc hwaci-opt-was-provided {key} { + return [dict exists $::autosetup(optset) $key] +} + ######################################################################## # Force-set autosetup option $flag to $val. The value can be fetched # later with [opt-val], [opt-bool], and friends. diff --git a/manifest b/manifest index d9d6800c4b..8862d9b64c 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Expand\sthe\s'make\shelp'\starget\sand\sclean\sup\ssome\soverly-noisy\sconfigure\soutput. -D 2024-10-27T22:34:07.986 +C Add\s--with-icu-config\sflag\sto\suse\sthe\sicu-config\sbinary\sto\sfind\sthe\srequired\sldflags\sfor\slinking\sthe\sICU\slibraries. +D 2024-10-28T00:56:31.767 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md b6e6c1baf38e4339bd3f1e0e5e5bfd0a9a93d133360691b2785c2d4b2f2dcec2 @@ -13,7 +13,7 @@ F art/icon-80x90.gif 65509ce3e5f86a9cd64fe7fca2d23954199f31fe44c1e09e208c80fb83d F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2 F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90 F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2 -F auto.def ccbcecdf3a348fb463cd11e5fbcc1b2954059103e99531bf84d18a5f56c1351f +F auto.def a876018881cc52bd5ac45015d460164fa0c5bc0c92bb820aee3b49c3f38d1394 F autoconf/INSTALL 83e4a25da9fd053c7b3665eaaaf7919707915903 F autoconf/Makefile.am adedc1324b6a87fdd1265ddd336d2fb7d4f36a0e77b86ea553ae7cc4ea239347 F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac @@ -47,7 +47,7 @@ F autosetup/cc-lib.tcl 493c5935b5dd3bf9bd4eca89b07c8b1b1a9356d61783035144e21795f F autosetup/cc-shared.tcl 4f024e94a47f427ba61de1739f6381ef0080210f9fae89112d5c1de1e5460d78 F autosetup/cc.tcl 7e2fe943ae9d45cf39e9f5b05b6230df8e719415edea5af06c30eb68680bde14 F autosetup/default.auto 5cdf016de2140e50f1db190a02039dc42fb390af1dda4cc4853e3042a9ef0e82 -F autosetup/hwaci-common.tcl bc48c6ddfcd33a0eaf17f1709cde60622ff29c479e0356e8c6bcabe5b58a4d51 +F autosetup/hwaci-common.tcl e3913fd13debb4e0382c9e68ae46c61f9bc1afcfd2e9996a9b43557deefefb03 F autosetup/jimsh0.c 27ea5f221359ef6c58780fc6c185aadbf8d3bee9a021331a3e5de0eba0dc6de6 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba F autosetup/system.tcl 3a39d6e0b3bfba526fd39afe07c1d0d325e5a31925013a1ba7c671e1128e31bb @@ -2237,8 +2237,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P ab95ee33dfe56bd3b223f978626e6014414881c30443a2b88c782de724c39ae1 -R 4f2f3f9048608d15144b74fa8694e059 +P c895766ed31f55c02f05d357333e9cf45e82ec5af4d8b0491270e4fda7a57d42 +R 0c3cc11e229eb9f60e9d6e1a23d1a429 U stephan -Z f0d4b898dbccc821754c02bc4f1ee2af +Z cf4b95e7dea0c78a9db6ff8b45d5a758 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index dd090aaa96..0c41ed5c78 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -c895766ed31f55c02f05d357333e9cf45e82ec5af4d8b0491270e4fda7a57d42 +64f33bb125102b3fec3901f4b56098429509ec0b6ce6e6b88af2393c344ac864 From 36cb4d03acabbb3ff04f4cc5e36694b00a8cc7c0 Mon Sep 17 00:00:00 2001 From: stephan Date: Mon, 28 Oct 2024 01:13:00 +0000 Subject: [PATCH 12/15] Docs and small code cleanups in hwaci-common.tcl. FossilOrigin-Name: 1353d4b600ae2849d2591b3fba0cad71289ee996334222a6886dc01cd4be5c07 --- autosetup/hwaci-common.tcl | 19 ++++++++++++++++--- manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/autosetup/hwaci-common.tcl b/autosetup/hwaci-common.tcl index 126cad2550..8dc76d4f15 100644 --- a/autosetup/hwaci-common.tcl +++ b/autosetup/hwaci-common.tcl @@ -258,15 +258,27 @@ proc hwaci-require-bash {} { ######################################################################## # Returns 1 if the user specifically provided the given configure # flag, else 0. This can be used to distinguish between options which -# have a default value and those which were specifically provided by -# the user. +# have a default value and those which were explicitly provided by the +# user, even if the latter is done in a way which uses the default +# value. +# +# For example, with a configure flag defined like: +# +# { foo-bar:=baz => {its help text} } +# +# This function will, when passed foo-bar, return 1 only if the user +# passes --foo-bar to configure, even if that invocation would resolve +# 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. proc hwaci-opt-was-provided {key} { - return [dict exists $::autosetup(optset) $key] + dict exists $::autosetup(optset) $key } ######################################################################## # Force-set autosetup option $flag to $val. The value can be fetched # later with [opt-val], [opt-bool], and friends. +# +# Returns $val. proc hwaci-opt-set {flag {val 1}} { global autosetup if {$flag ni $::autosetup(options)} { @@ -275,6 +287,7 @@ proc hwaci-opt-set {flag {val 1}} { lappend ::autosetup(options) $flag } dict set ::autosetup(optset) $flag $val + return $val } ######################################################################## diff --git a/manifest b/manifest index 8862d9b64c..dec3d45e47 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\s--with-icu-config\sflag\sto\suse\sthe\sicu-config\sbinary\sto\sfind\sthe\srequired\sldflags\sfor\slinking\sthe\sICU\slibraries. -D 2024-10-28T00:56:31.767 +C Docs\sand\ssmall\scode\scleanups\sin\shwaci-common.tcl. +D 2024-10-28T01:13:00.918 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md b6e6c1baf38e4339bd3f1e0e5e5bfd0a9a93d133360691b2785c2d4b2f2dcec2 @@ -47,7 +47,7 @@ F autosetup/cc-lib.tcl 493c5935b5dd3bf9bd4eca89b07c8b1b1a9356d61783035144e21795f F autosetup/cc-shared.tcl 4f024e94a47f427ba61de1739f6381ef0080210f9fae89112d5c1de1e5460d78 F autosetup/cc.tcl 7e2fe943ae9d45cf39e9f5b05b6230df8e719415edea5af06c30eb68680bde14 F autosetup/default.auto 5cdf016de2140e50f1db190a02039dc42fb390af1dda4cc4853e3042a9ef0e82 -F autosetup/hwaci-common.tcl e3913fd13debb4e0382c9e68ae46c61f9bc1afcfd2e9996a9b43557deefefb03 +F autosetup/hwaci-common.tcl 0cf12e082cc5045eba20aa323d5139bd3893a2cedcecdccbc8331b069c783d43 F autosetup/jimsh0.c 27ea5f221359ef6c58780fc6c185aadbf8d3bee9a021331a3e5de0eba0dc6de6 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba F autosetup/system.tcl 3a39d6e0b3bfba526fd39afe07c1d0d325e5a31925013a1ba7c671e1128e31bb @@ -2237,8 +2237,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P c895766ed31f55c02f05d357333e9cf45e82ec5af4d8b0491270e4fda7a57d42 -R 0c3cc11e229eb9f60e9d6e1a23d1a429 +P 64f33bb125102b3fec3901f4b56098429509ec0b6ce6e6b88af2393c344ac864 +R b9a4b55e0b90ed0b1b286d5c8ffe18f5 U stephan -Z cf4b95e7dea0c78a9db6ff8b45d5a758 +Z 103ccefab8e9ee7baf6989214f50afc6 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 0c41ed5c78..016a828e90 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -64f33bb125102b3fec3901f4b56098429509ec0b6ce6e6b88af2393c344ac864 +1353d4b600ae2849d2591b3fba0cad71289ee996334222a6886dc01cd4be5c07 From 5a6dc86df2d1027d0bd72d68b65a2be18cd52570 Mon Sep 17 00:00:00 2001 From: stephan Date: Mon, 28 Oct 2024 02:11:51 +0000 Subject: [PATCH 13/15] Have --enable-editline fail rather than emit a warning which would easily be overlooked by automated builds. The error message explains a potential workaround for activating libedit. FossilOrigin-Name: 2bd1b9557a1619adcaf5aa6dc5d5d0972e8416dafc9f36621b409192be95223d --- auto.def | 11 ++++++----- autosetup/hwaci-common.tcl | 15 +++++++++++++-- manifest | 14 +++++++------- manifest.uuid | 2 +- 4 files changed, 27 insertions(+), 15 deletions(-) diff --git a/auto.def b/auto.def index a1a7043a01..8e708a7e7b 100644 --- a/auto.def +++ b/auto.def @@ -776,13 +776,14 @@ proc sqlite-check-line-editing {} { # --enable-editline to do exactly that but it seems likely to # break on systems for which which HAVE_EDITLINE=1 previously # worked. - hwaci-indented-notice { - WARNING: the --enable-editline flag is not supported due to + hwaci-indented-notice -error { + ERROR: the --enable-editline flag is not supported due to non-availability of systems which have it in a form which the sqlite3 CLI shell expects to see. On some systems this can be - worked around by passing --with-readline-ldflags=-ledit instead of - --enable-editline, which will attempt to use the readline.h - supplied by libreadline but link against -ledit. + worked around by passing --with-readline-ldflags=-ledit instead + of --enable-editline, which will attempt to use the readline.h + supplied by libreadline but link against -ledit. On systems + tested so far, that works. } return "none" } elseif {![opt-bool readline]} { diff --git a/autosetup/hwaci-common.tcl b/autosetup/hwaci-common.tcl index 8dc76d4f15..053a30a370 100644 --- a/autosetup/hwaci-common.tcl +++ b/autosetup/hwaci-common.tcl @@ -75,11 +75,22 @@ proc hwaci-bold {str} { # using [user-notice] (which means its rendering will (A) go to stderr # and (B) be delayed until the next time autosetup goes to output a # message). -proc hwaci-indented-notice {msg} { - set lines [split $msg \n] +# +# If its first argument is -error then it renders the message +# immediately and then exits. +proc hwaci-indented-notice {args} { + set fErr "" + switch -exact -- [lindex $args 0] { + -error { set args [lassign $args fErr] } + } + set lines [split [join $args] \n] foreach line $lines { user-notice " [string trimleft $line]" } + if {"" ne $fErr} { + show-notices + exit 1 + } } ######################################################################## diff --git a/manifest b/manifest index dec3d45e47..6fe2eecd7a 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Docs\sand\ssmall\scode\scleanups\sin\shwaci-common.tcl. -D 2024-10-28T01:13:00.918 +C Have\s--enable-editline\sfail\srather\sthan\semit\sa\swarning\swhich\swould\seasily\sbe\soverlooked\sby\sautomated\sbuilds.\sThe\serror\smessage\sexplains\sa\spotential\sworkaround\sfor\sactivating\slibedit. +D 2024-10-28T02:11:51.336 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md b6e6c1baf38e4339bd3f1e0e5e5bfd0a9a93d133360691b2785c2d4b2f2dcec2 @@ -13,7 +13,7 @@ F art/icon-80x90.gif 65509ce3e5f86a9cd64fe7fca2d23954199f31fe44c1e09e208c80fb83d F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2 F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90 F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2 -F auto.def a876018881cc52bd5ac45015d460164fa0c5bc0c92bb820aee3b49c3f38d1394 +F auto.def 33b45a5d8a51f0f8a211c8983c1c7306120a672f4c37dccf8b3e4c343c8d4569 F autoconf/INSTALL 83e4a25da9fd053c7b3665eaaaf7919707915903 F autoconf/Makefile.am adedc1324b6a87fdd1265ddd336d2fb7d4f36a0e77b86ea553ae7cc4ea239347 F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac @@ -47,7 +47,7 @@ F autosetup/cc-lib.tcl 493c5935b5dd3bf9bd4eca89b07c8b1b1a9356d61783035144e21795f F autosetup/cc-shared.tcl 4f024e94a47f427ba61de1739f6381ef0080210f9fae89112d5c1de1e5460d78 F autosetup/cc.tcl 7e2fe943ae9d45cf39e9f5b05b6230df8e719415edea5af06c30eb68680bde14 F autosetup/default.auto 5cdf016de2140e50f1db190a02039dc42fb390af1dda4cc4853e3042a9ef0e82 -F autosetup/hwaci-common.tcl 0cf12e082cc5045eba20aa323d5139bd3893a2cedcecdccbc8331b069c783d43 +F autosetup/hwaci-common.tcl 064900a2e7512e6e1ce9f25bb74d6850574d294b026885f0329dbe69585407dd F autosetup/jimsh0.c 27ea5f221359ef6c58780fc6c185aadbf8d3bee9a021331a3e5de0eba0dc6de6 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba F autosetup/system.tcl 3a39d6e0b3bfba526fd39afe07c1d0d325e5a31925013a1ba7c671e1128e31bb @@ -2237,8 +2237,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 64f33bb125102b3fec3901f4b56098429509ec0b6ce6e6b88af2393c344ac864 -R b9a4b55e0b90ed0b1b286d5c8ffe18f5 +P 1353d4b600ae2849d2591b3fba0cad71289ee996334222a6886dc01cd4be5c07 +R c5d541f8ce498a3c24d538d7cf4698ef U stephan -Z 103ccefab8e9ee7baf6989214f50afc6 +Z 8668cf4e3948e2d9e4ce3d2e5557772d # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 016a828e90..b9ceddc997 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -1353d4b600ae2849d2591b3fba0cad71289ee996334222a6886dc01cd4be5c07 +2bd1b9557a1619adcaf5aa6dc5d5d0972e8416dafc9f36621b409192be95223d From 99438c843c294475ec8093e4485c14bd4392ee9b Mon Sep 17 00:00:00 2001 From: stephan Date: Mon, 28 Oct 2024 02:46:57 +0000 Subject: [PATCH 14/15] Correct the default config value for HAVE_TCL (0 until proven otherwise) and fix the starting dir for SQLITE_AUTORECONFIG (formerly SQLITE_AUTOREMAKE), as reported in [forum:8ab69387008f2f6c | forum post 8ab69387008f2f6c]. FossilOrigin-Name: 55f78b639624ad360d04c102339ef7147d6d24dd9bd0d17b346df0c03ee443b6 --- Makefile.in | 12 +++++++----- auto.def | 17 +++++++++++------ manifest | 14 +++++++------- manifest.uuid | 2 +- 4 files changed, 26 insertions(+), 19 deletions(-) diff --git a/Makefile.in b/Makefile.in index 9bdee26d73..4b42018e92 100644 --- a/Makefile.in +++ b/Makefile.in @@ -120,6 +120,8 @@ T.cc.sqlite = $(T.cc) @TARGET_DEBUG@ # can include the generated sqlite_cfg.h. # T.cc.sqlite += -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite +T.cc.sqlite += -I$(prefix)/include + # # main.mk will fill out T.cc.sqlite with some flags common to all builds. @@ -241,7 +243,7 @@ AS_AUTO_DEF = $(TOP)/auto.def # Shell commands to re-run $(TOP)/configure with the same args it was # invoked with to produce this makefile. # -AS_AUTOREMAKE = @SQLITE_AUTOREMAKE@ +AS_AUTORECONFIG = @SQLITE_AUTORECONFIG@ USE_AMALGAMATION ?= @USE_AMALGAMATION@ AMALGAMATION_GEN_FLAGS ?= --linemacros=@AMALGAMATION_LINE_MACROS@ @@ -252,16 +254,16 @@ AMALGAMATION_GEN_FLAGS ?= --linemacros=@AMALGAMATION_LINE_MACROS@ SHELL_OPT ?= @OPT_SHELL@ Makefile: $(TOP)/Makefile.in $(AS_AUTO_DEF) - $(AS_AUTOREMAKE) + $(AS_AUTORECONFIG) @touch $@ sqlite3.pc: $(TOP)/sqlite3.pc.in $(AS_AUTO_DEF) - $(AS_AUTOREMAKE) + $(AS_AUTORECONFIG) @touch $@ install: install-pc # defined in main.mk sqlite_cfg.h: $(TOP)/sqlite_cfg.h.in $(AS_AUTO_DEF) - $(AS_AUTOREMAKE) + $(AS_AUTORECONFIG) @touch $@ # @@ -311,7 +313,7 @@ clean-autosetup: clean: clean-autosetup distclean-autosetup: clean - rm -f sqlite_cfg.h config.log config.status config.defines.json Makefile sqlite3.pc + rm -f sqlite_cfg.h config.log config.status config.defines.* Makefile sqlite3.pc rm -f $(TOP)/tool/emcc.sh rm -f libsqlite3*$(T.dll) rm -f jimsh0* diff --git a/auto.def b/auto.def index 8e708a7e7b..e2ba5f1db9 100644 --- a/auto.def +++ b/auto.def @@ -220,10 +220,15 @@ msg-result "srcdir = $srcdir" msg-result "top_srcdir = $top_srcdir" msg-result [hwaci-bold "Configuring SQLite version $PACKAGE_VERSION"] -define-append SQLITE_AUTOREMAKE cd '$srcdir' && '$top_srcdir/configure' +# +# 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 +# +define-append SQLITE_AUTORECONFIG cd '$::autosetup(builddir)' && '$top_srcdir/configure' #{*}$::autosetup(argv) breaks with --flag='val with spaces', so... foreach arg $::autosetup(argv) { - define-append SQLITE_AUTOREMAKE '$arg' + define-append SQLITE_AUTORECONFIG '$arg' } @@ -456,7 +461,7 @@ hwaci-if-opt-truthy with-debug { # components. # define TCLSH_CMD {exit 1} -define HAVE_TCL [opt-bool tcl] +define HAVE_TCL 0 proc sqlite-check-tcl {} { # TODO: document the steps this is taking. if {![opt-bool tcl]} { @@ -1127,11 +1132,11 @@ if {0} { # Requires no input template... make-config-header sqlite_cfg.h \ -bare {SIZEOF_* HAVE_DECL_*} \ - -none {HAVE_CFLAG_* LDFLAGS_* SH_* SQLITE_AUTOREMAKE + -none {HAVE_CFLAG_* LDFLAGS_* SH_* SQLITE_AUTORECONFIG TARGET_* USE_GCOV TCL_*} \ -auto {HAVE_* PACKAGE_*} \ -none * - hwaci-touch sqlite_cfg.h ; # help avoid frequent unnecessary @SQLITE_AUTOREMAKE@ + hwaci-touch sqlite_cfg.h ; # help avoid frequent unnecessary @SQLITE_AUTORECONFIG@ } #TODO hwaci-make-from-dot-in ext/wasm/GNUmakefile @@ -1144,7 +1149,7 @@ if {"" ne $DUMP_DEFINES_JSON} { define OPT_SHELL.list [get-define OPT_SHELL] set dumpDefsOpt { -bare {SIZEOF_* HAVE_DECL_*} - -none {HAVE_CFLAG_* LDFLAGS_* SH_* SQLITE_AUTOREMAKE TARGET_* USE_GCOV TCL_*} + -none {HAVE_CFLAG_* LDFLAGS_* SH_* SQLITE_AUTORECONFIG TARGET_* USE_GCOV TCL_*} -array {*.list} -auto {OPT_* PACKAGE_* HAVE_*} } diff --git a/manifest b/manifest index 6fe2eecd7a..8d308587c4 100644 --- a/manifest +++ b/manifest @@ -1,9 +1,9 @@ -C Have\s--enable-editline\sfail\srather\sthan\semit\sa\swarning\swhich\swould\seasily\sbe\soverlooked\sby\sautomated\sbuilds.\sThe\serror\smessage\sexplains\sa\spotential\sworkaround\sfor\sactivating\slibedit. -D 2024-10-28T02:11:51.336 +C Correct\sthe\sdefault\sconfig\svalue\sfor\sHAVE_TCL\s(0\suntil\sproven\sotherwise)\sand\sfix\sthe\sstarting\sdir\sfor\sSQLITE_AUTORECONFIG\s(formerly\sSQLITE_AUTOREMAKE),\sas\sreported\sin\s[forum:8ab69387008f2f6c\s|\sforum\spost\s8ab69387008f2f6c]. +D 2024-10-28T02:46:57.310 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md b6e6c1baf38e4339bd3f1e0e5e5bfd0a9a93d133360691b2785c2d4b2f2dcec2 -F Makefile.in 957cbf0d25ced08f6703b82f2070cbea791aeeb2d6059c4426c30cd87c80250f +F Makefile.in 783a6819b11669d374d867e68cffb018cc5fd78b1113dd10be1d04f14c62a3b3 F Makefile.linux-generic 8df0e6ee5e4671f844caf27f88d2be7421e904639f7a0ffdce0e2cd4ea11e8c0 F Makefile.msc d2d927177660945599ba88ea32f1ab5c261a96a8797380b99766e27f3aea7e4f F README.md c3c0f19532ce28f6297a71870f3c7b424729f0e6d9ab889616d3587dd2332159 @@ -13,7 +13,7 @@ F art/icon-80x90.gif 65509ce3e5f86a9cd64fe7fca2d23954199f31fe44c1e09e208c80fb83d F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2 F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90 F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2 -F auto.def 33b45a5d8a51f0f8a211c8983c1c7306120a672f4c37dccf8b3e4c343c8d4569 +F auto.def 57635a8f8c2e5e91e4c21094a70bbb56473811366e75679ceec9b6626e49a826 F autoconf/INSTALL 83e4a25da9fd053c7b3665eaaaf7919707915903 F autoconf/Makefile.am adedc1324b6a87fdd1265ddd336d2fb7d4f36a0e77b86ea553ae7cc4ea239347 F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac @@ -2237,8 +2237,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 1353d4b600ae2849d2591b3fba0cad71289ee996334222a6886dc01cd4be5c07 -R c5d541f8ce498a3c24d538d7cf4698ef +P 2bd1b9557a1619adcaf5aa6dc5d5d0972e8416dafc9f36621b409192be95223d +R e1aee29c1c29ac7235c75bc587493265 U stephan -Z 8668cf4e3948e2d9e4ce3d2e5557772d +Z 50271136afde4fe48404bfa37e74b2eb # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index b9ceddc997..51271d0f40 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -2bd1b9557a1619adcaf5aa6dc5d5d0972e8416dafc9f36621b409192be95223d +55f78b639624ad360d04c102339ef7147d6d24dd9bd0d17b346df0c03ee443b6 From ee0b5e9bedb9222abf766e825dcfa226bf6247a9 Mon Sep 17 00:00:00 2001 From: stephan Date: Mon, 28 Oct 2024 02:49:45 +0000 Subject: [PATCH 15/15] Document why -IPREFIX/include is now part of T.cc.sqlite. FossilOrigin-Name: d64dcb1a897f6cc690c680cdaf85272e2dd249f36798219834116b1375f74d34 --- Makefile.in | 4 ++++ manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Makefile.in b/Makefile.in index 4b42018e92..67cc9ac453 100644 --- a/Makefile.in +++ b/Makefile.in @@ -120,6 +120,10 @@ T.cc.sqlite = $(T.cc) @TARGET_DEBUG@ # can include the generated sqlite_cfg.h. # T.cc.sqlite += -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite +# +# -I$(prefix)/include is primarily so that the ICU +# headers can be found. +# T.cc.sqlite += -I$(prefix)/include # diff --git a/manifest b/manifest index 8d308587c4..b3142b0746 100644 --- a/manifest +++ b/manifest @@ -1,9 +1,9 @@ -C Correct\sthe\sdefault\sconfig\svalue\sfor\sHAVE_TCL\s(0\suntil\sproven\sotherwise)\sand\sfix\sthe\sstarting\sdir\sfor\sSQLITE_AUTORECONFIG\s(formerly\sSQLITE_AUTOREMAKE),\sas\sreported\sin\s[forum:8ab69387008f2f6c\s|\sforum\spost\s8ab69387008f2f6c]. -D 2024-10-28T02:46:57.310 +C Document\swhy\s-IPREFIX/include\sis\snow\spart\sof\sT.cc.sqlite. +D 2024-10-28T02:49:45.984 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md b6e6c1baf38e4339bd3f1e0e5e5bfd0a9a93d133360691b2785c2d4b2f2dcec2 -F Makefile.in 783a6819b11669d374d867e68cffb018cc5fd78b1113dd10be1d04f14c62a3b3 +F Makefile.in 02ea00ff433902dba369d4a55b3aeb6bb1ffe2d82f777194984b8cdd7ed7c3ad F Makefile.linux-generic 8df0e6ee5e4671f844caf27f88d2be7421e904639f7a0ffdce0e2cd4ea11e8c0 F Makefile.msc d2d927177660945599ba88ea32f1ab5c261a96a8797380b99766e27f3aea7e4f F README.md c3c0f19532ce28f6297a71870f3c7b424729f0e6d9ab889616d3587dd2332159 @@ -2237,8 +2237,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 2bd1b9557a1619adcaf5aa6dc5d5d0972e8416dafc9f36621b409192be95223d -R e1aee29c1c29ac7235c75bc587493265 +P 55f78b639624ad360d04c102339ef7147d6d24dd9bd0d17b346df0c03ee443b6 +R 682368e231656f5796597ceeb6bfca0b U stephan -Z 50271136afde4fe48404bfa37e74b2eb +Z 165d962fa0afbbbe6a9fa8d04b79266b # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 51271d0f40..f3ce270dda 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -55f78b639624ad360d04c102339ef7147d6d24dd9bd0d17b346df0c03ee443b6 +d64dcb1a897f6cc690c680cdaf85272e2dd249f36798219834116b1375f74d34