]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
configure --help cleanups and eliminate the use of a JS-esque inner function in sqlit...
authorstephan <stephan@noemail.net>
Wed, 12 Feb 2025 16:59:07 +0000 (16:59 +0000)
committerstephan <stephan@noemail.net>
Wed, 12 Feb 2025 16:59:07 +0000 (16:59 +0000)
FossilOrigin-Name: 6df859cd18ded3ca64a184e45709503dd9b6a3f65e7611d3352f0bad288400f4

autosetup/sqlite-config.tcl
manifest
manifest.uuid

index 108edaa1c1e65dcfc0b3365ca814ea05ab6cefc3..14cdcf5da135b1df48f2243dd3cbd2eba4e4b945 100644 (file)
@@ -109,21 +109,26 @@ proc sqlite-config-bootstrap {buildMode} {
   # the case of a default value.
   ########################################################################
   set allFlags {
-    # Structure: a list of M {Z}, where M is a descriptive option
-    # group name and Z is a list of X Y pairs. X is a list of
-    # $buildMode name(s) to which these flags apply, or {*} to apply
+    # Structure: a list of M {Z} pairs, where M is a descriptive
+    # option group name and Z is a list of X Y pairs. X is a list of
+    # $buildMode name(s) to which the Y flags apply, or {*} to apply
     # to all builds. Y is a {block} in the form expected by
     # autosetup's [options] command.  Each block which is applicable
     # to $buildMode is appended to a new list before that list is
     # passed on to [options]. The order of each Y and sub-Y is
     # retained, which is significant for rendering of --help.
 
-    # When writing {help text blocks}, be aware that autosetup formats
-    # them differently (left-aligned, directly under the --flag) if the
-    # block starts with a newline. It does NOT expand vars and commands,
-    # but we use a [subst] call below which will replace (only) var
-    # refs.
+    # When writing {help text blocks}, be aware that:
+    #
+    # A) autosetup formats them differently if the {block} starts with
+    # a newline: it starts left-aligned, directly under the --flag, and
+    # the rest of the block is pasted verbatim rather than
+    # pretty-printed.
+    #
+    # B) Vars and commands are NOT expanded, but we use a [subst] call
+    # below which will replace (only) var refs.
 
+    # Options for how to build the library
     build-modes {
       {*} {
         shared=1             => {Disable build of shared libary}
@@ -134,11 +139,14 @@ proc sqlite-config-bootstrap {buildMode} {
       }
     }
 
+    # Library-level features and defaults
     lib-features {
       {*} {
         threadsafe=1         => {Disable mutexing}
         with-tempstore:=no   => {Use an in-RAM database for temporary tables: never,no,yes,always}
         largefile=1          => {Disable large file support}
+        # ^^^ It's not clear that this 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}
@@ -155,108 +163,130 @@ proc sqlite-config-bootstrap {buildMode} {
       }
     }
 
+    # Options for TCL support
     tcl {
       {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.
-          A dir name of "prefix" is equivalent to the directory specified by
-          the --prefix flag.}
-        with-tclsh:PATH      =>
-        {Full pathname of tclsh to use.  It is used for (A) trying to find
-          tclConfig.sh and (B) all TCL-based code generation.  Warning: if
-          its containing dir has multiple tclsh versions, it may select the
-          wrong tclConfig.sh!}
-        tcl=1                =>
-        {Disable components which require TCL, including all tests.
-          This tree requires TCL for code generation but can use the in-tree
-          copy of autosetup/jimsh0.c for that. The SQLite TCL extension and the
-          test code require a canonical tclsh.}
+        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.
+              A dir name of "prefix" is equivalent to the directory specified by
+              the --prefix flag.}
+        with-tclsh:PATH
+          => {Full pathname of tclsh to use.  It is used for (A) trying to find
+              tclConfig.sh and (B) all TCL-based code generation.  Warning: if
+              its containing dir has multiple tclsh versions, it may select the
+              wrong tclConfig.sh!}
+        tcl=1
+          => {Disable components which require TCL, including all tests.
+              This tree requires TCL for code generation but can use the in-tree
+              copy of autosetup/jimsh0.c for that. The SQLite TCL extension and the
+              test code require a canonical tclsh.}
       }
     }
 
+    # Options for line-editing modes for the CLI shell
     line-editing {
       {*} {
-        readline=1           => {Disable readline support}
+        readline=1
+          => {Disable readline support}
         # --with-readline-lib is a backwards-compatible alias for
         # --with-readline-ldflags
         with-readline-lib:
         with-readline-ldflags:=auto
-        => {Readline LDFLAGS, e.g. -lreadline -lncurses}
+          => {Readline LDFLAGS, e.g. -lreadline -lncurses}
         # --with-readline-inc is a backwards-compatible alias for
         # --with-readline-cflags.
         with-readline-inc:
         with-readline-cflags:=auto
-        => {Readline CFLAGS, e.g. -I/path/to/includes}
+          => {Readline CFLAGS, e.g. -I/path/to/includes}
         with-readline-header:PATH
-        => {Full path to readline.h, from which --with-readline-cflags will be derived}
-        with-linenoise:DIR   => {Source directory for linenoise.c and linenoise.h}
-        editline=0           => {Enable BSD editline support}
+          => {Full path to readline.h, from which --with-readline-cflags will be derived}
+        with-linenoise:DIR
+          => {Source directory for linenoise.c and linenoise.h}
+        editline=0
+          => {Enable BSD editline support}
       }
     }
 
+    # Options for ICU: International Components for Unicode
     icu {
       {*} {
         with-icu-ldflags:LDFLAGS
-        => {Enable SQLITE_ENABLE_ICU and add the given linker flags for the ICU libraries}
+          => {Enable SQLITE_ENABLE_ICU and add the given linker flags for the
+              ICU libraries}
         with-icu-cflags:CFLAGS
-        => {Apply extra CFLAGS/CPPFLAGS necessary for building with ICU. e.g. -I/usr/local/include}
-        with-icu-config:=auto => {Enable SQLITE_ENABLE_ICU. Value must be one of: auto, pkg-config, /path/to/icu-config}
-        icu-collations=0      => {Enable SQLITE_ENABLE_ICU_COLLATIONS. Requires --with-icu-ldflags=... or --with-icu-config}
+          => {Apply extra CFLAGS/CPPFLAGS necessary for building with ICU.
+              e.g. -I/usr/local/include}
+        with-icu-config:=auto
+          => {Enable SQLITE_ENABLE_ICU. Value must be one of: auto, pkg-config,
+              /path/to/icu-config}
+        icu-collations=0
+          => {Enable SQLITE_ENABLE_ICU_COLLATIONS. Requires --with-icu-ldflags=...
+              or --with-icu-config}
       }
     }
 
+    # Options for exotic/alternative build modes
     alternative-builds {
       {canonical} {
         with-wasi-sdk:=/opt/wasi-sdk
-        => {Top-most dir of the wasi-sdk for a WASI build}
-        with-emsdk:=auto     => {Top-most dir of the Emscripten SDK installation. Default = EMSDK env var.}
+          => {Top-most dir of the wasi-sdk for a WASI build}
+        with-emsdk:=auto
+          => {Top-most dir of the Emscripten SDK installation.
+              Default = EMSDK env var.}
       }
     }
 
-    # Note that using the --debug/--enable-debug flag here requires patching
-    # autosetup/autosetup to rename the --debug to --autosetup-debug.
+    # Options mostly for sqlite's own development
     developer {
       {*} {
+        # Note that using the --debug/--enable-debug flag here
+        # requires patching autosetup/autosetup to rename the --debug
+        # to --autosetup-debug.
         with-debug=0
-        debug=0              =>
-        {Enable debug build flags. This option will impact performance by
-          as much as 4x, as it includes large numbers of assert()s in
-          performance-critical loops.  Never use --debug for production
-          builds.}
-        scanstatus           => {Enable the SQLITE_ENABLE_STMT_SCANSTATUS feature flag}
+        debug=0
+          => {Enable debug build flags. This option will impact performance by
+              as much as 4x, as it includes large numbers of assert()s in
+              performance-critical loops.  Never use --debug for production
+              builds.}
+        scanstatus
+          => {Enable the SQLITE_ENABLE_STMT_SCANSTATUS feature flag}
       }
       {canonical} {
         dev                  => {Enable dev-mode build: automatically enables certain other flags}
         test-status          => {Enable status of tests}
         gcov=0               => {Enable coverage testing using gcov}
         linemacros           => {Enable #line macros in the amalgamation}
-        dynlink-tools        => {Dynamically link libsqlite3 to certain tools which normally statically embed it.}
+        dynlink-tools        => {Dynamically link libsqlite3 to certain tools which normally statically embed it}
       }
       {*} {
         dump-defines=0       => {Dump autosetup defines to $::sqliteConfig(dump-defines-txt) (for build debugging)}
       }
     }
 
+    # Options specifically for downstream package maintainers
     packaging {
       {*} {
         # soname: https://sqlite.org/src/forumpost/5a3b44f510df8ded
-        soname:=legacy       =>
-        {SONAME for libsqlite3.so. "none", or not using this flag, sets no
-          soname. "legacy" sets it to its historical value of
-          libsqlite3.so.0.  A value matching the glob "libsqlite3.*" sets
-          it to that literal value. Any other value is assumed to be a
-          suffix which gets applied to "libsqlite3.so.",
-          e.g. --soname=9.10 equates to "libsqlite3.so.9.10".
-        }
-        out-implib=0         =>
-        {Enable use of --out-implib linker flag to generate an "import library" for the DLL}
+        soname:=legacy
+          => {SONAME for libsqlite3.so. "none", or not using this flag, sets no
+              soname. "legacy" sets it to its historical value of
+              libsqlite3.so.0.  A value matching the glob "libsqlite3.*" sets
+              it to that literal value. Any other value is assumed to be a
+              suffix which gets applied to "libsqlite3.so.",
+              e.g. --soname=9.10 equates to "libsqlite3.so.9.10".}
+        # out-implib: https://sqlite.org/forum/forumpost/0c7fc097b2
+        out-implib=0
+          => {Enable use of --out-implib linker flag to generate an
+              "import library" for the DLL}
       }
     }
   }; # $allOpts
 
+  # Filter allOpts to create the set of [options] legal for this build
   set opts {}
-  foreach {group XY} [subst -nobackslashes -nocommands [proj-strip-hash-comments $allFlags]] {
+  foreach {group XY} [subst -nobackslashes -nocommands \
+                        [proj-strip-hash-comments $allFlags]] {
     foreach {X Y} $XY {
       if { $buildMode in $X || "*" in $X } {
         foreach y $Y {
@@ -265,8 +295,7 @@ proc sqlite-config-bootstrap {buildMode} {
       }
     }
   }
-  #puts "options = $opts"
-  #exit 0
+  #puts "options = $opts"; exit 0
   options $opts
   sqlite-post-options-init
 }; # sqlite-config-bootstrap
@@ -334,19 +363,19 @@ proc sqlite-autoreconfig {} {
   # configure script with the same arguments it was initially invoked
   # with. This can be used to automatically reconfigure
   #
-  proc squote {arg} {
+  set squote {{arg} {
     # Wrap $arg in single-quotes if it looks like it might need that
     # to avoid mis-handling as a shell argument. We assume that $arg
     # will never contain any single-quote characters.
     if {[string match {*[ &;$*"]*} $arg]} { return '$arg' }
     return $arg
-  }
-  define-append SQLITE_AUTORECONFIG cd [squote $::autosetup(builddir)] && [squote $::autosetup(srcdir)/configure]
+  }}
+  define-append SQLITE_AUTORECONFIG cd [apply $squote $::autosetup(builddir)] \
+    && [apply $squote $::autosetup(srcdir)/configure]
   #{*}$::autosetup(argv) breaks with --flag='val with spaces', so...
   foreach arg $::autosetup(argv) {
-    define-append SQLITE_AUTORECONFIG [squote $arg]
+    define-append SQLITE_AUTORECONFIG [apply $squote $arg]
   }
-  rename squote ""
 }
 
 define OPT_FEATURE_FLAGS {} ; # -DSQLITE_OMIT/ENABLE flags.
index 716b9c746bdb0dbfbe600f6a5e29612cb8a6457e..7b764e1e9fa3ad49661a47e8b3c61b78a460508a 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Remove\sold\sfunction\sdeclaration\saccidentally\sleft\sin\ssqlite3session.h.
-D 2025-02-12T15:31:26.463
+C configure\s--help\scleanups\sand\seliminate\sthe\suse\sof\sa\sJS-esque\sinner\sfunction\sin\ssqlite-config.tcl.\sNo\sfunctional\schanges.
+D 2025-02-12T16:59:07.174
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
 F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d
@@ -50,7 +50,7 @@ F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e
 F autosetup/jimsh0.c 6573f6bc6ff204de0139692648d7037ca0b6c067bac83a7b4e087f20a86866a4
 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba
 F autosetup/proj.tcl cef1e0aa0f2dee2042af66f28c97a9445f84d55d858ba9db4f6116846a1a325f
-F autosetup/sqlite-config.tcl bdafc3585865ada5d9a0f2b462e21ea735d49d82353fdfb641cf6f841f8eae9e
+F autosetup/sqlite-config.tcl ece913b7bb1efbabdd44fd787c0e4d2fd462d3019cc079a5e6bbe43c83d302b3
 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9
 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x
 F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad
@@ -2207,8 +2207,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 da94e551c0ed354ae782c89fd9495d607b77ad7572d90c41ceac12bd6ec4c31b
-R 6f7f1710621940ea4683c778ed859375
-U dan
-Z 8c9d99e3c5ea71beb7debabd9d22f723
+P 0cfbe349d4b740f3d2be8c714cf679901fc2465db4c64e4c3742da700d82f4e7
+R c7fed59cac15bf384efc445c22702858
+U stephan
+Z 6f4cb9af43d8857f0cc800aca12dd8f2
 # Remove this line to create a well-formed Fossil manifest.
index d19a148ee41ac3c87af76ef6bda3a3a552973d5d..0ca67e3513e309e9a7905b7e8c6b06bec6d4f7ab 100644 (file)
@@ -1 +1 @@
-0cfbe349d4b740f3d2be8c714cf679901fc2465db4c64e4c3742da700d82f4e7
+6df859cd18ded3ca64a184e45709503dd9b6a3f65e7611d3352f0bad288400f4