aboutsummaryrefslogtreecommitdiff
path: root/autosetup
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2025-04-04 16:17:02 +0000
committerstephan <stephan@noemail.net>2025-04-04 16:17:02 +0000
commit24fe85b99a975094d835ea3f895b16e572512ad4 (patch)
treeca0ad46fc420b8f7647e95ea202e7ba342bd7ae2 /autosetup
parent91db54f07ad3fee7d0b6c63ddf139e409083293a (diff)
downloadsqlite-24fe85b99a975094d835ea3f895b16e572512ad4.tar.gz
sqlite-24fe85b99a975094d835ea3f895b16e572512ad4.zip
Adapt the --all flag to apply to a different set of features, and default to enabled, for the tcl-extension build.
FossilOrigin-Name: b229c8f65acf41b57afacfde712c3a8040d3bd5139bd5e30d450669658185ddd
Diffstat (limited to 'autosetup')
-rw-r--r--autosetup/proj.tcl3
-rw-r--r--autosetup/sqlite-config.tcl30
2 files changed, 25 insertions, 8 deletions
diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl
index 707da947e..33f95afa4 100644
--- a/autosetup/proj.tcl
+++ b/autosetup/proj.tcl
@@ -345,6 +345,9 @@ proc proj-first-bin-of {args} {
# to the default value of baz. If the user does not explicitly pass in
# --foo-bar (with or without a value) then this returns 0.
#
+# Calling [proj-opt-set] is, for purposes of the above, equivalent to
+# explicitly passing in the flag.
+#
# Note: unlike most functions which deal with configure --flags, this
# one does not validate that $key refers to a pre-defined flag. i.e.
# it accepts arbitrary keys, even those not defined via an [options]
diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl
index 00f35cad1..a9375b130 100644
--- a/autosetup/sqlite-config.tcl
+++ b/autosetup/sqlite-config.tcl
@@ -60,6 +60,19 @@ array set sqliteConfig [subst [proj-strip-hash-comments {
# (dump-defines-txt) but also a JSON file named after this option's
# value.
dump-defines-json ""
+
+ #
+ # The list of feature --flags which the --all flag implies. This
+ # requires special handling in a few places and gets replaced with
+ # a different list in the tcl-extension build.
+ #
+ all-flag-enables {fts4 fts5 rtree geopoly session}
+
+ #
+ # Default value for the --all flag. Gets changed for the
+ # tcl-extension build.
+ #
+ all-flag-default 0
}]]
########################################################################
@@ -88,6 +101,12 @@ proc sqlite-configure {buildMode configScript} {
if {$buildMode ni $allBuildModes} {
user-error "Invalid build mode: $buildMode. Expecting one of: $allBuildModes"
}
+ if {$::sqliteConfig(all-flag-default)} {
+ set allFlagHelp "Disable these extensions: $::sqliteConfig(all-flag-enables)"
+ } else {
+ set allFlagHelp "Enable these extensions: $::sqliteConfig(all-flag-enables)"
+ }
+
set ::sqliteConfig(build-mode) $buildMode
########################################################################
# A gentle introduction to flags handling in autosetup
@@ -194,7 +213,7 @@ proc sqlite-configure {buildMode configScript} {
geopoly => {Enable the GEOPOLY extension}
rtree => {Enable the RTREE extension}
session => {Enable the SESSION extension}
- all => {Enable FTS4, FTS5, Geopoly, RTree, Sessions}
+ all=$::sqliteConfig(all-flag-default) => {$allFlagHelp}
largefile=1
=> {This legacy flag has no effect on the library but may influence
the generated sqlite_cfg.h by adding #define HAVE_LFS}
@@ -720,14 +739,9 @@ proc sqlite-setup-default-cflags {} {
# Handle various SQLITE_ENABLE/OMIT_... feature flags.
proc sqlite-handle-common-feature-flags {} {
msg-result "Feature flags..."
- if {"tcl-extension" eq $::sqliteConfig(build-mode)} {
- set allFlagEnables {fts3 fts4 fts5 rtree geopoly}
- } else {
- set allFlagEnables {fts4 fts5 rtree rtree geopoly session}
- }
if {![opt-bool all]} {
# Special handling for --disable-all
- foreach flag $allFlagEnables {
+ foreach flag $::sqliteConfig(all-flag-enables) {
if {![proj-opt-was-provided $flag]} {
proj-opt-set $flag 0
}
@@ -748,7 +762,7 @@ proc sqlite-handle-common-feature-flags {} {
# The --geopoly flag, though, will automatically re-enable
# --rtree, so --disable-rtree won't actually disable anything in
# that case.
- foreach k $allFlagEnables {
+ foreach k $::sqliteConfig(all-flag-enables) {
if {![proj-opt-was-provided $k]} {
proj-opt-set $k 1
}