readline=1 => {Disable readline support}
largefile=1 => {Disable large file support}
shared=1 => {Disable build of shared libary}
- with-readline-ldflags: => {Readline LDFLAGS, e.g. -lreadline -lncurses}
- with-readline-cflags: => {Readline CFLAGS, e.g. -I/path/to/includes}
- with-readline-header: => {Full path to readline.h, from which --with-readline-cflags will be derived.}
- with-linenoise:DIR => {}
+ with-readline-ldflags:LDFLAGS => {Readline LDFLAGS, e.g. -lreadline -lncurses}
+ 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-cflags will be derived.}
+ with-linenoise:DIR => {Source directory for linenoise.c and linenoise.h}
amalgamation=1 => {Disable the amalgamation and instead build all files separately}
load-extension=1 => {Disable loading of external extensions}
math=1 => {Disable math functions}
}
########################################################################
-# Jump through proverbial hoops to try to find a working line-editing
-# library, setting:
+# hwaci-check-line-editing jumps through proverbial hoops to try to
+# find a working line-editing library, setting:
#
-# - LDFLAGS_READLINE = linker flags
+# - HAVE_READLINE to 0 or 1
+# - HAVE_LINENOISE to 0 or 1
+# - HAVE_EDITLINE to 0 or 1
#
-# - CFLAGS_READLINE = compilation flags for clients
+# - LDFLAGS_READLINE = linker flags or empty string
+#
+# - CFLAGS_READLINE = compilation flags for clients or empty string
#
# - READLINE_H = header in the form "<.../readline.h>" IF we can
# figure it out. shell.c does not currently use this.
-proc hwaci-check-readline2 {} {
+#
+# Note that LDFLAGS_READLINE and CFLAGS_READLINE may refer to
+# linenoise or editline, not necessarily libreadline.
+#
+# Returns a string describing which line-editing approach to use, or
+# "none" if no option is available.
+proc hwaci-check-line-editing {} {
define HAVE_READLINE 0
+ define HAVE_LINENOISE 0
+ define HAVE_EDITLINE 0
define LDFLAGS_READLINE ""
define CFLAGS_READLINE ""
define READLINE_H ""
- if {![opt-bool readline]} {
- msg-result "Readline support explicitly disabled with --disable-readline."
- return 0
+ set check [opt-val with-linenoise]
+ if {"" ne $check} {
+ # Use linenoise...
+ set dirLn $check
+ if {![file isdir $dirLn]} {
+ hwaci-fatal "--with-linenoise value is not a directory"
+ }
+ if {![file exists $dirLn/linenoise.c] } {
+ hwaci-fatal "Cannot find linenoise.c in $dirLn"
+ }
+ if {![file exists $dirLn/linenoise.h] } {
+ hwaci-fatal "Cannot find linenoise.h in $dirLn"
+ }
+ user-notice "Using linenoise from $dirLn"
+ define CFLAGS_READLINE "-I$dirLn $dirLn/linenoise.c"
+ define HAVE_LINENOISE 1
+ add-shell-opt -DHAVE_LINENOISE=1
+ return "linenoise"
+ } elseif {[opt-bool editline]} {
+ # Use editline...
+ user-notice "WARNING: the --enable-editline flag is not yet supported"
+ return "none"
+ } elseif {![opt-bool readline]} {
+ user-notice "Readline support explicitly disabled with --disable-readline."
+ return "none"
}
set check [opt-val with-readline-ldflags][opt-val with-readline-cflags][opt-val with-readline-header]
if {"" ne $check} {
define CFLAGS_READLINE $fC
define HAVE_READLINE 1
add-shell-opt -DHAVE_READLINE=1
- msg-result "Using client-provided readline flags: $fC $fL"
- } elseif {1} {
- # Try the project-agnostic readline detector:
- add-shell-opt -DHAVE_READLINE=[hwaci-check-readline]
- # TODO: reimplement:
- # --enable-editline
- # --with-readline-lib specify readline library
- # --with-readline-inc specify readline include paths
- # --with-linenoise=DIR source directory for linenoise library
- } else {
- # Older impl solely for reference while porting...
- #
- # XXX TARGET_READLINE_LIBS=""
- # XXX TARGET_READLINE_INC=""
- # XXX TARGET_HAVE_READLINE=0
- # XXX TARGET_HAVE_EDITLINE=0
- if {[opt-bool editline]} {
- set with_editline $enableval
- } else {
- set with_editline auto
- }
- if {![opt-bool readline]} {
- set with_readline $enableval
- } else {
- set with_readline auto
- }
-
- # XXX if test x"$with_editline" != xno; then
- # XXX sLIBS=$LIBS
- # XXX LIBS=""
- # XXX TARGET_HAVE_EDITLINE=1
- if {[hwaci-check-function-in-lib readline edit]} {
- set with_readline no
- } else {
- # XXX TARGET_HAVE_EDITLINE=0
- }
- # XXX TARGET_READLINE_LIBS=$LIBS
- # XXX LIBS=$sLIBS
- # XXX fi
- # XXX if test x"$with_readline" != xno; then
- set found "yes"
-
- if {[opt-val with-readline-lib] ne {}} {
- set withval [lindex [opt-val with-readline-lib] end]
- set with_readline_lib $withval
- } else {
- set with_readline_lib "auto"
- }
- # XXX if test "x$with_readline_lib" = xauto; then
- # XXX save_LIBS="$LIBS"
- # XXX LIBS=""
- if {[hwaci-check-function-in-lib tgetent readline ncurses curses termcap]} {
- # XXX term_LIBS="$LIBS"
- } else {
- # XXX term_LIBS=""
- }
- if {[hwaci-check-function-in-lib readline readline]} {
- # XXX TARGET_READLINE_LIBS="-lreadline"
- } else {
- set found "no"
- }
- # XXX TARGET_READLINE_LIBS="$TARGET_READLINE_LIBS $term_LIBS"
- # XXX LIBS="$save_LIBS"
- # XXX else
- # XXX TARGET_READLINE_LIBS="$with_readline_lib"
- # XXX fi
-
- if {[opt-val with-readline-inc] ne {}} {
- set withval [lindex [opt-val with-readline-inc] end]
- set with_readline_inc $withval
- } else {
- set with_readline_inc "auto"
- }
- # XXX if test "x$with_readline_inc" = xauto; then
- if {[cc-check-includes readline.h]} {
- set found "yes"
- } else {
- set found "no"
- # XXX if test "$cross_compiling" != yes; then
- # XXX for dir in /usr /usr/local /usr/local/readline /usr/contrib /mingw; do
- # XXX for subdir in include include/readline; do
- # XXX AC_CHECK_FILE $dir/$subdir/readline.h found=yes
- # XXX if test "$found" = "yes"; then
- # XXX TARGET_READLINE_INC="-I$dir/$subdir"
- # XXX break
- # XXX fi
- # XXX done
- # XXX test "$found" = "yes" && break
- # XXX done
- # XXX fi
- }
- # XXX else
- # XXX TARGET_READLINE_INC="$with_readline_inc"
- # XXX fi
-
- # XXX if test x"$found" = xno; then
- # XXX TARGET_READLINE_LIBS=""
- # XXX TARGET_READLINE_INC=""
- # XXX TARGET_HAVE_READLINE=0
- # XXX else
- # XXX TARGET_HAVE_READLINE=1
- # XXX fi
- # XXX fi
- if {[opt-val with-linenoise] ne {}} {
- set withval [lindex [opt-val with-linenoise] end]
- set with_linenoise $withval
- } else {
- set with_linenoise "no"
- }
- # XXX if test "x$with_linenoise" != "xno"; then
- # XXX TARGET_HAVE_READLINE=0
- # XXX TARGET_HAVE_EDITLINE=0
- # XXX TARGET_HAVE_LINENOISE=1
- # XXX TARGET_READLINE_INC="-I${with_linenoise}"
- # XXX TARGET_READLINE_LIBS="${with_linenoise}/linenoise.c"
- # XXX echo "using linenoise source code at ${with_linenoise}"
- # XXX else
- # XXX TARGET_HAVE_LINENOISE=0
- # XXX echo "not using linenoise"
- # XXX fi
-
- # XXX AC_SUBST TARGET_READLINE_LIBS
- # XXX AC_SUBST TARGET_READLINE_INC
- # XXX AC_SUBST TARGET_HAVE_READLINE
- # XXX AC_SUBST TARGET_HAVE_EDITLINE
- # XXX AC_SUBST TARGET_HAVE_LINENOISE
+ user-notice "Using client-provided readline flags: $fC $fL"
+ return "readline"
}
-}; # hwaci-check-readline2
-hwaci-check-readline2
+
+ # Try the project-agnostic readline detector:
+ set v [hwaci-check-readline]
+ add-shell-opt -DHAVE_READLINE=$v
+ if {$v} { return "readline" }
+ # TODO: reimplement:
+ # --enable-editline
+ # --with-readline-lib specify readline library
+ # --with-readline-inc specify readline include paths
+ # --with-linenoise=DIR source directory for linenoise library
+ return "none"
+}; # hwaci-check-line-editing
+msg-checking "Line-editing support for the sqlite3 shell: "
+msg-result [hwaci-check-line-editing]
hwaci-if-opt-truthy load-extension {
if {[hwaci-check-function-in-lib dlopen dl]} {
}
########################################################################
-# Under construction - check for libreadline functionality. Linking
-# in readline varies wildly by platform and this check does not cover
-# all known options.
+# Check for libreadline functionality. Linking in readline varies
+# wildly by platform and this check does not cover all known options.
+# This detection is known to fail when none of the following
+# conditions can be met:
+#
+# - (pkg-config readline) info is either unavailable for libreadline or
+# simply misbehaves.
+#
+# - Compile-and-link-with-default-path tests fail. This will fail for
+# platforms which store readline under, e.g., /usr/locall
#
# Defines the following vars:
#
# $ pkg-config --print-requires readline; echo $?
# 1
#
- # i.e. there's apparently no way to find out that readline
- # requires termcap beyond parsing the error message.
+ # i.e. there's apparently no way to find out that readline requires
+ # termcap beyond parsing the error message. It turns out it doesn't
+ # want termcap, it wants -lcurses, but we don't get that info from
+ # pkg-config either.
set h "readline/readline.h"
if {[cc-check-includes $h]} {
# -I...]
}
# Numerous TODOs:
- # - Requires linking with ncurses or similar on some platforms.
+ # - Requires linking with [n]curses or similar on some platforms.
# - Headers are in a weird place on some BSD systems.
# - Add --with-readline=DIR
- # - Add --with-readline-lib=lib file
- # - Add --with-readline-inc=dir -Idir
+ # - Add --with-readline-lib=lib ==> pass lib file via LDFLAGS_READLINE
+ # - Add --with-readline-inc=dir ==> pass -Idir via CFLAGS_READLINE
msg-result "libreadline not found."
return 0
}
-C Remove\sthe\sinstall-lib\smakefile\sdep\sfrom\sinstall-tcl,\sas\sit\sbreaks\snon-root-user\sinvocations\sof\s'make\sinstall-tcl'\swhen\sthe\s--prefix\sis\sleft\sat\sits\sdefault\sand\s--with-tcl\sis\sexplicitly\sprovided.
-D 2024-10-26T19:16:18.142
+C Get\s--with-linenoise=DIR\sconfigure\sflag\sworking.
+D 2024-10-26T21:51:04.154
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md b6e6c1baf38e4339bd3f1e0e5e5bfd0a9a93d133360691b2785c2d4b2f2dcec2
F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2
F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90
F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2
-F auto.def 982231b47cf749449c2c04e85ff9583c68774000a4750db277213ccbf75c75dd
+F auto.def 0ed89d2ad8e199017e5a2e14163737b38f0c9f3351a5d94aadeae4e257b38b11
F autoconf/INSTALL 83e4a25da9fd053c7b3665eaaaf7919707915903
F autoconf/Makefile.am adedc1324b6a87fdd1265ddd336d2fb7d4f36a0e77b86ea553ae7cc4ea239347
F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac
F autosetup/cc-shared.tcl 4f024e94a47f427ba61de1739f6381ef0080210f9fae89112d5c1de1e5460d78
F autosetup/cc.tcl 7e2fe943ae9d45cf39e9f5b05b6230df8e719415edea5af06c30eb68680bde14
F autosetup/default.auto 5cdf016de2140e50f1db190a02039dc42fb390af1dda4cc4853e3042a9ef0e82
-F autosetup/hwaci-common.tcl 80482a8b22b6853546bd36616f2064534a7c1f7b8537a52a8498a0b132f2e8f4
+F autosetup/hwaci-common.tcl 656984306293035db370c8a34030253a860ef42bd168952db8be7e5f8a2f6008
F autosetup/jimsh0.c 27ea5f221359ef6c58780fc6c185aadbf8d3bee9a021331a3e5de0eba0dc6de6
F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba
F autosetup/system.tcl 3a39d6e0b3bfba526fd39afe07c1d0d325e5a31925013a1ba7c671e1128e31bb
F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x
F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8
F magic.txt 5ade0bc977aa135e79e3faaea894d5671b26107cc91e70783aa7dc83f22f3ba0
-F main.mk 857da235f57919c3469efbf89b61060f8f35352c6b97a9dce275f5a35b536007
+F main.mk 39877d7141386ccdbd6fb27968f133cdc6937c38dd8145359faff922d3a1f2e9
F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271
F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504
F mptest/crash01.test 61e61469e257df0850df4293d7d4d6c2af301421
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P b66076e51bc1601864973be0f3f2b702b51139ed3818f17433fbaa8351119ad6
-R bb71574ad1e7e09ae31e2176eab9b67d
+P e7eabfb61f72dc396fab9d0671642f8150cde23aea965c5e77ac3d9ad11c749f
+R d65825cd715a121a343a3b84bfbe0e81
U stephan
-Z f881b225d548de8ff8557460eb6c70ce
+Z 221650a38f381ac274ed56145cfdfb80
# Remove this line to create a well-formed Fossil manifest.