Minor internal cleanups in the configure script. No behavioral changes.

FossilOrigin-Name: c42269e5ce3688fccee16cf35e1101f36afc3ccc19bef57b177d46c84db2435a
This commit is contained in:
stephan
2025-08-13 19:59:37 +00:00
parent 6f097125cd
commit e3fc1fc8dd
4 changed files with 40 additions and 31 deletions
+10 -4
View File
@@ -378,8 +378,8 @@ proc proj-bin-define {binName {defName {}}} {
#
# Despite using cc-path-progs to do the search, this function clears
# any define'd name that function stores for the result (because the
# caller has no sensible way of knowing which result it was unless
# they pass only a single argument).
# caller has no sensible way of knowing which [define] name it has
# unless they pass only a single argument).
#
proc proj-first-bin-of {args} {
set rc ""
@@ -451,7 +451,9 @@ proc proj-opt-set {flag {val 1}} {
# @proj-opt-exists flag
#
# Returns 1 if the given flag has been defined as a legal configure
# option, else returns 0.
# option, else returns 0. Options set via proj-opt-set "exist" for
# this purpose even if they were not defined via autosetup's
# [options] function.
#
proc proj-opt-exists {flag} {
expr {$flag in $::autosetup(options)};
@@ -1643,7 +1645,11 @@ proc proj-tweak-default-env-dirs {} {
# processing the file. In the context of that script, the vars
# $dotInsIn and $dotInsOut will be set to the input and output file
# names. This can be used, for example, to make the output file
# executable or perform validation on its contents.
# executable or perform validation on its contents:
#
## proj-dot-ins-append my.sh.in my.sh {
## catch {exec chmod u+x $dotInsOut}
## }
#
# See [proj-dot-ins-process], [proj-dot-ins-list]
#
+21 -17
View File
@@ -329,7 +329,7 @@ proc sqlite-configure {buildMode configScript} {
Needed only by ext/wasm. Default=EMSDK env var.}
amalgamation-extra-src:FILES
=> {Space-separated list of soure files to append as-is to the resulting
=> {Space-separated list of source files to append as-is to the resulting
sqlite3.c amalgamation file. May be provided multiple times.}
}
}
@@ -415,7 +415,6 @@ proc sqlite-configure {buildMode configScript} {
# ^^^ lappend of [sqlite-custom-flags] introduces weirdness if
# we delay [proj-strip-hash-comments] until after that.
########################################################################
# sqlite-custom.tcl is intended only for vendor-branch-specific
# customization. See autosetup/README.md#branch-customization for
@@ -433,6 +432,8 @@ proc sqlite-configure {buildMode configScript} {
}
}
#lappend allFlags just-testing {{*} {soname:=duplicateEntry => {x}}}
# Filter allFlags to create the set of [options] legal for this build
foreach {group XY} [subst -nobackslashes -nocommands $allFlags] {
foreach {X Y} $XY {
@@ -441,7 +442,7 @@ proc sqlite-configure {buildMode configScript} {
}
}
}
#lappend opts "soname:=duplicateEntry => {x}"; #just testing
if {[catch {options {}} msg xopts]} {
# Workaround for <https://github.com/msteveb/autosetup/issues/73>
# where [options] behaves oddly on _some_ TCL builds when it's
@@ -456,8 +457,9 @@ proc sqlite-configure {buildMode configScript} {
########################################################################
# Runs "phase 1" of the configure process: after initial --flags
# handling but before the build-specific parts are run. $buildMode
# must be the mode which was passed to [sqlite-configure].
# handling but before sqlite-configure's $configScript argument is
# run. $buildMode must be the mode which was passed to
# [sqlite-configure].
proc sqlite-configure-phase1 {buildMode} {
define PACKAGE_NAME sqlite
define PACKAGE_URL {https://sqlite.org}
@@ -1024,7 +1026,7 @@ proc sqlite-handle-emsdk {} {
proc sqlite-get-readline-dir-list {} {
# Historical note: the dirs list, except for the inclusion of
# $prefix and some platform-specific dirs, originates from the
# legacy configure script
# legacy configure script.
set dirs [list [get-define prefix]]
switch -glob -- [get-define host] {
*-linux-android {
@@ -1042,7 +1044,7 @@ proc sqlite-get-readline-dir-list {} {
if {[opt-val with-readline-ldflags] in {auto ""}} {
# If the user did not supply their own --with-readline-ldflags
# value, hijack that flag to inject options which are known to
# work on a default Haiku installation.
# work on Haiku OS installations.
if {"" ne [glob -nocomplain /boot/system/lib/libreadline*]} {
proj-opt-set with-readline-ldflags {-L/boot/system/lib -lreadline}
}
@@ -1092,8 +1094,8 @@ proc sqlite-get-readline-dir-list {} {
# 4) Default to automatic search for optional readline
#
# 5) Try to find readline or editline. If it's not found AND the
# corresponding --FEATURE flag was explicitly given, fail fatally,
# else fail silently.
# corresponding --FEATURE flag was explicitly given then fail
# fatally, else fail non-fatally.
proc sqlite-check-line-editing {} {
msg-result "Checking for line-editing capability..."
define HAVE_READLINE 0
@@ -1106,7 +1108,7 @@ proc sqlite-check-line-editing {} {
# if the library is not found.
set libsForReadline {readline edit} ; # -l<LIB> names to check for readline().
# The libedit check changes this.
set editLibName "readline" ; # "readline" or "editline"
set editLibName "readline" ; # "readline" or "editline"
set editLibDef "HAVE_READLINE" ; # "HAVE_READLINE" or "HAVE_EDITLINE"
set dirLn [opt-val with-linenoise]
if {"" ne $dirLn} {
@@ -1123,7 +1125,7 @@ proc sqlite-check-line-editing {} {
foreach f $lnCOpts {
if {[file exists $dirLn/$f]} {
set lnC $dirLn/$f
break;
break
}
}
if {"" eq $lnC} {
@@ -1233,16 +1235,18 @@ proc sqlite-check-line-editing {} {
set rlLib [opt-val with-readline-ldflags]
#proc-debug "rlLib=$rlLib"
if {$rlLib in {auto ""}} {
set rlLib ""
set libTerm ""
if {[proj-check-function-in-lib tgetent "$editLibName ncurses curses termcap"]} {
set rlLib "" ; # make sure it's not "auto", as we may append to it below
set libTerm ""; # lib with tgetent(3)
if {[proj-check-function-in-lib tgetent [list $editLibName ncurses curses termcap]]} {
# ^^^ that libs list comes from the legacy configure script ^^^
set libTerm [get-define lib_tgetent]
undefine lib_tgetent
}
if {$editLibName eq $libTerm} {
# tgetent(3) was found in the editing library
set rlLib $libTerm
} elseif {[proj-check-function-in-lib readline $libsForReadline $libTerm]} {
# tgetent(3) was found in an external lib
set rlLib [get-define lib_readline]
lappend rlLib $libTerm
undefine lib_readline
@@ -1272,8 +1276,8 @@ proc sqlite-check-line-editing {} {
msg-result "Using $editLibName flags: $rlInc $rlLib"
# Check whether rl_completion_matches() has a signature we can use
# and disable that sub-feature if it doesn't.
if {![cctest \
-cflags "$rlInc -D${editLibDef}" -libs $rlLib -nooutput 1 -source {
if {![cctest -cflags "$rlInc -D${editLibDef}" -libs $rlLib -nooutput 1 \
-source {
#include <stdio.h>
#ifdef HAVE_EDITLINE
#include <editline/readline.h>
@@ -1326,7 +1330,7 @@ proc sqlite-handle-line-editing {} {
# - pkg-config: use only pkg-config to determine flags
# - /path/to/icu-config: use that to determine flags
#
# If --with-icu-config is used as neither pkg-config nor icu-config
# If --with-icu-config is used and neither pkg-config nor icu-config
# are found, fail fatally.
#
# If both --with-icu-ldflags and --with-icu-config are provided, they