]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Extend --out-implib to optionally specify the import lib's name. Add as-yet-unused...
authorstephan <stephan@noemail.net>
Fri, 21 Feb 2025 20:28:44 +0000 (20:28 +0000)
committerstephan <stephan@noemail.net>
Fri, 21 Feb 2025 20:28:44 +0000 (20:28 +0000)
FossilOrigin-Name: 12a55d343f9663acb68cd0f75fbb6c9ab67f4f88ad296e3e266f12d91522dd19

Makefile.in
autosetup/sqlite-config.tcl
manifest
manifest.uuid

index 1ff791c8abca2fc2fd16ed3e0d14829d1dc0bd43..99b3a8c8d1e82093367a23414f2d99b45408065f 100644 (file)
@@ -126,6 +126,8 @@ LDFLAGS.libsqlite3.os-specific = @LDFLAGS_MAC_CVERSION@ @LDFLAGS_OUT_IMPLIB@
 # os-specific: see
 # - https://sqlite.org/forum/forumpost/9dfd5b8fd525a5d7
 # - https://sqlite.org/forum/forumpost/0c7fc097b2
+# dll.basename: see https://sqlite.org/forum/forumpost/828fdfe904
+#libsqlite3.DLL.basename = @ SQLITE_DLL_BASENAME @
 ENABLE_SHARED = @ENABLE_SHARED@
 ENABLE_STATIC = @ENABLE_STATIC@
 HAVE_WASI_SDK = @HAVE_WASI_SDK@
index 856be4cabcd9e48f4e8f63549a98c83ff5e0bb4b..6dc1534314261abaed774855a549cb646c664c36 100644 (file)
@@ -51,9 +51,11 @@ set sqliteConfig(is-cross-compiling) [proj-is-cross-compiling]
 # 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
   #
@@ -241,9 +243,16 @@ proc sqlite-config-bootstrap {buildMode} {
     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
@@ -253,9 +262,11 @@ proc sqlite-config-bootstrap {buildMode} {
               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.}
       }
     }
 
@@ -263,8 +274,9 @@ proc sqlite-config-bootstrap {buildMode} {
     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
@@ -275,11 +287,16 @@ proc sqlite-config-bootstrap {buildMode} {
           => {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)}
@@ -970,7 +987,7 @@ proc sqlite-check-line-editing {} {
   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"]} {
@@ -1222,7 +1239,7 @@ proc sqlite-handle-math {} {
 # 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]} {
@@ -1247,7 +1264,7 @@ proc sqlite-check-mac-cversion {} {
 # 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
@@ -1258,12 +1275,23 @@ proc sqlite-check-mac-cversion {} {
 # 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
@@ -1281,8 +1309,9 @@ proc sqlite-check-out-implib {} {
 # 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
@@ -1738,6 +1767,27 @@ proc sqlite-handle-tcl {} {
   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.
index 0a89891bbe55554954e596b1e661f99caa258186..b3770f3396ae1db12ea425d42f46fe3ab3503019 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,9 +1,9 @@
-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
@@ -50,7 +50,7 @@ F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e
 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
@@ -2210,8 +2210,11 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350
 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.
index e261d3c10bf2192c43a7a1943c93b889d8d7a6f9..7217eed5fe00fcee1c62d3319687d5ae82c66229 100644 (file)
@@ -1 +1 @@
-ebf41fc90aa9fb1bb96239145c0cdd06eced391499975c71734610996d088641
+12a55d343f9663acb68cd0f75fbb6c9ab67f4f88ad296e3e266f12d91522dd19