0
0
mirror of https://github.com/sqlite/sqlite.git synced 2024-11-21 19:29:09 +01:00

Rename --with-readline-lib/inc to --with-readline-ldflags/cflags, for clarity, but retain the older names as aliases using autosetup's "hidden alias" feature. Rename the newly-added --with-icu-lib to --with-icu-ldflags (with no backwards compatibility).

FossilOrigin-Name: e50a03f9f2a40a5e65f874ffff234a7b397ce4ebdc7b360d4e6ade7575577c38
This commit is contained in:
stephan 2024-10-27 20:04:23 +00:00
parent 6bb44daae4
commit f6e86e38ac
4 changed files with 58 additions and 22 deletions

View File

@ -163,15 +163,21 @@ set flags {
largefile=1 => {Disable large file support}
shared=1 => {Disable build of shared libary}
static=1 => {Disable build of static library}
with-readline-lib:LDFLAGS
# --with-readline-lib is a legacy name, now a backwards-compatible
# alias for --with-readline-ldflags.
with-readline-lib:
with-readline-ldflags:LDFLAGS
=> {Readline LDFLAGS, e.g. -lreadline -lncurses}
with-readline-inc:CFLAGS
# --with-readline-inc is a legacy name, now a backwards-compatible
# alias for --with-readline-ldflags.
with-readline-inc:
with-readline-cflags:CFLAGS
=> {Readline CFLAGS, e.g. -I/path/to/includes}
with-readline-header:PATH
=> {Full path to readline.h, from which --with-readline-inc will be derived}
=> {Full path to readline.h, from which --with-readline-cflags will be derived}
with-linenoise:DIR => {Source directory for linenoise.c and linenoise.h}
with-icu-lib:LDFLAGS => {Enable SQLITE_ENABLE_ICU and add the given linker flags for the ICU libraries}
icu-collations=0 => {Enable SQLITE_ENABLE_ICU_COLLATIONS. Requires --with-icu-lib=...}
with-icu-ldflags:LDFLAGS => {Enable SQLITE_ENABLE_ICU and add the given linker flags for the ICU libraries}
icu-collations=0 => {Enable SQLITE_ENABLE_ICU_COLLATIONS. Requires --with-icu-ldflags=...}
amalgamation=1 => {Disable the amalgamation and instead build all files separately}
load-extension=1 => {Disable loading of external extensions}
math=1 => {Disable math functions}
@ -201,6 +207,15 @@ if {"" ne $DUMP_DEFINES_JSON} {
options [subst $flags]
unset flags
# Apply values from hidden --flag aliases over to their canonical
# forms.
foreach {hidden flag canonical} {
with-readline-inc => with-readline-cflags
with-readline-lib => with-readline-ldflags
} {
hwaci-xfer-opt-alias $hidden $canonical
}
set srcdir $::autosetup(srcdir)
set top_srcdir [get-define abs_top_srcdir]
set PACKAGE_VERSION [readfile $srcdir/VERSION]
@ -817,7 +832,7 @@ proc sqlite-check-line-editing {} {
#
# However, a workaround which works on the available systems is:
#
# --with-readline-lib=-ledit
# --with-readline-ldflags=-ledit
#
# And then let it detect readline.h. We "could" re-map
# --enable-editline to do exactly that but it seems likely to
@ -827,7 +842,7 @@ proc sqlite-check-line-editing {} {
WARNING: the --enable-editline flag is not supported due to
non-availability of systems which have it in a form which the
sqlite3 CLI shell expects to see. On some systems this can be
worked around by passing --with-readline-lib=-ledit instead of
worked around by passing --with-readline-ldflags=-ledit instead of
--enable-editline, which will attempt to use the readline.h
supplied by libreadline but link against -ledit.
}
@ -837,12 +852,12 @@ proc sqlite-check-line-editing {} {
return "none"
}
# Transform with-readline-header=X to with-readline-inc=-I...
# Transform with-readline-header=X to with-readline-cflags=-I...
set v [opt-val with-readline-header]
hwaci-opt-set with-readline-header ""
if {"" ne $v} {
if {"auto" eq $v} {
hwaci-opt-set with-readline-inc auto
hwaci-opt-set with-readline-cflags auto
} else {
set v [file dirname $v]
if {[string match */*line $v]} {
@ -853,12 +868,12 @@ proc sqlite-check-line-editing {} {
# work!
set v [file dirname $v]
}
hwaci-opt-set with-readline-inc "-I$v"
hwaci-opt-set with-readline-cflags "-I$v"
}
}
# Look for readline.h
set rlInc [opt-val with-readline-inc auto]
set rlInc [opt-val with-readline-cflags auto]
if {"auto" eq $rlInc} {
set rlInc ""
if {!$::cross_compiling} {
@ -880,7 +895,7 @@ proc sqlite-check-line-editing {} {
# If readline.h was found/specified, look for libreadline...
set rlLib ""
if {"" ne $rlInc} {
set rlLib [opt-val with-readline-lib]
set rlLib [opt-val with-readline-ldflags]
if {"" eq $rlLib || "auto" eq $rlLib} {
set rlLib ""
set libTerm ""
@ -978,7 +993,7 @@ unset emccsh
########################################################################
# ICU
if {"" ne [define LDFLAGS_ICU [join [opt-val with-icu-lib ""]]]} {
if {"" ne [define LDFLAGS_ICU [join [opt-val with-icu-ldflags ""]]]} {
# Flags sets seen in the wild for ICU:
# {-licui18n -licuuc -licudata} {-licui18n -licuuc}
add-feature-flag -DSQLITE_ENABLE_ICU
@ -989,7 +1004,7 @@ if {"" ne [define LDFLAGS_ICU [join [opt-val with-icu-lib ""]]]} {
add-feature-flag -DSQLITE_ENABLE_ICU_COLLATIONS
}
} elseif {[opt-bool icu-collations]} {
hwaci-warn "ignoring --enable-icu-collations because --with-icu-lib was not specified"
hwaci-warn "ignoring --enable-icu-collations because --with-icu-ldflags was not specified"
}
########################################################################

View File

@ -975,3 +975,24 @@ proc hwaci-dump-defs-json {file args} {
msg-result "Created $file"
}
}
########################################################################
# Expects configure flags with the given names to have been registered
# with autosetup. If [opt-val $hidden] has a value but [opt-val
# $canonical] does not, it copies the former over the latter. If both
# have explicit values a fatal usage error is triggered.
#
# Autosetup accounts for hidden aliases in [options] lists but does no
# further handling of them, e.g. fetching [opt-val foo] will not, even
# if foo is an alias for bar, see a value passed in as --bar=baz.
proc hwaci-xfer-opt-alias {hidden canonical} {
set x [opt-val $hidden "-9-9-9-"]
if {"-9-9-9-" ne $x} {
set y [opt-val $canonical "-0-0-0-"]
if {"-0-0-0-" eq $y} {
hwaci-opt-set $canonical $x
} else {
hwaci-fatal "both --$canonical and its hidden alias --$hidden were used. Use only one or the other."
}
}
}

View File

@ -1,5 +1,5 @@
C When\sICU\sis\senabled,\sensure\sthat\sthe\sCLI\sshell\sbuild\senables\sits\sfeature\sflag\sand\sinclude\sLDFLAGS_ICU\sin\ssqlite3.pc.
D 2024-10-27T19:26:54.435
C Rename\s--with-readline-lib/inc\sto\s--with-readline-ldflags/cflags,\sfor\sclarity,\sbut\sretain\sthe\solder\snames\sas\saliases\susing\sautosetup's\s"hidden\salias"\sfeature.\sRename\sthe\snewly-added\s--with-icu-lib\sto\s--with-icu-ldflags\s(with\sno\sbackwards\scompatibility).
D 2024-10-27T20:04:23.738
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md b6e6c1baf38e4339bd3f1e0e5e5bfd0a9a93d133360691b2785c2d4b2f2dcec2
@ -13,7 +13,7 @@ F art/icon-80x90.gif 65509ce3e5f86a9cd64fe7fca2d23954199f31fe44c1e09e208c80fb83d
F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2
F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90
F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2
F auto.def 580df10aeb7d12fb939a5f503cd30d2a5d619ac6bb8e94cd3f3f8b425388da13
F auto.def 7f4a0a1421306ed8bca11d54b754f01dbf76054d17894c7c88fad0c05e2fadba
F autoconf/INSTALL 83e4a25da9fd053c7b3665eaaaf7919707915903
F autoconf/Makefile.am adedc1324b6a87fdd1265ddd336d2fb7d4f36a0e77b86ea553ae7cc4ea239347
F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac
@ -47,7 +47,7 @@ F autosetup/cc-lib.tcl 493c5935b5dd3bf9bd4eca89b07c8b1b1a9356d61783035144e21795f
F autosetup/cc-shared.tcl 4f024e94a47f427ba61de1739f6381ef0080210f9fae89112d5c1de1e5460d78
F autosetup/cc.tcl 7e2fe943ae9d45cf39e9f5b05b6230df8e719415edea5af06c30eb68680bde14
F autosetup/default.auto 5cdf016de2140e50f1db190a02039dc42fb390af1dda4cc4853e3042a9ef0e82
F autosetup/hwaci-common.tcl 0e8643bcacf4fd73be0b194faf21b18a7229dd61347eb204a368fef45a0bee87
F autosetup/hwaci-common.tcl 7839c061ae85648d1440ef95f75f4c1f18008458b7a3a81beaebeb7d2470a0dc
F autosetup/jimsh0.c 27ea5f221359ef6c58780fc6c185aadbf8d3bee9a021331a3e5de0eba0dc6de6
F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba
F autosetup/system.tcl 3a39d6e0b3bfba526fd39afe07c1d0d325e5a31925013a1ba7c671e1128e31bb
@ -2237,8 +2237,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P 4564dbe4ac0040803b5d139c9fff22a60a45b4769d80ad7c824456cc6b9f1722
R 862234bfe7dc3dea608ab0b1a9f6ed4c
P abec913c00564ee5453075f45b1a6680e92ee1b1e61e3b19e4cf74e46785d3bf
R 8c93632539b57f8beda5bb3056f97174
U stephan
Z 08f197b7ace262c34243258f45fb1526
Z 46a44527cb166d23de983b40142b0922
# Remove this line to create a well-formed Fossil manifest.

View File

@ -1 +1 @@
abec913c00564ee5453075f45b1a6680e92ee1b1e61e3b19e4cf74e46785d3bf
e50a03f9f2a40a5e65f874ffff234a7b397ce4ebdc7b360d4e6ade7575577c38