1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

On unix-on-windows platforms, if either of --out-implib or --dll-basename are not provided, auto-enable them. Add the 'none' special value to those flags to specifically disable the environment-specific handling of those flags.

FossilOrigin-Name: 486400801a4540392c04d805a47df5249c4010b1a5fbac91900db6149374c274
This commit is contained in:
stephan
2025-02-22 16:31:16 +00:00
parent 1ad8df3c6b
commit 524b8a6df2
4 changed files with 102 additions and 34 deletions

View File

@ -127,8 +127,8 @@ LDFLAGS.libsqlite3.os-specific = @LDFLAGS_MAC_CVERSION@ @LDFLAGS_OUT_IMPLIB@
# - https://sqlite.org/forum/forumpost/9dfd5b8fd525a5d7
# - https://sqlite.org/forum/forumpost/0c7fc097b2
libsqlite3.DLL.basename = @SQLITE_DLL_BASENAME@
# DLL.basename: see https://sqlite.org/forum/forumpost/828fdfe904
libsqlite3.out.implib = @SQLITE_OUT_IMPLIB@
# dll.basename: see https://sqlite.org/forum/forumpost/828fdfe904
ENABLE_LIB_SHARED = @ENABLE_LIB_SHARED@
ENABLE_LIB_STATIC = @ENABLE_LIB_STATIC@
HAVE_WASI_SDK = @HAVE_WASI_SDK@

View File

@ -261,15 +261,17 @@ proc sqlite-config-bootstrap {buildMode} {
dll-basename:=auto
=> {Specifies the base name of the resulting DLL file, defaulting to a
platform-depending name (libsqlite3 on most Unix-style platforms).
If not provided, libsqlite3 is assumed, but if provided without a
value then a platform-dependent default is used.
e.g. --dll-basename=msys-sqlite3-0}
If not provided, libsqlite3 is usually assumed but on some platforms
a platform-dependent default is used. Use "none" to explicitly
disable platform-dependent defaults on platforms where "auto" is
implicitly used if this flag is not provided.}
# out-implib: https://sqlite.org/forum/forumpost/0c7fc097b2
out-implib:=auto
=> {Enable use of --out-implib linker flag to generate an
"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.}
name automatically. Use "none" to explicitly disable the
feature on platforms where it is implicitly on if not provided.}
}
}
@ -1272,6 +1274,7 @@ proc sqlite-handle-mac-cversion {} {
proc sqlite-handle-dll-basename {} {
if {[proj-opt-was-provided dll-basename]} {
set dn [join [opt-val dll-basename] ""]
if {$dn eq "none"} { set dn libsqlite3 }
} else {
set dn libsqlite3
}
@ -1320,6 +1323,7 @@ proc sqlite-handle-out-implib {} {
if {$olBaseName in {auto ""}} {
set olBaseName "libsqlite3" ;# [get-define SQLITE_DLL_BASENAME]
}
if {$olBaseName ne "none"} {
cc-with {-link 1} {
set dll "${olBaseName}[get-define TARGET_DLLEXT]"
set flags "-Wl,--out-implib,${dll}.a"
@ -1333,10 +1337,38 @@ proc sqlite-handle-out-implib {} {
user-error "--out-implib is not supported on this platform"
}
}
}
return $rc
}
########################################################################
# If the given platform identifier (defaulting to [get-define host])
# appears to be one of the Unix-on-Windows environments, returns a
# brief symbolic name for that environment, else returns an empty
# string.
#
# It does not distinguish between msys and msys2, returning msys for
# both. The build does not, as of this writing, specifically support
# msys v1.
proc sqlite-env-is-unix-on-windows {{envTuple ""}} {
if {"" eq $envTuple} {
set envTuple [get-define host]
}
switch -glob -- $envTuple {
*-*-cygwin* { return cygwin }
*-*-ming* { return mingw }
*-*-msys* { return msys }
}
return "";
}
########################################################################
# Performs various tweaks to the build which are only relevant on
# certain platforms, e.g. Mac and "Unix on Windows" platforms (msys2,
# cygwin, ...).
#
# DLL installation:
#
# [define]s SQLITE_DLL_INSTALL_RULES to a symbolic name of a set of
# "make install" rules to use for installation of the DLL
# deliverable. The makefile is tasked with with providing rules named
@ -1346,16 +1378,54 @@ proc sqlite-handle-out-implib {} {
# is (de)activated).
#
# The default value is "unix-generic".
proc sqlite-determine-dll-install-rules {} {
set n unix-generic
switch -glob -- [get-define host] {
*-*-cygwin* { set n cygwin }
*-*-ming* { set n mingw }
*-*-msys* { set n msys }
#
# --out-implib:
#
# On platforms where an "import library" is conventionally used but
# --out-implib was not explicitly used, automatically add that flag.
#
# --dll-basename:
#
# On the same platforms addressed by --out-implib, if --dll-basename
# is not specified, --dll-basename=auto is implied.
proc sqlite-handle-env-quirks {} {
set instName unix-generic; # name of installation rules set
set autoDll 0; # true if --out-implib/--dll-basename should be implied
set host [get-define host]
switch -glob -- $host {
*apple* -
*darwin* { set n darwin }
*darwin* { set instName darwin }
default {
set x [sqlite-env-is-unix-on-windows $host]
if {"" ne $x} {
set instName $x
set autoDll 1
}
define SQLITE_DLL_INSTALL_RULES $n
}
}
define SQLITE_DLL_INSTALL_RULES $instName
if {$autoDll} {
if {![proj-opt-was-provided out-implib]} {
# Imply --out-implib=auto
proj-indented-notice [subst -nocommands -nobackslashes {
NOTICE: auto-enabling --out-implib for $host.
Use --out-implib=none to disable it or --out-implib=auto
to squelch this notice.
}]
proj-opt-set out-implib auto
}
if {![proj-opt-was-provided dll-basename]} {
# Imply --dll-basename=auto
proj-indented-notice [subst -nocommands -nobackslashes {
NOTICE: auto-enabling --dll-basename for $host.
Use --dll-basename=none to disable it or --dll-basename=auto
to squelch this notice.
}]
proj-opt-set dll-basename auto
}
}
sqlite-handle-out-implib
sqlite-handle-mac-cversion
}
########################################################################
@ -1369,9 +1439,7 @@ proc sqlite-config-finalize {} {
# autoconf {
# }
# }
sqlite-determine-dll-install-rules
sqlite-handle-out-implib
sqlite-handle-mac-cversion
sqlite-handle-env-quirks
sqlite-process-dot-in-files
sqlite-post-config-validation
sqlite-dump-defines

View File

@ -1,9 +1,9 @@
C Ensure\sthat\s[08c9e56f60]\suses\san\sabsolute\spath\swhen\sappending\s.exe\sto\smksourceid.
D 2025-02-22T14:58:20.584
C On\sunix-on-windows\splatforms,\sif\seither\sof\s--out-implib\sor\s--dll-basename\sare\snot\sprovided,\sauto-enable\sthem.\sAdd\sthe\s'none'\sspecial\svalue\sto\sthose\sflags\sto\sspecifically\sdisable\sthe\senvironment-specific\shandling\sof\sthose\sflags.
D 2025-02-22T16:31:16.755
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d
F Makefile.in b2b4b30fd8c1be9713861c501f8035b57845c54ac42c4276452d5eb94e9ea3eb
F Makefile.in 18fe2ad1e0da1fc98843d53c48a5ee7e180eacccdae532e1bad9f95d4fabde7d
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 04fd2d110b6464f7a2847380a39bed647c2646a868a4ed60f7a625e52a9a8b20
F autosetup/sqlite-config.tcl 2422f6fd2cd2120e8812c0e6e4f6d2cb888cc6312a49f265834d0913c09fa6b9
F autosetup/sqlite-config.tcl f5ced060a400ab0758c560347466083ea3ea822db260b40c3266d62a9812313a
F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9
F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x
F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad
@ -2210,8 +2210,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 2ee73109809e7d4a9d203cfa42f29c62837c06dc414f9dbf17ce00d9bbb5a883
R 9554fb958ccc8ca614713f13fcd64b48
P 906d27f7a645833595f02ddf05892703783d89116b1009f04e0b71679ff34a8b
R 38c1112c07cd683cb8ec01f377bddc57
U stephan
Z 090a992d630fbdcddf86913e7feb0d82
Z 51cfa32526ca2c68d3558aae78fd6a9a
# Remove this line to create a well-formed Fossil manifest.

View File

@ -1 +1 @@
906d27f7a645833595f02ddf05892703783d89116b1009f04e0b71679ff34a8b
486400801a4540392c04d805a47df5249c4010b1a5fbac91900db6149374c274