From: stephan Date: Fri, 7 Feb 2025 02:01:20 +0000 (+0000) Subject: Library-linking and installation fixes for Mac platforms, as discussed in [forum... X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2bda00e2d65a53efc139d37d0d02526271b6010e;p=thirdparty%2Fsqlite.git Library-linking and installation fixes for Mac platforms, as discussed in [forum:9dfd5b8fd5|forum post 9dfd5b8fd5]. These still require testing on such a platform. FossilOrigin-Name: 940e78dd0e13674f177ba1e2d6af67f7ae0d7b71958d40e02f16cb2753884979 --- diff --git a/Makefile.in b/Makefile.in index 15e61217f2..ec48afa2a6 100644 --- a/Makefile.in +++ b/Makefile.in @@ -121,6 +121,8 @@ 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_LIBSQLITE3_OS_SPECIFIC@ +# os-specific: see https://sqlite.org/forum/forumpost/9dfd5b8fd525a5d7 ENABLE_SHARED = @ENABLE_SHARED@ ENABLE_STATIC = @ENABLE_STATIC@ HAVE_WASI_SDK = @HAVE_WASI_SDK@ diff --git a/auto.def b/auto.def index 52c758850c..3a5a2f64c1 100644 --- a/auto.def +++ b/auto.def @@ -230,7 +230,7 @@ proj-if-opt-truthy dev { define CFLAGS [get-env CFLAGS {-O0 -g}] # -------------^^^^^^^ intentionally using [get-env] instead of # [proj-get-env] here because [sqlite-setup-default-cflags] uses - # [proj-get-env]. + # [proj-get-env] and we want this to supercede that. } sqlite-check-common-bins ;# must come before [sqlite-handle-wasi-sdk] @@ -275,6 +275,5 @@ sqlite-handle-load-extension sqlite-handle-math sqlite-handle-icu sqlite-handle-emsdk -sqlite-process-dot-in-files -sqlite-post-config-validation +sqlite-common-late-stage-config sqlite-dump-defines diff --git a/autoconf/Makefile.in b/autoconf/Makefile.in index 0c97f16321..47edce4c67 100644 --- a/autoconf/Makefile.in +++ b/autoconf/Makefile.in @@ -1,8 +1,8 @@ ######################################################################## # This is a main makefile for the "autoconf" bundle of SQLite. This is # a trimmed-down version of the canonical makefile, devoid of most -# documentation. For the full docs, see 'main.mk' in the canonical -# source tree. +# documentation. See /main.mk in the canonical source tree for the +# full docs and the "master copy" of most of the build target recipes. all: TOP = @abs_top_srcdir@ @@ -60,7 +60,6 @@ LDFLAGS.readline = @LDFLAGS_READLINE@ CFLAGS.readline = @CFLAGS_READLINE@ LDFLAGS.icu = @LDFLAGS_ICU@ CFLAGS.icu = @CFLAGS_ICU@ -LDFLAGS.libsqlite3.soname = @LDFLAGS_LIBSQLITE3_SONAME@ # When cross-compiling, we need to avoid the -s flag because it only # works on the build host's platform. @@ -115,12 +114,16 @@ SHELL_OPT ?= @OPT_SHELL@ # OPT_FEATURE_FLAGS = @OPT_FEATURE_FLAGS@ +LDFLAGS.libsqlite3.soname = @LDFLAGS_LIBSQLITE3_SONAME@ +# soname: see https://sqlite.org/src/forumpost/5a3b44f510df8ded +LDFLAGS.libsqlite3.os-specific = @LDFLAGS_LIBSQLITE3_OS_SPECIFIC@ +# os-specific: see https://sqlite.org/forum/forumpost/9dfd5b8fd525a5d7 + LDFLAGS.libsqlite3 = \ $(LDFLAGS.rpath) $(LDFLAGS.pthread) \ $(LDFLAGS.math) $(LDFLAGS.dlopen) \ $(LDFLAGS.zlib) $(LDFLAGS.icu) \ $(LDFLAGS.configure) -LDFLAGS.libsqlite3.soname = @LDFLAGS_LIBSQLITE3_SONAME@ CFLAGS.libsqlite3 = -I. $(CFLAGS.core) $(CFLAGS.icu) $(OPT_FEATURE_FLAGS) sqlite3.o: sqlite3.h sqlite3.c @@ -131,7 +134,8 @@ libsqlite3.SO = libsqlite3$(T.dll) $(libsqlite3.SO): sqlite3.o $(CC) -o $@ sqlite3.o $(LDFLAGS.shlib) \ - $(LDFLAGS) $(LDFLAGS.libsqlite3) $(LDFLAGS.libsqlite3.soname) + $(LDFLAGS) $(LDFLAGS.libsqlite3) \ + $(LDFLAGS.libsqlite3.os-specific) $(LDFLAGS.libsqlite3.soname) all: $(libsqlite3.SO) $(libsqlite3.LIB): sqlite3.o @@ -140,8 +144,16 @@ all: $(libsqlite3.LIB) install-so-1: $(install-dir.lib) $(libsqlite3.SO) $(INSTALL) $(libsqlite3.SO) "$(install-dir.lib)" - @echo "Setting up $(libsqlite3.SO) symlinks..."; \ - cd "$(install-dir.lib)" || exit $$?; \ + @echo "Setting up $(libsqlite3.SO) version symlinks..."; \ + cd "$(install-dir.lib)" || exit $$?; \ + if [ x.dylib = x$(T.dll) ]; then \ + rm -f libsqlite3.0$(T.dll) libsqlite3.$(PACKAGE_VERSION)$(T.dll) || exit $$?; \ + dllname=libsqlite3.$(PACKAGE_VERSION)$(T.dll); \ + mv $(libsqlite3.SO) $$dllname || exit $$?; \ + ln -s $$dllname $(libsqlite3.SO) || exit $$?; \ + ln -s $$dllname libsqlite3.0$(T.dll) || exit $$?; \ + ls -la $$dllname $(libsqlite3.SO) libsqlite3.0$(T.dll); \ + else \ rm -f $(libsqlite3.SO).0 $(libsqlite3.SO).$(PACKAGE_VERSION) || exit $$?; \ mv $(libsqlite3.SO) $(libsqlite3.SO).$(PACKAGE_VERSION) || exit $$?; \ ln -s $(libsqlite3.SO).$(PACKAGE_VERSION) $(libsqlite3.SO) || exit $$?; \ @@ -157,7 +169,9 @@ install-so-1: $(install-dir.lib) $(libsqlite3.SO) rm -f libsqlite3.la $(libsqlite3.SO).0.8.6 || exit $$?; \ ln -s $(libsqlite3.SO).$(PACKAGE_VERSION) $(libsqlite3.SO).0.8.6 || exit $$?; \ ls -la $(libsqlite3.SO).0.8.6; \ - fi + fi; \ + fi + install-so-0 install-so-: install-so: install-so-$(ENABLE_LIB_SHARED) install: install-so diff --git a/autoconf/auto.def b/autoconf/auto.def index 12eb3d75c3..72f50094b8 100644 --- a/autoconf/auto.def +++ b/autoconf/auto.def @@ -94,5 +94,4 @@ sqlite-handle-icu define ENABLE_LIB_SHARED [opt-bool shared] define ENABLE_LIB_STATIC [opt-bool static] -sqlite-process-dot-in-files -sqlite-post-config-validation +sqlite-common-late-stage-config diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl index 9f300e317d..20f5b4d612 100644 --- a/autosetup/sqlite-config.tcl +++ b/autosetup/sqlite-config.tcl @@ -43,7 +43,10 @@ set sqliteConfig(is-cross-compiling) [proj-is-cross-compiling] ######################################################################## # Runs some common initialization which must happen immediately after -# autosetup's [options] function is called. +# 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 {} { # # Carry values from hidden --flag aliases over to their canonical @@ -861,6 +864,22 @@ proc sqlite-handle-math {} { } } +######################################################################## +# Performs late-stage config steps common to both the canonical and +# autoconf bundle builds. +proc sqlite-common-late-stage-config {} { + if {[proj-looks-like-mac]} { + define LDFLAGS_LIBSQLITE3_OS_SPECIFIC \ + "-Wl,-current_version 9.6.0 -Wl,-compatibility_version 9.0.0" + # ^^^ https://sqlite.org/forum/forumpost/9dfd5b8fd525a5d7 + # Those are historical libtool-defined values, not library-defined ones + } else { + define LDFLAGS_LIBSQLITE3_OS_SPECIFIC "" + } + sqlite-process-dot-in-files + sqlite-post-config-validation +} + ######################################################################## # Perform some late-stage work and generate the configure-process # output file(s). diff --git a/main.mk b/main.mk index 00632a5d5c..38d1ba5f56 100644 --- a/main.mk +++ b/main.mk @@ -166,6 +166,7 @@ LDFLAGS.shlib ?= -shared LDFLAGS.icu ?= # -licui18n -licuuc -licudata CFLAGS.icu ?= LDFLAGS.libsqlite3.soname ?= # see https://sqlite.org/src/forumpost/5a3b44f510df8ded +LDFLAGS.libsqlite3.os-specific ?= # see https://sqlite.org/forum/forumpost/9dfd5b8fd525a5d7 # libreadline (or a workalike): # To activate readline in the shell: SHELL_OPT = -DHAVE_READLINE=1 LDFLAGS.readline ?= -lreadline # these vary across platforms @@ -1411,7 +1412,7 @@ all: lib # $(libsqlite3.SO): $(LIBOBJ) $(T.link.shared) -o $@ $(LIBOBJ) $(LDFLAGS.libsqlite3) \ - $(LDFLAGS.libsqlite3.soname) + $(LDFLAGS.libsqlite3.os-specific) $(LDFLAGS.libsqlite3.soname) $(libsqlite3.SO)-1: $(libsqlite3.SO) $(libsqlite3.SO)-0 $(libsqlite3.SO)-: so: $(libsqlite3.SO)-$(ENABLE_SHARED) @@ -1429,6 +1430,9 @@ all: so # unnecessary unless we want to set SONAME to libsqlite3.so.3, which # is also unnecessary. # +# N.B. different transformations are applied on systems where $(T.dll) +# is ".dylib" and none of the following docs apply on such systems. +# # The link named libsqlite3.so.0 is provided in an attempt to reduce # downstream disruption when performing upgrades from pre-3.48 to a # version 3.48 or higher. That name is considered a legacy remnant @@ -1465,8 +1469,16 @@ all: so # install-so-1: $(install-dir.lib) $(libsqlite3.SO) $(INSTALL) $(libsqlite3.SO) "$(install-dir.lib)" - @echo "Setting up $(libsqlite3.SO) symlinks..."; \ - cd "$(install-dir.lib)" || exit $$?; \ + @echo "Setting up $(libsqlite3.SO) version symlinks..."; \ + cd "$(install-dir.lib)" || exit $$?; \ + if [ x.dylib = x$(T.dll) ]; then \ + rm -f libsqlite3.0$(T.dll) libsqlite3.$(PACKAGE_VERSION)$(T.dll) || exit $$?; \ + dllname=libsqlite3.$(PACKAGE_VERSION)$(T.dll); \ + mv $(libsqlite3.SO) $$dllname || exit $$?; \ + ln -s $$dllname $(libsqlite3.SO) || exit $$?; \ + ln -s $$dllname libsqlite3.0$(T.dll) || exit $$?; \ + ls -la $$dllname $(libsqlite3.SO) libsqlite3.0$(T.dll); \ + else \ rm -f $(libsqlite3.SO).0 $(libsqlite3.SO).$(PACKAGE_VERSION) || exit $$?; \ mv $(libsqlite3.SO) $(libsqlite3.SO).$(PACKAGE_VERSION) || exit $$?; \ ln -s $(libsqlite3.SO).$(PACKAGE_VERSION) $(libsqlite3.SO) || exit $$?; \ @@ -1482,7 +1494,8 @@ install-so-1: $(install-dir.lib) $(libsqlite3.SO) rm -f libsqlite3.la $(libsqlite3.SO).0.8.6 || exit $$?; \ ln -s $(libsqlite3.SO).$(PACKAGE_VERSION) $(libsqlite3.SO).0.8.6 || exit $$?; \ ls -la $(libsqlite3.SO).0.8.6; \ - fi + fi; \ + fi install-so-0 install-so-: install-so: install-so-$(ENABLE_SHARED) install: install-so diff --git a/manifest b/manifest index cad7d41db4..8698f0c85a 100644 --- a/manifest +++ b/manifest @@ -1,9 +1,9 @@ -C Bump\sTEA\sconfigure.ac\sversion\snumber. -D 2025-02-07T01:43:05.809 +C Library-linking\sand\sinstallation\sfixes\sfor\sMac\splatforms,\sas\sdiscussed\sin\s[forum:9dfd5b8fd5|forum\spost\s9dfd5b8fd5].\sThese\sstill\srequire\stesting\son\ssuch\sa\splatform. +D 2025-02-07T02:01:20.675 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d -F Makefile.in 38485d15d9190cdad0d7bee25af7b442028865964025dcc61f40fd8d6e369cfc +F Makefile.in 331c1d2926227cb8feb0d127c2e7a6957d2ec69032474d6c16cfdc012d8b57d7 F Makefile.linux-generic bd3e3cacd369821a6241d4ea1967395c962dfe3057e38cb0a435cee0e8b789d0 F Makefile.msc a9b95ae9807e17f9b0734ebe97d68032141c3f95286bb64593cb73b206f043cf F README.md c3c0f19532ce28f6297a71870f3c7b424729f0e6d9ab889616d3587dd2332159 @@ -14,13 +14,13 @@ F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2 F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90 F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2 F art/sqlite370.svg 40b7e2fe8aac3add5d56dd86ab8d427a4eca5bcb3fe4f8946cb3794e1821d531 -F auto.def e7e92090c98aeb0174d29988c259834eb1b71ae1ea927015c3ef300f6f9b68ae +F auto.def fdd6965e06bce02a8b9f9ed57a52d05bcbec4b56e4bef2174866bb5713c65fda F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac -F autoconf/Makefile.in 56697ad25ecf23afa317148b06bdc14f85960b42e5ec434ac1ba87f63a3cb789 +F autoconf/Makefile.in 15f5caf5bef8f135b11ee92f3eba88c5740450f65ea736414f2af889450864ee F autoconf/Makefile.msc 0a071367537dc395285a5d624ac4f99f3a387b27cc5e89752423c0499e15aec4 F autoconf/README.first f1d3876e9a7852c22f275a6f06814e64934cecbc0b5b9617d64849094c1fd136 F autoconf/README.txt 7f01dc3915e2d68f329011073662369e62a0938a2c69398807823c57591cb288 -F autoconf/auto.def 23bc095a3890c0ca334abf7ef67d1c8af4c22c12832bcc738015e868d54fe9d7 +F autoconf/auto.def 71dde17158afcd6fb097b66853371991bb6ca5517b034e2efa9f0c47a2e730f2 F autoconf/tea/Makefile.in ba0556fee8da09c066bad85a4457904e46ee2c2eabaa309c0e83a78f2f151a8e F autoconf/tea/README.txt 61e62e519579e4a112791354d6d440f8b51ea6db3b0bab58d59f29df42d2dfe3 F autoconf/tea/aclocal.m4 52c47aac44ce0ddb1f918b6993e8beb8eee88f43 @@ -50,7 +50,7 @@ F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e F autosetup/jimsh0.c 5a74bdbf43c52289e3f482f3b9578db4bd657e88e8fe04b16c564d9fb710540a F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba F autosetup/proj.tcl 9adf1539673cef15bff862d9360b479e6920cc2c0d85de707b0ba31c04ce4531 -F autosetup/sqlite-config.tcl 00af5b9d94d580367bf01984b86397e8d35b74090427def9591a54ded0e1a287 +F autosetup/sqlite-config.tcl 3f9ed8dd2de3c80c958197b30268937dc62d2934ab10a5354e26cc6fff40d129 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 8cfe182232ac7bbc87530792db6f31c09f2a2f35e9887d0412978746efe42ea9 +F main.mk 70e140c6825aef1ac94c879db7db188be461db15d40e4d9cd9b3e444c2868e21 F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271 F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504 F mptest/crash01.test 61e61469e257df0850df4293d7d4d6c2af301421 @@ -2209,8 +2209,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 e93d7aa1db9bdbf1996c4c168e67284177e384b7acf176d74a0458258faab05c -R 862fe61394e7b3cb4c5d861b55c28308 +P a1a9c780d1f1b47b0408397edded9c5d230c7b144207ad142d06c048792d31fa +R 535b67b945a8416134ed3a37e67f49e7 +T *branch * mac-build-fixes +T *sym-mac-build-fixes * +T -sym-trunk * Cancelled\sby\sbranch. U stephan -Z 4a5b39d46ead9ead0e536423680a6ea5 +Z c25f87dfc79fb2658dd709dd71fb07f1 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 0a49cc208d..bb899e6e22 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a1a9c780d1f1b47b0408397edded9c5d230c7b144207ad142d06c048792d31fa +940e78dd0e13674f177ba1e2d6af67f7ae0d7b71958d40e02f16cb2753884979