aboutsummaryrefslogtreecommitdiff
path: root/autosetup
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2025-04-09 13:32:15 +0000
committerstephan <stephan@noemail.net>2025-04-09 13:32:15 +0000
commit509d899a2dec05549c88147429c205598d9ee061 (patch)
treed17aae0142c266684884493691042214a1f18662 /autosetup
parentfda6e50ac86bfd926c0bd42cf350e743cfdf5bca (diff)
downloadsqlite-509d899a2dec05549c88147429c205598d9ee061.tar.gz
sqlite-509d899a2dec05549c88147429c205598d9ee061.zip
Doc updates in proj.tcl. Improve configure check for whether fdatasync or nanosleep require -lrt. Remove references to 'tcl-config' build mode from sqlite-config.tcl, as that build is now implemented without a depency on sqlite-config.tcl because the TEA build's needs are considerably more modest.
FossilOrigin-Name: 394bef54411c81fd8ca3aafc13ec2a774e9ff56c7282d90b8425cc8f383aa74c
Diffstat (limited to 'autosetup')
-rw-r--r--autosetup/proj.tcl17
-rw-r--r--autosetup/sqlite-config.tcl33
2 files changed, 32 insertions, 18 deletions
diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl
index 5c1f6bb34..75ec46c64 100644
--- a/autosetup/proj.tcl
+++ b/autosetup/proj.tcl
@@ -648,10 +648,12 @@ proc proj-file-write {args} {
# which controls whether to run/skip this check.
#
# Returns 1 if supported, else 0. Defines MAKE_COMPILATION_DB to "yes"
-# if supported, "no" if not.
+# if supported, "no" if not. The use of MAKE_COMPILATION_DB is
+# deprecated/discouraged. It also sets HAVE_COMPILE_COMMANDS to 0 or
+# 1, and that's the preferred usage.
#
-# This test has a long history of false positive results because of
-# compilers reacting differently to the -MJ flag.
+# ACHTUNG: this test has a long history of false positive results
+# because of compilers reacting differently to the -MJ flag.
proc proj-check-compile-commands {{configFlag {}}} {
msg-checking "compile_commands.json support... "
if {"" ne $configFlag && ![proj-opt-truthy $configFlag]} {
@@ -664,11 +666,13 @@ proc proj-check-compile-commands {{configFlag {}}} {
# Martin G.'s older systems. drh also reports a false
# positive on an unspecified older Mac system.
msg-result "compiler supports compile_commands.json"
- define MAKE_COMPILATION_DB yes
+ define MAKE_COMPILATION_DB yes; # deprecated
+ define HAVE_COMPILE_COMMANDS 1
return 1
} else {
msg-result "compiler does not support compile_commands.json"
define MAKE_COMPILATION_DB no
+ define HAVE_COMPILE_COMMANDS 0
return 0
}
}
@@ -1259,6 +1263,11 @@ proc proj-dump-defs-json {file args} {
# over any values from hidden aliases into their canonical names, such
# that [opt-value canonical] will return X if --alias=X is passed to
# configure.
+#
+# That said: autosetup's [opt-src] does support alias forms, but it
+# requires that the caller know all possible aliases. It's simpler, in
+# terms of options handling, if there's only a single canonical name
+# which each down-stream call of [opt-...] has to know.
proc proj-xfer-options-aliases {mapping} {
foreach {hidden - canonical} [proj-strip-hash-comments $mapping] {
if {[proj-opt-was-provided $hidden]} {
diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl
index 2ab8508a8..0e50f9dd2 100644
--- a/autosetup/sqlite-config.tcl
+++ b/autosetup/sqlite-config.tcl
@@ -63,14 +63,13 @@ array set sqliteConfig [subst [proj-strip-hash-comments {
#
# 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.
+ # requires special handling in a few places.
#
all-flag-enables {fts4 fts5 rtree geopoly session}
#
- # Default value for the --all flag. Gets changed for the
- # tcl-extension build.
+ # Default value for the --all flag. Can hypothetically be modified
+ # by non-canonical builds.
#
all-flag-default 0
}]]
@@ -97,7 +96,7 @@ array set sqliteConfig [subst [proj-strip-hash-comments {
proc sqlite-configure {buildMode configScript} {
proj-assert {$::sqliteConfig(build-mode) eq "unknown"} \
"sqlite-configure must not be called more than once"
- set allBuildModes {canonical autoconf tcl-extension}
+ set allBuildModes {canonical autoconf}
if {$buildMode ni $allBuildModes} {
user-error "Invalid build mode: $buildMode. Expecting one of: $allBuildModes"
}
@@ -229,7 +228,7 @@ proc sqlite-configure {buildMode configScript} {
copy of autosetup/jimsh0.c for that. The SQLite TCL extension and the
test code require a canonical tclsh.}
}
- {canonical tcl-extension} {
+ {canonical} {
with-tcl:DIR
=> {Directory containing tclConfig.sh or a directory one level up from
that, from which we can derive a directory containing tclConfig.sh.
@@ -620,15 +619,21 @@ proc sqlite-check-common-system-deps {} {
cc-check-functions gmtime_r isnan localtime_r localtime_s \
malloc_usable_size strchrnul usleep utime pread pread64 pwrite pwrite64
- set ldrt ""
- # Collapse funcs from librt into LDFLAGS_RT.
- # Some systems (ex: SunOS) require -lrt in order to use nanosleep
- foreach func {fdatasync nanosleep} {
- if {[proj-check-function-in-lib $func rt]} {
- lappend ldrt [get-define lib_${func}]
+ apply {{} {
+ set ldrt ""
+ # Collapse funcs from librt into LDFLAGS_RT.
+ # Some systems (ex: SunOS) require -lrt in order to use nanosleep
+ foreach func {fdatasync nanosleep} {
+ if {[proj-check-function-in-lib $func rt]} {
+ set ldrt [get-define lib_${func} ""]
+ undefine lib_${func}
+ if {"" ne $ldrt} {
+ break
+ }
+ }
}
- }
- define LDFLAGS_RT [join [lsort -unique $ldrt] ""]
+ define LDFLAGS_RT $ldrt
+ }}
# Check for needed/wanted headers
cc-check-includes \