# either "canonical" or "autoconf", and others may be added in the
# future.
proc sqlite-config-bootstrap {buildMode} {
- if {$buildMode ni {canonical autoconf}} {
- user-error "Invalid build mode: $buildMode. Expecting one of: canonical, autoconf"
+ set allBuildModes {canonical autoconf}
+ if {$buildMode ni $allBuildModes} {
+ user-error "Invalid build mode: $buildMode. Expecting one of: $allBuildModes"
}
+ set ::sqliteConfig(build-mode) $buildMode
########################################################################
# A gentle introduction to flags handling in autosetup
#
packaging {
{autoconf} {
# --disable-static-shell: https://sqlite.org/forum/forumpost/cc219ee704
- static-shell=1 => {Link the sqlite3 shell app against the DLL instead of embedding sqlite3.c}
+ static-shell=1
+ => {Link the sqlite3 shell app against the DLL instead of embedding sqlite3.c}
}
{*} {
+ # dll-basename: https://sqlite.org/forum/forumpost/828fdfe904
+# dll-basename:=auto
+# => {Secifies the base name of the resulting DLL file, defaulting to a
+# platform-depending name (libsqlite3 on my Unix-style platforms).
+# e.g. --dll-basename=msys-sqlite3-0
+# }
# soname: https://sqlite.org/src/forumpost/5a3b44f510df8ded
soname:=legacy
=> {SONAME for libsqlite3.so. "none", or not using this flag, sets no
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
+ out-implib:=auto
=> {Enable use of --out-implib linker flag to generate an
- "import library" for the DLL}
+ "import library" for the DLL. The output's base name name is
+ specified by the value, with "auto" meaning to figure out a
+ name automatically.}
}
}
developer {
{*} {
# Note that using the --debug/--enable-debug flag here
- # requires patching autosetup/autosetup to rename the --debug
- # to --autosetup-debug.
+ # requires patching autosetup/autosetup to rename its builtin
+ # --debug to --autosetup-debug. See details in
+ # autosetup/README.md.
with-debug=0
debug=0
=> {Enable debug build flags. This option will impact performance by
=> {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}
+ 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}
}
{*} {
dump-defines=0 => {Dump autosetup defines to $::sqliteConfig(dump-defines-txt) (for build debugging)}
set rlLib ""
if {"" ne $rlInc} {
set rlLib [opt-val with-readline-ldflags]
- if {"" eq $rlLib || "auto" eq $rlLib} {
+ if {$rlLib eq "auto" || $rlLib eq ""} {
set rlLib ""
set libTerm ""
if {[proj-check-function-in-lib tgetent "$editLibName ncurses curses termcap"]} {
# libtool applied only on Mac platforms.
#
# Based on https://sqlite.org/forum/forumpost/9dfd5b8fd525a5d7.
-proc sqlite-check-mac-cversion {} {
+proc sqlite-handle-mac-cversion {} {
define LDFLAGS_MAC_CVERSION ""
set rc 0
if {[proj-looks-like-mac]} {
# Define LDFLAGS_OUT_IMPLIB to either an empty string or to a
# -Wl,... flag for the platform-specific --out-implib flag, which is
# used for building an "import library .dll.a" file on some platforms
-# (e.g. mingw). Returns 1 if supported, else 0.
+# (e.g. mingw). Returns 1 if supported, else 0. The actual
#
# If the configure flag --out-implib is not used then this is a no-op.
# If that flag is used but the capability is not available, a fatal
# of libsqlite3.so.a files which are unnecessary in most environments.
#
# Added in response to: https://sqlite.org/forum/forumpost/0c7fc097b2
-proc sqlite-check-out-implib {} {
+#
+# Platform notes:
+#
+# - cygwin packages historically install no .dll.a file.
+#
+# - msys2 packages historically install /usr/lib/libsqlite3.dll.a
+# despite the DLL being in /usr/bin/msys-sqlite3-0.dll.
+proc sqlite-handle-out-implib {} {
define LDFLAGS_OUT_IMPLIB ""
set rc 0
if {[proj-opt-was-provided out-implib]} {
+ set dn [join [opt-val out-implib] ""]
+ if {$dn in {auto ""}} {
+ set dn "libsqlite3" ;# [get-define SQLITE_DLL_BASENAME]
+ }
cc-with {-link 1} {
- set dll "libsqlite3[get-define TARGET_DLLEXT]"
+ set dll "${dn}[get-define TARGET_DLLEXT]"
set flags "-Wl,--out-implib,${dll}.a"
if {[cc-check-flags $flags]} {
define LDFLAGS_OUT_IMPLIB $flags
# Performs late-stage config steps common to both the canonical and
# autoconf bundle builds.
proc sqlite-config-finalize {} {
- sqlite-check-mac-cversion
- sqlite-check-out-implib
+ #sqlite-handle-dll-basename
+ sqlite-handle-out-implib
+ sqlite-handle-mac-cversion
sqlite-process-dot-in-files
sqlite-post-config-validation
sqlite-dump-defines
msg-result "TCL for code generation: [sqlite-determine-codegen-tcl]"
}
+########################################################################
+# Handles the --dll-basename configure flag. [define]'s
+# SQLITE_DLL_BASENAME to the build's perferred base name (minus
+# extension).
+proc sqlite-handle-dll-basename {} {
+ set dn [opt-val dll-basename]
+ if {$rn in {auto ""}} {
+ switch -glob -- [get-define host] {
+ *-*-cygwin* { set dn cygsqlite3-0 }
+ *-*-ming* { set dn libsqlite3-0 }
+ *-*-msys* { set dn msys-sqlite3-0 }
+ default { set dn libsqlite3 }
+ }
+ }
+ define SQLITE_DLL_BASENAME $dn
+}
+
+# TODO? Figure out whether the DLL needs to go under /lib or /bin
+# (msys, cygwin, etc).
+# proc sqlite-handle-dll-install-dir {} {}
+
########################################################################
# If the --dump-defines configure flag is provided then emit a list of
# all [define] values to config.defines.txt, else do nothing.
-C Makefile-internal\svar\srenaming\sin\sprep\sfor\spending\sportability-related\schanges\sin\sthe\shandling\sof\sDLLs.\sNo\sfunctional/build\sinterface\schanges.
-D 2025-02-21T20:22:56.972
+C Extend\s--out-implib\sto\soptionally\sspecify\sthe\simport\slib's\sname.\sAdd\sas-yet-unused\sinternals\sfor\sspecifying\sthe\sDLL's\sbase\sname\s(which\sdiffers\sacross\sthe\sWindows-side\sUnix-esque\senvironments).
+D 2025-02-21T20:28:44.646
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d
-F Makefile.in 80be2e281d4647ac15a5bac15d5d20fc76d1cfb3f3f6dc01d1a26e3346a5042a
+F Makefile.in 2d87dc1a64add400f047d0357f8f30e73b890aa5076b7f8f7d02cd1f3557beb1
F Makefile.linux-generic bd3e3cacd369821a6241d4ea1967395c962dfe3057e38cb0a435cee0e8b789d0
F Makefile.msc 50c656e096ae49ccf9e5e88b4995f0a155f231ebae5b6d185cc64ce99d728a83
F README.md c3c0f19532ce28f6297a71870f3c7b424729f0e6d9ab889616d3587dd2332159
F autosetup/jimsh0.c 6573f6bc6ff204de0139692648d7037ca0b6c067bac83a7b4e087f20a86866a4
F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba
F autosetup/proj.tcl cd6134e98d06ab4ae3be746d185dcdbf5180bfa049fe46a6726e703f56ea2f9c
-F autosetup/sqlite-config.tcl 9d1e3bbc561af5f8705f96c0f48252112d3e2d3356383f5529f7f9f7b51afb65
+F autosetup/sqlite-config.tcl c6c9ad74147e5f0ae39f0e5e207c4a8140066982c7eb21c68dd4b6483f85968e
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 d7729dbbf231d57cbcaaa5004d0a9c4957f112dd6520052995b232aa521c0ca3
-R 9fa57efe9e24b037978a77954d886617
+P ebf41fc90aa9fb1bb96239145c0cdd06eced391499975c71734610996d088641
+R b539368d0fe58a110d27ce4df6690ee7
+T *branch * configure-dll-support
+T *sym-configure-dll-support *
+T -sym-trunk * Cancelled\sby\sbranch.
U stephan
-Z 3e199b62ebb0fe5383698c3c45ceb587
+Z d83368e818c74940a16d5a2f7cf79842
# Remove this line to create a well-formed Fossil manifest.