From: stephan Date: Sun, 9 Feb 2025 04:38:56 +0000 (+0000) Subject: configure: if the linker supports --out-implib, generate libsqlite3.X.a, where X... X-Git-Tag: major-release~313 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=63f49265244842f04ae40d14df0bc8b434ca85e1;p=thirdparty%2Fsqlite.git configure: if the linker supports --out-implib, generate libsqlite3.X.a, where X is the platform's DLL file extension. Discussion in/around [forum:0c7fc097b2|forum post 0c7fc097b2]. FossilOrigin-Name: 6092b0b86bf93a3d58a83774b6d07ef9735e6c8a0f2ac2d0a6d263c2e9f1e3ca --- diff --git a/Makefile.in b/Makefile.in index f514046e00..b932f56e20 100644 --- a/Makefile.in +++ b/Makefile.in @@ -121,8 +121,10 @@ LDFLAGS.icu = @LDFLAGS_ICU@ CFLAGS.icu = @CFLAGS_ICU@ LDFLAGS.libsqlite3.soname = @LDFLAGS_LIBSQLITE3_SONAME@ # soname: see https://sqlite.org/src/forumpost/5a3b44f510df8ded -LDFLAGS.libsqlite3.os-specific = @LDFLAGS_MAC_CVERSION@ -# os-specific: see https://sqlite.org/forum/forumpost/9dfd5b8fd525a5d7 +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 ENABLE_SHARED = @ENABLE_SHARED@ ENABLE_STATIC = @ENABLE_STATIC@ HAVE_WASI_SDK = @HAVE_WASI_SDK@ diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl index 2a73548662..f1888084e4 100644 --- a/autosetup/sqlite-config.tcl +++ b/autosetup/sqlite-config.tcl @@ -920,11 +920,33 @@ proc sqlite-check-mac-cversion {} { return $rc } +######################################################################## +# 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. +# +# Added in response to: https://sqlite.org/forum/forumpost/0c7fc097b2 +proc sqlite-check-out-implib {} { + define LDFLAGS_OUT_IMPLIB "" + set rc 0 + cc-with {} { + set dll "libsqlite3[get-define TARGET_DLLEXT]" + set flags "-Wl,--out-implib,${dll}.a" + if {[cc-check-flags $flags]} { + define LDFLAGS_OUT_IMPLIB $flags + set rc 1 + } + } + return $rc +} + ######################################################################## # Performs late-stage config steps common to both the canonical and # autoconf bundle builds. proc sqlite-common-late-stage-config {} { sqlite-check-mac-cversion + sqlite-check-out-implib sqlite-process-dot-in-files sqlite-post-config-validation } diff --git a/main.mk b/main.mk index 27b8848879..f5d8185f71 100644 --- a/main.mk +++ b/main.mk @@ -2332,7 +2332,7 @@ tidy: tidy-. rm -f lemon$(B.exe) sqlite*.tar.gz rm -f mkkeywordhash$(B.exe) mksourceid$(B.exe) rm -f parse.* fts5parse.* - rm -f $(libsqlite3.SO) $(libsqlite3.LIB) $(libtclsqlite3.SO) + rm -f $(libsqlite3.SO) $(libsqlite3.LIB) $(libtclsqlite3.SO) libsqlite3$(T.dll).a rm -f tclsqlite3$(T.exe) $(TESTPROGS) rm -f LogEst$(T.exe) fts3view$(T.exe) rollback-test$(T.exe) showdb$(T.exe) rm -f showjournal$(T.exe) showstat4$(T.exe) showwal$(T.exe) speedtest1$(T.exe) diff --git a/manifest b/manifest index 1172e83ce6..ea5197a572 100644 --- a/manifest +++ b/manifest @@ -1,9 +1,9 @@ -C wasm:\sadd\ssome\sbuild-time\svalidation\sto\sensure\sthat\sthe\sproblem\sfixed\sin\s[65798c09a00662a3]\sdoes\snot\srecur.\sEnsure\sthat\sfiles\sgenerated\svia\smkwasmbuilds.c\shave\sthe\sgenerated\smakefile\sas\sa\sdependency. -D 2025-02-09T04:16:01.518 +C configure:\sif\sthe\slinker\ssupports\s--out-implib,\sgenerate\slibsqlite3.X.a,\swhere\sX\sis\sthe\splatform's\sDLL\sfile\sextension.\sDiscussion\sin/around\s[forum:0c7fc097b2|forum\spost\s0c7fc097b2]. +D 2025-02-09T04:38:56.042 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d -F Makefile.in 85ed87882b5d3fd11e6403212f2120e5e07d341bc96a101cfa9475901edd0754 +F Makefile.in 63c4d6e535dac4b7f6a6ffa566c96e3d68fa7f244799c38ee1e3d59305c5b55b F Makefile.linux-generic bd3e3cacd369821a6241d4ea1967395c962dfe3057e38cb0a435cee0e8b789d0 F Makefile.msc a9b95ae9807e17f9b0734ebe97d68032141c3f95286bb64593cb73b206f043cf 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 af5290ee128ce82dd178a474a9dcfaa7e503c88f0709d916cc6079d9b8c801f4 -F autosetup/sqlite-config.tcl d2c6467c557ec0437f2115e94fbe7a77af2d3e6d34b98b8ad85212f5cb890332 +F autosetup/sqlite-config.tcl 6bff327462d34d2d9fe45738b0be70b80cf709de91b8c3b8a921cbdc2f05f6ff F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad @@ -702,7 +702,7 @@ F ext/wasm/tests/opfs/concurrency/test.js d08889a5bb6e61937d0b8cbb78c9efbefbf65a F ext/wasm/tests/opfs/concurrency/worker.js 0a8c1a3e6ebb38aabbee24f122693f1fb29d599948915c76906681bb7da1d3d2 F ext/wasm/wasmfs.make 68999f5bd8c489239592d59a420f8c627c99169bbd6fa16a404751f757b9f702 F magic.txt 5ade0bc977aa135e79e3faaea894d5671b26107cc91e70783aa7dc83f22f3ba0 -F main.mk 0e3695222412c9388d8e7db612249cd0cd02722c62a16c48be7c77a7639628a8 +F main.mk 7c9df07a41c406a5fbe4e7e4021f29fa4f18821d61354721fd0435fc24f95321 F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271 F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504 F mptest/crash01.test 61e61469e257df0850df4293d7d4d6c2af301421 @@ -2209,9 +2209,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 1f554610ba5d9d474ec4570bb7ca09125fd2cdfb4976530a4227cc6ebdf3a962 -Q +012b308b04e6a9e3acbb842317b01b4b91ac165b925918cf20c1f52d045a6ec0 -R 808b1c99ce5bd703201eda0df9bba093 +P 55e01365946b3432e93da5c08200e476e2a134c98b963b4170e4dfae8408a005 +R e1eadfc29a299ad14b7e6250e28c0f67 U stephan -Z 6ac45fbba274f684a5ae3627af8e6a38 +Z 4dcc7ba8a1a116665e01ae1e0e3cb31a # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index f2651eae98..474bb40f6f 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -55e01365946b3432e93da5c08200e476e2a134c98b963b4170e4dfae8408a005 +6092b0b86bf93a3d58a83774b6d07ef9735e6c8a0f2ac2d0a6d263c2e9f1e3ca