]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Document the new configuration customization approach and extend it to enable sqlite...
authorstephan <stephan@noemail.net>
Sat, 22 Mar 2025 17:28:29 +0000 (17:28 +0000)
committerstephan <stephan@noemail.net>
Sat, 22 Mar 2025 17:28:29 +0000 (17:28 +0000)
FossilOrigin-Name: b0c7800b0106e90cb7bf7e5d9f48d21f9b058eff6e42339a1621d713ab2dd03c

autosetup/README.md
autosetup/sqlite-config.tcl
manifest
manifest.uuid

index a61f94fbda60f37e0e22f1b39b4a1f8354a03137..c0aeff15d06da9893ba5933972a30a2bd4e22a29 100644 (file)
@@ -15,6 +15,8 @@ build infrastructure. It is not an [Autosetup][] reference.
   - Do Not Update Global Shared State
 - [Updating Autosetup](#updating)
   - ***[Patching Autosetup for Project-local changes](#patching)***
+- [Branch-specific Customization](#branch-customization)
+
 
 ------------------------------------------------------------------------
 
@@ -385,6 +387,72 @@ If autosetup is upgraded and this patch is _not_ applied the invoking
 `./configure` will fail loudly because of the declaration of the
 `debug` flag in `auto.def` - duplicated flags are not permitted.
 
+<a name="branch-customization"></a>
+Branch-specific Customization
+========================================================================
+
+Certain vendor-specific branches require slight configure script
+customization. Rather than editing `sqlite-config.tcl` for this,
+which frequently leads to merge conflicts, the following approach
+is recommended:
+
+In the vendor-specific branch, create a file named
+`autosetup/lib/THE-BRANCH-NAME.auto`. Autosetup will automatically
+load any files named `autosetup/*.auto` or `autosetup/*/*.auto` when
+it starts up.
+
+That file should contain the following content...
+
+If flag customization is required, add:
+
+>
+```
+proc sqlite-custom-flags {} {
+  # If any existing --flags require different default values
+  # then call:
+  options-defaults {
+    flag-name new-default-value
+  }
+  # ^^^ That will replace the default value but will not update
+  # the --help text, which may lead to some confusion:
+  # https://github.com/msteveb/autosetup/issues/77
+
+  return {
+   {*} {
+     new-flag-name {Help text}
+     ...
+   }
+  }; #see below
+}
+```
+
+That function must return either an empty string or a list in the form
+used internally by `sqlite-config.tcl:sqlite-configure`.
+
+Next, define:
+
+>
+```
+proc sqlite-handle-custom-flags {} {
+  ... do any custom flag handling here ...
+}
+```
+
+That function will be called relatively late in the configure process,
+before any filtered files are generated but after all other
+significant processing.
+
+It is important that no more than one `*.auto` or `local.tcl` file
+defines these functions. Autosetup will load these in an unspecified
+order, and the _last_ one which is loaded will overwrite any procs
+defined in files loaded before it.
+
+When running [mkautoconfamal.sh](/file/tool/mkautoconfamal.sh)
+(typically via `make amalgamation-tarball` or `make snapshot-tarball`),
+all `autosetup/local.tcl` and `autosetup/[*/]*.auto` files will be
+elided from the tarball except for `autosetup/lib/X.auto`, where `X`
+is the name of the current checkout's branch.
+
 
 [Autosetup]: https://msteveb.github.io/autosetup/
 [auto.def]: /file/auto.def
index ab2b80956e93713d2e7b7f20dd44c7b7302da9e8..0ead4cd77eaa7079f02728bd0d89c93f81076b8f 100644 (file)
@@ -365,7 +365,10 @@ proc sqlite-configure {buildMode configScript} {
     # sqlite-custom-flags is assumed to be imported via a
     # client-specific import: autosetup/local.tcl, autosetup/*.auto,
     # or autosetup/*/*.auto.
-    lappend allFlags sqlite-custom-flags [sqlite-custom-flags]
+    set scf [sqlite-custom-flags]
+    if {"" ne $scf} {
+      lappend allFlags sqlite-custom-flags $scf
+    }
   }
 
   # Filter allFlags to create the set of [options] legal for this build
index 04fb6abb8269bc24561e0d375067d62c6ae7fe73..53b12829eb840d8280e054f5c02cf012848e4374 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Teach\smkautoconfamal.sh\sto\savoid\scopying\sautosetup/local.tcl\sand\sautosetup/*.auto\sexcept\sfor\sautosetup/lib/CURRENT-BRANCH-NAME.auto\s(if\sany),\sthe\sintent\sbeing\sto\suse\slib/CURRENT-BRANCH-NAME.auto\sfor\sbranch-specific\sconfiguration\scustomizations.
-D 2025-03-22T17:00:32.967
+C Document\sthe\snew\sconfiguration\scustomization\sapproach\sand\sextend\sit\sto\senable\ssqlite-custom-flags\sto\sreturn\san\sempty\sstring\sto\sdenote\sthat\sit\sdoes\snot\srequire\sany\snew\sflags\s(it\smay\sstill\scustomize\sflag\sdefault\svalues\sin\ssuch\scases).
+D 2025-03-22T17:28:29.220
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
 F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d
@@ -37,7 +37,7 @@ F autoconf/tea/win/rules.vc 94a18c3e453535459b4a643983acca52fb8756e79055bd2ad4b0
 F autoconf/tea/win/targets.vc 96a25a1fa6e9e9cfb348fd3760a5395b4ce8acafc8ed10f0412937ec200d5dbd
 F autosetup/LICENSE 41a26aebdd2cd185d1e2b210f71b7ce234496979f6b35aef2cbf6b80cbed4ce4
 F autosetup/README.autosetup a78ff8c4a3d2636a4268736672a74bf14a82f42687fcf0631a70c516075c031e
-F autosetup/README.md f98cc827a162a1da4877e9656d749d414ba3f408d457d30e029afc66590c00c3
+F autosetup/README.md 564fd67ce77466e502af1af1967c4b4bc6401558051f7a2f1d9ab67e689f3e6e
 F autosetup/autosetup 74a9782b68d07934510190fbd03fc6ad92e63f0ea3b5cbffa5f0bd271ad60f01 x
 F autosetup/autosetup-config.guess dfa101c5e8220e864d5e9c72a85e87110df60260d36cb951ad0a85d6d9eaa463 x
 F autosetup/autosetup-config.sub a38fb074d0dece01cf919e9fb534a26011608aa8fa606490864295328526cd73 x
@@ -50,7 +50,7 @@ F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e
 F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049
 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba
 F autosetup/proj.tcl 49faf960df88a374686234105def663dbfc297ab79c87686df0a0b973dd77018
-F autosetup/sqlite-config.tcl c7c8dc9b864f0212bda4a1dfd30777f3757ff12d7b18adce1420c0f717c4c284
+F autosetup/sqlite-config.tcl 9d4ccbfd24f97be0e7e2be05a211700033521fc1d8d3bab40c1e923028e56e6c
 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9
 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x
 F contrib/sqlitecon.tcl eb4c6578e08dd353263958da0dc620f8400b869a50d06e271ab0be85a51a08d3
@@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350
 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P bafab4ee5545c6cf6eafc5e352a7f25dfcbc7e58d4cc9064d05658c39de2af0d
-R 6b1a45c990d67ff1ce7361064641b32c
+P dfe24f13c446de5fdd736ed52fec0fca4637b4151ba008de7a598a2fc9398816
+R 8b1428f131d956d6b5e603417734bbed
 U stephan
-Z 2e3346333053a23fc85b7950d2cfe6bb
+Z 9e1837e75f17b5dbb42e5442891f4dea
 # Remove this line to create a well-formed Fossil manifest.
index 84fd431ba3d41fca44572b65c603acac4b3ed04b..5dea685a7c983590c9f9fac93be9c40b6d52201d 100644 (file)
@@ -1 +1 @@
-dfe24f13c446de5fdd736ed52fec0fca4637b4151ba008de7a598a2fc9398816
+b0c7800b0106e90cb7bf7e5d9f48d21f9b058eff6e42339a1621d713ab2dd03c