#
# 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.
+# the next time autosetup goes to output a message.
#
# If the -error flag is provided then it renders the message
# immediately to stderr and then exits.
+#
+# If neither -notice nor -error are used, the message will be sent to
+# stdout without delay.
proc proj-indented-notice {args} {
set fErr ""
set outFunc "puts"
switch -exact -- [lindex $args 0] {
-error {
set args [lassign $args fErr]
+ set outFunc "user-notice"
}
-notice {
set args [lassign $args -]
########################################################################
-# Handles the --enable-load-extension flag.
+# 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
+# provided, else a loud warning is instead emited. If
+# --disable-load-extension is used, no check is performed.
+#
+# Makes the following environment changes:
+#
+# - defines LDFLAGS_DLOPEN to any linker flags needed for this
+# feature. It may legally be empty on some systems where dlopen()
+# is in libc.
+#
+# - If the feature is not available, adds
+# -DSQLITE_OMIT_LOAD_EXTENSION=1 to the feature flags list.
proc sqlite-handle-load-extension {} {
+ define LDFLAGS_DLOPEN ""
+ set found 0
proj-if-opt-truthy load-extension {
- if {[proj-check-function-in-lib dlopen dl]} {
+ set found [proj-check-function-in-lib dlopen dl]
+ if {$found} {
define LDFLAGS_DLOPEN [get-define lib_dlopen]
undefine lib_dlopen
} else {
- user-error "dlopen() not found. Use --disable-load-extension to bypass this check."
+ if {[proj-opt-was-provided load-extension]} {
+ # Explicit --enable-load-extension: fail if not found
+ proj-indented-notice -error {
+ --enable-load-extension was provided but dlopen()
+ not found. Use --disable-load-extension to bypass this
+ check.
+ }
+ } else {
+ # It was implicitly enabled: warn if not found
+ proj-indented-notice {
+ WARNING: dlopen() not found, so loadable module support will
+ be disabled. Use --disable-load-extension to bypass this
+ check.
+ }
+ }
}
- } {
- define LDFLAGS_DLOPEN ""
+ }
+ if {$found} {
+ msg-result "Loadable extension support enabled."
+ } else {
+ msg-result "Disabling loadable extension support. Use --enable-load-extensions to enable them."
sqlite-add-feature-flag {-DSQLITE_OMIT_LOAD_EXTENSION=1}
- msg-result "Disabling loadable extensions."
}
+ return $found
}
########################################################################
-C Update\sthe\s'clean'\srules\sfor\sautoconf/Makefile.in\sto\saccount\sfor\s[6092b0b8].
-D 2025-02-09T05:37:46.589
+C configure:\swhen\sdlopen()\sis\snot\sfound,\sonly\sfail\sfatally\sif\s--enable-loadable-module\sis\sexplicitly\sprovided,\selse\swarn\sinstead.\sBased\son\sdiscussion\saround\s[forum:2efe9c33bd9021ca|forum\spost\s2efe9c33bd9021ca].\sUpdate\sproj-indented-notice\sto\sbehave\slike\sits\sdocs\ssay\sit\sshould\swhen\sthe\s-error\sflag\sis\sused.
+D 2025-02-10T15:02:35.214
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d
F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e45f
F autosetup/jimsh0.c 6573f6bc6ff204de0139692648d7037ca0b6c067bac83a7b4e087f20a86866a4
F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba
-F autosetup/proj.tcl af5290ee128ce82dd178a474a9dcfaa7e503c88f0709d916cc6079d9b8c801f4
-F autosetup/sqlite-config.tcl 6bff327462d34d2d9fe45738b0be70b80cf709de91b8c3b8a921cbdc2f05f6ff
+F autosetup/proj.tcl 42119a2e899e319b92f3159952b7ef7219c82cb45eeb636aaf8d909def8150f8
+F autosetup/sqlite-config.tcl 341c2751f42c6c8eeeae50bec13d2bb28db73ca2c8b9b97598332aed02e0a71b
F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9
F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x
F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad
F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 6c17e4b80cd5f7e37c02989878b19d3f85c897368c0bd67521dce7cee2b24f17
-Q +f3a35fdc9113ad5f1fed6a2f474aee670e1793d355475a7971d376bf33823cc4
-R 0f315543220c469011e96f586a72ec17
+P 23d25ae267a5e265fa3dd36b0c4d1f0f89a87068df98799ea48faa2f2817048d
+Q +f28e52cbf9e80cb5a1cde7cba099e2c2b6787a77263796e4f9febf3f30bc99dc
+R a9be5d3c364e4e237c915a4ad17a99a2
U stephan
-Z fa934500c5a49446045fc1cb432aa486
+Z b01dc78a0ef54f95d70ce1dd4b765880
# Remove this line to create a well-formed Fossil manifest.
-23d25ae267a5e265fa3dd36b0c4d1f0f89a87068df98799ea48faa2f2817048d
+7db7eb223e0fe39a3ba00359eb3a4645db013511c823db24823b6bd904481aa1