1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-01 06:27:03 +03:00

tcl configuration: --with-tcl=prefix is equivalent to passing the --prefix dir to it. If --with-tcl or --enable-tcl are explicitly passed in and tclConfig.sh is not found, fail fatally. When TCL is either explicitly disabled or default search for it fails non-fatally, be more explicit about which components are not available.

FossilOrigin-Name: c5389d39a90047683e80ae9081d5d10aaa95da00dfc8a133b4a1a6949a11620d
This commit is contained in:
stephan
2024-11-07 15:04:15 +00:00
parent c00d89d599
commit c7882b975e
6 changed files with 134 additions and 103 deletions

View File

@ -78,15 +78,19 @@ In (mostly) alphabetical order:
flags. They're rarely needed, though: search [auto.def][] for
`TSTRNNR_OPTS` for an example of where they are used.
- **`proj-fatal msg`**\
Emits `$msg` to stderr and exits with non-zero.
- **`proj-if-opt-truthy flag thenScript ?elseScript?`**\
Evals `thenScript` if the given `--flag` is truthy, else it
evals the optional `elseScript`.
- **`proj-indented-notice ?-error? msg`**\
- **`proj-indented-notice ?-error? ?-notice? msg`**\
Breaks its `msg` argument into lines, trims them, and emits them
with consistent indentation. If the `-error` flag is used, it then
exits with a non-0 result code. This will stick out starkly from
normal output and is intended to be used only for important notices.
with consistent indentation. Exactly how it emits depends on the
flags passed to it (or not), as covered in its docs. This will stick
out starkly from normal output and is intended to be used only for
important notices.
- **`proj-opt-truthy flag`**\
Returns 1 if `--flag`'s value is "truthy," i.e. one of (1, on,
@ -103,6 +107,10 @@ In (mostly) alphabetical order:
Returns 1 if `$value` is "truthy," See `proj-opt-truthy` for the definition
of "truthy."
- **`proj-warn msg`**\
Emits `$msg` to stderr. Closely-related is autosetup's `user-notice`
(described below).
- **`sqlite-add-feature-flag ?-shell? FLAG...`**\
Adds the given feature flag to the CFLAGS which are specific to building
the library. It's intended to be passed one or more `-DSQLITE_ENABLE_...`,
@ -113,6 +121,13 @@ In (mostly) alphabetical order:
- **`sqlite-add-shell-opt FLAG...`**\
The shell-specific counterpart of `sqlite-add-feature-flag`.
- **`user-notice msg`**\
Queues `$msg` to be sent to stderr, but not until either
`show-notices` is called or the next time autosetup would output
something. This can be used to generate warnings between a "checking
for..." message and its resulting "yes/no/whatever" message in such
a way as to not spoil layout of such messages.
<a name="tclcompat"></a>
Ensuring TCL Compatibility
========================================================================

View File

@ -61,7 +61,7 @@ set proj_(isatty) [isatty? stdout]
#
# Emits a warning message to stderr.
proc proj-warn {msg} {
puts stderr [proj-bold "WARNING: $msg"]
puts stderr "WARNING: $msg"
}
########################################################################
# @proj-error msg
@ -69,7 +69,7 @@ proc proj-warn {msg} {
# Emits an error message to stderr and exits with non-0.
proc proj-fatal {msg} {
show-notices
puts stderr [proj-bold "ERROR: $msg"]
puts stderr "ERROR: $msg"
exit 1
}
@ -101,23 +101,37 @@ proc proj-bold {str} {
}
########################################################################
# @proj-indented-notice ?-error? msg
# @proj-indented-notice ?-error? ?-notice? msg
#
# Takes a multi-line message and emits it with consistent indentation
# 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).
# Takes a multi-line message and emits it with consistent indentation.
#
# If its first argument is -error then it renders the message
# immediately and then exits.
# If the -notice flag it used then it emits using [user-notice], which
# means its rendering will (A) go to stderr and (B) be delayed until
# the next time autosetup goes to output a message. If -notice
# is not used, it will send the message to stdout without delay.
#
# If the -error flag is provided then it renders the message
# immediately to stderr and then exits.
proc proj-indented-notice {args} {
set fErr ""
if {"-error" eq [lindex $args 0]} {
set args [lassign $args fErr]
set outFunc "puts"
while {[llength $args] > 1} {
switch -exact -- [lindex $args 0] {
-error {
set args [lassign $args fErr]
}
-notice {
set args [lassign $args -]
set outFunc "user-notice"
}
default {
break
}
}
}
set lines [split [join $args] \n]
foreach line $lines {
user-notice " [string trimleft $line]"
$outFunc " [string trimleft $line]"
}
if {"" ne $fErr} {
show-notices