}
use proj
-# We want this version info to be emitted up front, but we have to
-# 'use system' for --prefix=... to work. Ergo, this bit is up here
-# instead of in [sqlite-configure].
+#
+# We want the package version info to be emitted early on, but doing
+# so requires a bit of juggling. We have to [use system] for
+# --prefix=... to work and to emit the Host/Build system info, but we
+# don't want those to interfere with --help output.
define PACKAGE_VERSION [proj-file-content -trim $::autosetup(srcdir)/VERSION]
if {"--help" ni $::argv} {
msg-result "Configuring SQLite version [get-define PACKAGE_VERSION]"
}
#
-# Object for communicating config-time state across various
+# Object for communicating certain config-time state across various
# auto.def-related pieces.
-#
-array set sqliteConfig [proj-strip-hash-comments {
+array set sqliteConfig [subst [proj-strip-hash-comments {
+ #
+ # Gets set by [sqlite-configure] (the main configure script driver).
+ build-mode unknown
#
# Gets set to 1 when using jimsh for code generation. May affect
# later decisions.
use-jim-for-codegen 0
#
+ # Set to 1 when cross-compiling This value may be changed by certain
+ # build options, so it's important that config code which checks for
+ # cross-compilation uses this var instead of
+ # [proj-is-cross-compiling].
+ is-cross-compiling [proj-is-cross-compiling]
+ #
# Pass msg-debug=1 to configure to enable obnoxiously loud output
# from [msg-debug].
msg-debug-enabled 0
# (dump-defines-txt) but also a JSON file named after this option's
# value.
dump-defines-json ""
-}]
-
-#
-# Set to 1 when cross-compiling This value may be changed by certain
-# build options, so it's important that config code which checks for
-# cross-compilation uses this var instead of
-# [proj-is-cross-compiling].
-#
-set sqliteConfig(is-cross-compiling) [proj-is-cross-compiling]
+}]]
########################################################################
# Processes all configure --flags for this build, run build-specific
# $buildMode, with the caveat that _some_ build-specific code is
# encapsulated in the configuration finalization step.
#
-# The intent is that all build-mode-specific configuration goes inside
-# the $configScript argument to this function, and that an auto.def file
-# contains only two commands:
+# The intent is that all (or almost all) build-mode-specific
+# configuration goes inside the $configScript argument to this
+# function, and that an auto.def file contains only two commands:
#
# use sqlite-config
# sqlite-configure BUILD_NAME { build-specific configure script }
+#
+# There are snippets of build-mode-specific decision-making in
+# [sqlite-configure-finalize]
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}
if {$buildMode ni $allBuildModes} {
user-error "Invalid build mode: $buildMode. Expecting one of: $allBuildModes"
{*} {
threadsafe=1 => {Disable mutexing}
with-tempstore:=no => {Use an in-RAM database for temporary tables: never,no,yes,always}
- largefile=1
- => {This legacy flag has no effect on the library but may influence
- the contents of the generated sqlite_cfg.h}
- # ^^^ It's not clear that LFS support actually does anything,
- # as HAVE_LFS is not checked anywhere in the .c/.h/.in files.
load-extension=1 => {Disable loading of external extensions}
math=1 => {Disable math functions}
json=1 => {Disable JSON functions}
rtree => {Enable the RTREE extension}
session => {Enable the SESSION extension}
all => {Enable FTS4, FTS5, Geopoly, RTree, Sessions}
+ largefile=1
+ => {This legacy flag has no effect on the library but may influence
+ the generated sqlite_cfg.h by adding #define HAVE_LFS}
}
}
dict incr xopts -level
return {*}$xopts $msg
}
- sqlite-post-options-init
+ sqlite-configure-phase1 $buildMode
uplevel 1 $configScript
sqlite-configure-finalize
}; # sqlite-configure
########################################################################
-# Performs late-stage config steps common to all supported
-# $::sqliteConfig(build-mode) values.
-proc sqlite-configure-finalize {} {
- set buildMode $::sqliteConfig(build-mode)
- set isCanonical [expr {$buildMode eq "canonical"}]
- set isAutoconf [expr {$buildMode eq "autoconf"}]
- proj-assert {$isCanonical || $isAutoconf} "Unknown build mode: $buildMode"
-
+# 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].
+proc sqlite-configure-phase1 {buildMode} {
+ define PACKAGE_NAME sqlite
+ define PACKAGE_URL {https://sqlite.org}
+ define PACKAGE_BUGREPORT [get-define PACKAGE_URL]/forum
+ define PACKAGE_STRING "[get-define PACKAGE_NAME] [get-define PACKAGE_VERSION]"
+ proj-xfer-options-aliases {
+ # Carry values from hidden --flag aliases over to their canonical
+ # flag forms. This list must include only options which are common
+ # to all build modes supported by [sqlite-configure].
+ with-readline-inc => with-readline-cflags
+ with-readline-lib => with-readline-ldflags
+ with-debug => debug
+ }
+ set ::sqliteConfig(msg-debug-enabled) [proj-val-truthy [get-env msg-debug 0]]
+ proc-debug "msg-debug is enabled"
+ sqlite-autoreconfig
+ proj-file-extensions
+ if {".exe" eq [get-define TARGET_EXEEXT]} {
+ define SQLITE_OS_UNIX 0
+ define SQLITE_OS_WIN 1
+ } else {
+ define SQLITE_OS_UNIX 1
+ define SQLITE_OS_WIN 0
+ }
+ sqlite-setup-default-cflags
+ sqlite-handle-debug
define HAVE_LFS 0
if {[opt-bool largefile]} {
#
# harmless, but it doesn't do anything useful. It does have
# visible side-effects, though: the generated sqlite_cfg.h may (or
# may not) define HAVE_LFS.
- #
cc-check-lfs
}
+}; # sqlite-configure-phase1
- if {$isCanonical} {
- if {![opt-bool static]} {
- proj-indented-notice {
- NOTICE: static lib build may be implicitly re-activated by
- other components, e.g. some test apps.
- }
- }
- } else {
- proj-assert { $isAutoconf } "Invalid build mode"
- proj-define-for-opt static-shell ENABLE_STATIC_SHELL \
- "Link library statically into the CLI shell?"
- if {![opt-bool shared] && ![opt-bool static-shell]} {
- proj-opt-set shared 1
- proj-indented-notice {
- NOTICE: ignoring --disable-shared because --disable-static-shell
- was specified.
- }
- }
- }
- proj-define-for-opt shared ENABLE_LIB_SHARED "Build shared library?"
- proj-define-for-opt static ENABLE_LIB_STATIC "Build static library?"
-
- sqlite-handle-debug
+########################################################################
+# Performs late-stage config steps common to all supported
+# $::sqliteConfig(build-mode) values.
+proc sqlite-configure-finalize {} {
sqlite-handle-rpath
sqlite-handle-soname
sqlite-handle-threadsafe
sqlite-handle-tempstore
- sqlite-handle-line-editing
sqlite-handle-load-extension
sqlite-handle-math
sqlite-handle-icu
+ sqlite-handle-line-editing
+
+ proj-define-for-opt shared ENABLE_LIB_SHARED "Build shared library?"
+ if {![proj-define-for-opt static ENABLE_LIB_STATIC "Build static library?"]} {
+ # This notice really only applies to the canonical build...
+ proj-indented-notice {
+ NOTICE: static lib build may be implicitly re-activated by
+ other components, e.g. some test apps.
+ }
+ }
+
sqlite-handle-env-quirks
sqlite-handle-common-feature-flags
sqlite-finalize-feature-flags
- ########################################################################
- # When cross-compiling, we have to avoid using the -s flag to
- # /usr/bin/install:
- # https://sqlite.org/forum/forumpost/9a67df63eda9925c
- define IS_CROSS_COMPILING $::sqliteConfig(is-cross-compiling)
- sqlite-process-dot-in-files
+ sqlite-process-dot-in-files; # do not [define] anything after this
sqlite-post-config-validation
sqlite-dump-defines
-}; # sqlite-configure-finalize
-
-########################################################################
-# Runs some common initialization which must happen immediately after
-# autosetup's [options] function is called. This is also a convenient
-# place to put some generic pieces common to both the canonical
-# top-level build and the "autoconf" build, but it's not intended to
-# be a catch-all dumping ground for such.
-proc sqlite-post-options-init {} {
- define PACKAGE_NAME sqlite
- define PACKAGE_URL {https://sqlite.org}
- define PACKAGE_BUGREPORT [get-define PACKAGE_URL]/forum
- define PACKAGE_STRING "[get-define PACKAGE_NAME] [get-define PACKAGE_VERSION]"
- proj-xfer-options-aliases {
- # Carry values from hidden --flag aliases over to their canonical
- # flag forms. This list must include only options which are common
- # to all build modes supported by [sqlite-configure].
- with-readline-inc => with-readline-cflags
- with-readline-lib => with-readline-ldflags
- with-debug => debug
- }
- sqlite-autoreconfig
- proj-file-extensions
- if {".exe" eq [get-define TARGET_EXEEXT]} {
- define SQLITE_OS_UNIX 0
- define SQLITE_OS_WIN 1
- } else {
- define SQLITE_OS_UNIX 1
- define SQLITE_OS_WIN 0
- }
- set ::sqliteConfig(msg-debug-enabled) [proj-val-truthy [get-env msg-debug 0]]
- sqlite-setup-default-cflags
}
########################################################################
########################################################################
# Run checks for system-level includes and libs which are common to
# both the canonical build and the "autoconf" bundle.
+#
+# For the canonical build this must come after
+# [sqlite-handle-wasi-sdk], as that function may change the
+# environment in ways which affect this.
proc sqlite-check-common-system-deps {} {
# Check for needed/wanted data types
cc-with {-includes stdint.h} \
}
########################################################################
-# Handle various SQLITE_ENABLE_... feature flags.
+# Handle various SQLITE_ENABLE/OMIT_... feature flags.
proc sqlite-handle-common-feature-flags {} {
msg-result "Feature flags..."
foreach {boolFlag featureFlag ifSetEvalThis} {
msg-result " - $boolFlag"
}
}
-
}
#########################################################################
}
########################################################################
-# Checks for the --debug flag, defining SQLITE_DEBUG to 1 if it is
-# true. TARGET_DEBUG gets defined either way, with content depending
-# on whether --debug is true or false.
+# Checks for the --debug flag and [define]s TARGET_DEBUG based on
+# that. TARGET_DEBUG is unused in the autoconf build but that is
+# arguably a bug.
proc sqlite-handle-debug {} {
msg-checking "SQLITE_DEBUG build? "
proj-if-opt-truthy debug {
- define SQLITE_DEBUG 1
define TARGET_DEBUG {-g -DSQLITE_DEBUG=1 -DSQLITE_ENABLE_SELECTTRACE -DSQLITE_ENABLE_WHERETRACE -O0 -Wall}
proj-opt-set memsys5
msg-result yes
if {"" ne $rlInc} {
set rlLib [opt-val with-readline-ldflags]
#proc-debug "rlLib=$rlLib"
- if {$rlLib eq "auto" || $rlLib eq ""} {
+ if {$rlLib in {auto ""}} {
set rlLib ""
set libTerm ""
if {[proj-check-function-in-lib tgetent "$editLibName ncurses curses termcap"]} {
msg-result "Checking for ICU support..."
set icuConfigBin [opt-val with-icu-config]
set tryIcuConfigBin 1; # set to 0 if we end up using pkg-config
- if {"auto" eq $icuConfigBin || "pkg-config" eq $icuConfigBin} {
+ if {$icuConfigBin in {auto pkg-config}} {
if {[pkg-config-init 0] && [pkg-config icu-io]} {
# Maintenance reminder: historical docs say to use both of
# (icu-io, icu-uc). icu-uc lacks a required lib and icu-io has
define LDFLAGS_MATH [get-define lib_ceil]
undefine lib_ceil
sqlite-add-feature-flag {-DSQLITE_ENABLE_MATH_FUNCTIONS}
- msg-result "Enabling math SQL functions [get-define LDFLAGS_MATH]"
+ msg-result "Enabling math SQL functions"
} {
define LDFLAGS_MATH ""
msg-result "Disabling math SQL functions"
-C In\sthe\sautoconf\sbundle,\sdo\snot\sstrip\sbinaries\sduring\sinstallation,\sfor\sparity\swith\sthe\scanonical\sbuild\sand\sthe\slegacy\sbuild.\sDiscussed\sin\s[forum:9a67df63eda9925c|forum\spost\s9a67df63eda9925c].\sA\spotential\sTODO\shere\sis\sto\sadd\sa\sconfigure\sflag\swhich\seither\senables\sor\sdisables\sstripping.
-D 2025-03-22T12:15:13.411
+C Configure\sscript\sinternal\scleanups\sand\sre-orgs.\sNo\sfunctional\schanges.
+D 2025-03-22T12:43:22.020
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d
-F Makefile.in 2c4d3c20e42ddd7596432c8d45feeaf709f93b37279e274ea413034912a4f840
+F Makefile.in 86cc5297495fd5ce632cd7ec298c562900f874eef42c44d5890bd22397bb3820
F Makefile.linux-generic bd3e3cacd369821a6241d4ea1967395c962dfe3057e38cb0a435cee0e8b789d0
F Makefile.msc ef04498c7e227a0f459b105bb4952f26cc985d1d6340a367e62d5a79c4689dfb
F README.md a953c0cffd6e4f2501a306c00ee2b6e1e6630c25031e094629307fe99dd003d1
F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90
F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2
F art/sqlite370.svg 40b7e2fe8aac3add5d56dd86ab8d427a4eca5bcb3fe4f8946cb3794e1821d531
-F auto.def 23f0e7eb5eff4cf922963e667ed630793ed60300df59ef9d93c87a23e31c7232
+F auto.def f769bf3111089ee9471a2a872c47651c4e29e81d104a52867ab544fde5ef6bad
F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac
F autoconf/Makefile.in 1fe497c0df20102f7824ec8a3423cc13c26505655456ecd06a7a8ab02f606586
F autoconf/Makefile.msc 5bc67d3912444c40c6f96d003e5c90663e51abb83d204a520110b1b2038dcd8b
F autoconf/README.first f1d3876e9a7852c22f275a6f06814e64934cecbc0b5b9617d64849094c1fd136
F autoconf/README.txt 1a32296d8bbdd67110c79d224c92c05545a0b5bd0c272950025fe3c7c7b49580
-F autoconf/auto.def 42d239bda4feffe1cf8a431dae35f83d100f2c17ed4b189edeb12f067bd4fa90
+F autoconf/auto.def 4cb3c39042039bb852034dc1a9d42717d42eef759a687a664ad283db8e6b816e
F autoconf/tea/Makefile.in ba0556fee8da09c066bad85a4457904e46ee2c2eabaa309c0e83a78f2f151a8e
F autoconf/tea/README.txt 6c396709b45eb2b3be0ae6dc7e40a140d231962e3a2354da6c4dd48b1d9999bc
F autoconf/tea/aclocal.m4 52c47aac44ce0ddb1f918b6993e8beb8eee88f43
F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e45f
F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049
F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba
-F autosetup/proj.tcl 8bb4158e71b5d60070b86af3f7b1edf960c60b77f102ea5d688d89c7d57d8a32
-F autosetup/sqlite-config.tcl ff39112eddc68e9505562c6aefc0b505190fe1fe93b2273e0b50ce5c7bbf6e64
+F autosetup/proj.tcl 49faf960df88a374686234105def663dbfc297ab79c87686df0a0b973dd77018
+F autosetup/sqlite-config.tcl 6e1dce27dfb69910bc28c3d3d4e33470fffc3c68f1d6a87799d34a2cc27f79dd
F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9
F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x
F contrib/sqlitecon.tcl eb4c6578e08dd353263958da0dc620f8400b869a50d06e271ab0be85a51a08d3
F ext/wasm/tests/opfs/sahpool/sahpool-worker.js bd25a43fc2ab2d1bafd8f2854ad3943ef673f7c3be03e95ecf1612ff6e8e2a61
F ext/wasm/wasmfs.make 68999f5bd8c489239592d59a420f8c627c99169bbd6fa16a404751f757b9f702
F magic.txt 5ade0bc977aa135e79e3faaea894d5671b26107cc91e70783aa7dc83f22f3ba0
-F main.mk 7006135b902177f7c8bca2733a6820b72a0c6f5a47412b2a7c86668f0398f1fd
+F main.mk a8930b3338afa3065f89735c6e5f9a9d64d90bd3154fe4580696502a7c2a99ad
F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271
F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504
F mptest/crash01.test 61e61469e257df0850df4293d7d4d6c2af301421
F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 6a0ca9f2360d29272d7be97fe9f516c3ac88864f3e729ba65da1ef6211908775
-R d1ffac2a55e3dd0a47e636cf53422326
+P 6d2e57bd34c562a9cd618c178c3f92b869bf5420907057b8d2438b16a7f91d46
+R 62beb2007ca701c04bb0d952df27e3be
U stephan
-Z 5228f6e80ecc00f8456564524a3b87e2
+Z 0c3e870740ca71059ff9bfd7fd177692
# Remove this line to create a well-formed Fossil manifest.