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

When either --readline or --editline are explicitly provided but the corresponding feature is not found, fail fatally. If not explicitly requested, simply disable that feature if the lib is not found.

FossilOrigin-Name: 1d24a29c6ef05185950ba5c45f2a60a92f12a8e5c57026b599f716c9f2f6cf84
This commit is contained in:
stephan 2024-10-29 08:42:06 +00:00
parent 4cbc413a25
commit 02834a9a3d
3 changed files with 31 additions and 7 deletions

View File

@ -734,6 +734,20 @@ if {1} {
#
# Returns a string describing which line-editing approach to use, or
# "none" if no option is available.
#
# Order of checks:
#
# 1) --with-linenoise trumps all others
#
# 2) --editline trumps --readline
#
# 3) --disable-readline trumps --readline
#
# 4) Default to automatic search for optional readline
#
# 5) Try to find readline resp. editline. If it's not found AND the
# corresponding --FEATURE flag was explicitly given, fail fatally,
# else fail silently.
proc sqlite-check-line-editing {} {
msg-result "Checking for line-editing capability..."
define HAVE_READLINE 0
@ -741,6 +755,7 @@ proc sqlite-check-line-editing {} {
define HAVE_EDITLINE 0
define LDFLAGS_READLINE ""
define CFLAGS_READLINE ""
set failIfNotFound 0 ; # Set to 1 for explicit --FEATURE requests when FEATURE is not found
set libsForReadline {readline edit} ; # -l names to check for readline()
set editLibName "readline" ; # "readline" or "editline"
set editLibDef "HAVE_READLINE" ; # "HAVE_READLINE" or "HAVE_EDITLINE"
@ -773,11 +788,16 @@ proc sqlite-check-line-editing {} {
# end up finding <editline/readline.h> below, we will use
# -DHAVE_EDITLINE=1, else we will use -DHAVE_READLINE=1. In either
# case, we will link against libedit.
set failIfNotFound 1
set libsForReadline {edit}
set editLibName editline
} elseif {![opt-bool readline]} {
msg-result "Readline support explicitly disabled with --disable-readline"
return "none"
} elseif {[proj-opt-was-provided readline]} {
# If an explicit --enable-readline was used, fail if it's not found,
# else treat the feature as optional.
set failIfNotFound 1
}
# Transform with-readline-header=X to with-readline-cflags=-I...
@ -896,6 +916,10 @@ proc sqlite-check-line-editing {} {
return $editLibName
}
if {$failIfNotFound} {
proj-fatal "Explicit --$editLibName failed to find a matching library."
}
return "none"
}; # sqlite-check-line-editing
msg-result "Line-editing support for the sqlite3 shell: [sqlite-check-line-editing]"

View File

@ -1,5 +1,5 @@
C Minor\s--help\stext\stweak.
D 2024-10-29T08:18:45.075
C When\seither\s--readline\sor\s--editline\sare\sexplicitly\sprovided\sbut\sthe\scorresponding\sfeature\sis\snot\sfound,\sfail\sfatally.\sIf\snot\sexplicitly\srequested,\ssimply\sdisable\sthat\sfeature\sif\sthe\slib\sis\snot\sfound.
D 2024-10-29T08:42:06.048
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 668d8f3b131c77a4ed3cba4b657ca39bbc674480542c63cda3c0a69f07fbb71b
F auto.def 416110aed3a3fe50fa6902ff82bccb24243f0b2a20d7f2bc83b6cea519c90b18
F autoconf/INSTALL 83e4a25da9fd053c7b3665eaaaf7919707915903
F autoconf/Makefile.am adedc1324b6a87fdd1265ddd336d2fb7d4f36a0e77b86ea553ae7cc4ea239347
F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac
@ -2198,8 +2198,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 db9870caa806c902cae033a96fec48db1b2d78b96b124e568479c5326e006c9b
R 64e0dc3cdfa9939ef91bb975c4e5bc84
P 80ac10ed8d0ee9eaf83a6c43608098c631f5f9535c8b125da5bfe2d6a4d23bec
R db8a68fd2e53d23ef8f48e7caeaffa7c
U stephan
Z 4b590d1a39e9d5937dc34e5d02b161d2
Z 7e16d1fa4c3f0d8fad8a4fd41d97e038
# Remove this line to create a well-formed Fossil manifest.

View File

@ -1 +1 @@
80ac10ed8d0ee9eaf83a6c43608098c631f5f9535c8b125da5bfe2d6a4d23bec
1d24a29c6ef05185950ba5c45f2a60a92f12a8e5c57026b599f716c9f2f6cf84