aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2025-04-27 04:21:27 +0000
committerstephan <stephan@noemail.net>2025-04-27 04:21:27 +0000
commitc49c7dad89ddbf39668abf4bf650ef434347346a (patch)
tree23159f8d0493b67562fc679e009e1dd20379d4c8
parent0f0450eda34c306886078f580eb92fdb779d1f2e (diff)
downloadsqlite-c49c7dad89ddbf39668abf4bf650ef434347346a.tar.gz
sqlite-c49c7dad89ddbf39668abf4bf650ef434347346a.zip
autoconf/tea: the default value of --threadsafe=X is now based on a pkgconfig query using the target tclsh, which is much more reliable than grepping Tcl's linker flags. Doc touchups.
FossilOrigin-Name: 4aeec30443b282f10353cdb9415fdce436287280f0f5d5d6b9917da831744898
-rw-r--r--autoconf/tea/teaish.tcl60
-rw-r--r--manifest14
-rw-r--r--manifest.uuid2
3 files changed, 37 insertions, 39 deletions
diff --git a/autoconf/tea/teaish.tcl b/autoconf/tea/teaish.tcl
index 53228cb91..99db68e24 100644
--- a/autoconf/tea/teaish.tcl
+++ b/autoconf/tea/teaish.tcl
@@ -1,4 +1,4 @@
-# Teaish configure script for the SQLite TCL extension
+# Teaish configure script for the SQLite Tcl extension
apply {{} {
set version [proj-file-content -trim [teaish-get -dir]/../VERSION]
@@ -31,7 +31,9 @@ array set sqliteConfig [subst [proj-strip-hash-comments {
# autosetup's [options] function.
#
proc teaish-options {} {
- return [proj-strip-hash-comments [subst -nocommands -nobackslashes {
+ # These flags and defaults mostly derive from the historical TEA
+ # build. Some, like ICU, are taken from the canonical SQLite tree.
+ return [subst -nocommands -nobackslashes {
with-system-sqlite=0
=> {Use the system-level SQLite instead of the copy in this tree.
Also requires use of --override-sqlite-version so that the build
@@ -63,7 +65,7 @@ proc teaish-options {} {
icu-collations=0
=> {Enable SQLITE_ENABLE_ICU_COLLATIONS. Requires --with-icu-ldflags=...
or --with-icu-config}
- }]]
+ }]
}
#
@@ -118,9 +120,8 @@ proc teaish-configure {} {
sqlite-handle-common-feature-flags; # must be late in the process
}; # teaish-configure
-
define OPT_FEATURE_FLAGS {} ; # -DSQLITE_OMIT/ENABLE flags.
-########################################################################
+#
# Adds $args, if not empty, to OPT_FEATURE_FLAGS. This is intended only for holding
# -DSQLITE_ENABLE/OMIT/... flags, but that is not enforced here.
proc sqlite-add-feature-flag {args} {
@@ -129,7 +130,7 @@ proc sqlite-add-feature-flag {args} {
}
}
-########################################################################
+#
# Check for log(3) in libm and die with an error if it is not
# found. $featureName should be the feature name which requires that
# function (it's used only in error messages). defines LDFLAGS_MATH to
@@ -150,7 +151,7 @@ proc sqlite-affirm-have-math {featureName} {
}
}
-########################################################################
+#
# Handle various SQLITE_ENABLE/OMIT_... feature flags.
proc sqlite-handle-common-feature-flags {} {
msg-result "Feature flags..."
@@ -208,7 +209,7 @@ proc sqlite-handle-common-feature-flags {} {
}
}
}
- ########################################################################
+ #
# Invert the above loop's logic for some SQLITE_OMIT_... cases. If
# config option $boolFlag is false, [sqlite-add-feature-flag
# $featureFlag], where $featureFlag is intended to be
@@ -224,7 +225,7 @@ proc sqlite-handle-common-feature-flags {} {
}
}
- #########################################################################
+ ##
# Remove duplicates from the final feature flag sets and show them
# to the user.
set oFF [get-define OPT_FEATURE_FLAGS]
@@ -238,7 +239,7 @@ proc sqlite-handle-common-feature-flags {} {
teaish-cflags-add -define OPT_FEATURE_FLAGS
}; # sqlite-handle-common-feature-flags
-########################################################################
+#
# If --enable-threadsafe is set, this adds -DSQLITE_THREADSAFE=1 to
# OPT_FEATURE_FLAGS and sets LDFLAGS_PTHREAD to the linker flags
# needed for linking pthread (possibly an empty string). If
@@ -260,10 +261,8 @@ proc sqlite-handle-threadsafe {} {
teaish-ldflags-prepend $ldf
undefine lib_pthread_create
undefine lib_pthread_mutexattr_init
- } elseif {[proj-opt-was-provided threadsafe]} {
- user-error "Missing required pthread libraries. Use --disable-threadsafe to disable this check."
} else {
- msg-result "pthread support not detected"
+ user-error "Missing required pthread libraries. Use --disable-threadsafe to disable this check."
}
# Recall that LDFLAGS_PTHREAD might be empty even if pthreads if
# found because it's in -lc on some platforms.
@@ -273,30 +272,31 @@ proc sqlite-handle-threadsafe {} {
} else {
#
# If user does not specify --[disable-]threadsafe then select a
- # default based on whether it looks like TCL has threading
+ # default based on whether it looks like Tcl has threading
# support.
#
- #puts "TCL_LIBS = [get-define TCL_LIBS]"
- if {[string match *pthread* [get-define TCL_LIBS]]} {
- # ^^^ FIXME: there must be a better way of testing this
+ catch {
+ scan [exec echo {puts [tcl::pkgconfig get threaded]} | [get-define TCLSH_CMD]] \
+ %d enable
+ }
+ if {$enable} {
set flagName "--threadsafe"
set lblAbled "enabled"
- set enable 1
- msg-result "yes"
+ msg-result yes
} else {
set flagName "--disable-threadsafe"
set lblAbled "disabled"
- set enable 0
- msg-result "no"
+ msg-result no
}
- msg-result "NOTICE: defaulting to ${flagName} because TCL has threading ${lblAbled}."
- # ^^^ We don't need to link against -lpthread in the is-enabled case.
+ msg-result "Defaulting to ${flagName} because Tcl has threading ${lblAbled}."
+ # ^^^ We (probably) don't need to link against -lpthread in the
+ # is-enabled case. We might in the case of static linking. Unsure.
}
sqlite-add-feature-flag -DSQLITE_THREADSAFE=${enable}
return $enable
}
-########################################################################
+#
# Handles the --enable-load-extension flag. Returns 1 if the support
# is enabled, else 0. If support for that feature is not found, a
# fatal error is triggered if --enable-load-extension is explicitly
@@ -348,7 +348,7 @@ proc sqlite-handle-load-extension {} {
return $found
}
-########################################################################
+#
# ICU - International Components for Unicode
#
# Handles these flags:
@@ -448,7 +448,7 @@ proc sqlite-handle-icu {} {
}; # sqlite-handle-icu
-########################################################################
+#
# Handles the --with-tempstore flag.
#
# The test fixture likes to set SQLITE_TEMP_STORE on its own, so do
@@ -473,7 +473,7 @@ proc sqlite-handle-tempstore {} {
}
}
-########################################################################
+#
# Handles the --enable-math flag.
proc sqlite-handle-math {} {
proj-if-opt-truthy math {
@@ -492,15 +492,13 @@ proc sqlite-handle-math {} {
}
}
-########################################################################
+#
# Move -DSQLITE_OMIT... and -DSQLITE_ENABLE... flags from CFLAGS and
# CPPFLAGS to OPT_FEATURE_FLAGS and remove them from BUILD_CFLAGS.
proc sqlite-munge-cflags {} {
# Move CFLAGS and CPPFLAGS entries matching -DSQLITE_OMIT* and
# -DSQLITE_ENABLE* to OPT_FEATURE_FLAGS. This behavior is derived
- # from the legacy build and was missing the 3.48.0 release (the
- # initial Autosetup port).
- # https://sqlite.org/forum/forumpost/9801e54665afd728
+ # from the pre-3.48 build.
#
# Handling of CPPFLAGS, as well as removing ENABLE/OMIT from
# CFLAGS/CPPFLAGS, was missing in the 3.49.0 release as well.
diff --git a/manifest b/manifest
index abd86ba1e..ecf49a35d 100644
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\san\soff-by-one\serror\sin\san\sassert(),\sdiscovered\sby\soss-fuzz.\s\sThis\sis\sa\nharmless\serror\sin\sas\smuch\sas\sassert()s\sare\sdisabled\sin\sproduction\sbuilds,\sand\nbecause\sthe\soff-by-one\sonly\soccurs\son\snonsensical\sCREATE\sINDEX\sstatements.
-D 2025-04-25T12:39:32.313
+C autoconf/tea:\sthe\sdefault\svalue\sof\s--threadsafe=X\sis\snow\sbased\son\sa\spkgconfig\squery\susing\sthe\starget\stclsh,\swhich\sis\smuch\smore\sreliable\sthan\sgrepping\sTcl's\slinker\sflags.\sDoc\stouchups.
+D 2025-04-27T04:21:27.214
F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
@@ -33,7 +33,7 @@ F autoconf/tea/configure d0b12b984edca6030d1976375b80157ac78b5b90a5b4f0dcee39357
F autoconf/tea/doc/sqlite3.n 9a97f4f717ceab73004ea412af7960625c1cb24b5c25e4ae4c8b5d8fa4300f4e
F autoconf/tea/license.terms 13bd403c9610fd2b76ece0ab50c4c5eda933d523
F autoconf/tea/pkgIndex.tcl.in e07da6b94561f4aa382bab65b1ccceb04701b97bf59d007c1d1f20a222b22d07
-F autoconf/tea/teaish.tcl 9abc575ff3106c60ec0924a558d45dd58f7b4cd07373f87372df1988611b7d8c
+F autoconf/tea/teaish.tcl 172fd9d6e06e5874db58e3384cfa9a7d52325634302eed189bb60f6cbf40bbd9
F autoconf/tea/teaish.test.tcl cfe94e1fb79dd078f650295be59843d470125e0cc3a17a1414c1fb8d77f4aea6
F autoconf/tea/teaish.tester.tcl.in 0d048e5569ad9bbaffbe5123c2084f9084d424a7719d06f5ca941caafbcca320
F autosetup/LICENSE 41a26aebdd2cd185d1e2b210f71b7ce234496979f6b35aef2cbf6b80cbed4ce4
@@ -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 f878f578f8fac95a939e3eabe8b64d5627d2ccd98de1e28081b9bca42ffee027
-R b09672114488a7538b124c2f208fd0c9
-U drh
-Z ec15e368363710db096ef47cd437c3e8
+P 3e627d66ebdef8dfe41bd12a0474d1afca9f50051771774679d25bd1833e69ae
+R 56906ec6bb47507a448b4eb61a665ed8
+U stephan
+Z 6249b8349b5cb161fd945b7e77195de1
# Remove this line to create a well-formed Fossil manifest.
diff --git a/manifest.uuid b/manifest.uuid
index ca8e4b50d..ee89ce365 100644
--- a/manifest.uuid
+++ b/manifest.uuid
@@ -1 +1 @@
-3e627d66ebdef8dfe41bd12a0474d1afca9f50051771774679d25bd1833e69ae
+4aeec30443b282f10353cdb9415fdce436287280f0f5d5d6b9917da831744898