From 004db1f5f3adaab7264b84e0896f9761cd9a2657 Mon Sep 17 00:00:00 2001 From: Scott Fan Date: Mon, 17 Feb 2025 10:38:31 +0800 Subject: [PATCH] package/sqlite: fix configure options for readline/editline support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The autosetup script will skip checking for readline.h when cross-compiling, which will cause line-editing support for the sqlite3 shell to always be "none". In this case, if the --editline option is provided, an error will be reported: ERROR: Explicit --editline failed to find a matching library. However, we can enable readline or editline support by specifying the CFLAGS and LDFLAGS values ​​instead of having it handled automatically by the autosetup configure script. In addition, the libedit package actually depends on the ncurses package, just like the readline package. So when using the libedit package, also add the ncurses dependency. Tested-by: Waldemar Brodkorb Signed-off-by: Scott Fan Signed-off-by: Julien Olivain --- package/sqlite/sqlite.mk | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/package/sqlite/sqlite.mk b/package/sqlite/sqlite.mk index 5a8b033ce0..255ddc937b 100644 --- a/package/sqlite/sqlite.mk +++ b/package/sqlite/sqlite.mk @@ -44,9 +44,12 @@ endif ifeq ($(BR2_PACKAGE_NCURSES)$(BR2_PACKAGE_READLINE),yy) SQLITE_DEPENDENCIES += ncurses readline -else ifeq ($(BR2_PACKAGE_LIBEDIT),y) -SQLITE_DEPENDENCIES += libedit -SQLITE_CONF_OPTS += --disable-readline --editline +SQLITE_CFLAGS += -DHAVE_READLINE=1 +SQLITE_LDFLAGS += -lreadline -lncurses +else ifeq ($(BR2_PACKAGE_NCURSES)$(BR2_PACKAGE_LIBEDIT),yy) +SQLITE_DEPENDENCIES += ncurses libedit +SQLITE_CFLAGS += -DHAVE_EDITLINE=1 +SQLITE_LDFLAGS += -ledit -lncurses else SQLITE_CONF_OPTS += --disable-readline endif @@ -59,7 +62,7 @@ ifeq ($(BR2_PACKAGE_SQLITE_ENABLE_JSON1),) SQLITE_CONF_OPTS += --disable-json endif -SQLITE_CONF_ENV = CFLAGS="$(SQLITE_CFLAGS)" +SQLITE_CONF_ENV = CFLAGS="$(SQLITE_CFLAGS)" LDFLAGS="$(SQLITE_LDFLAGS)" define SQLITE_CONFIGURE_CMDS (cd $(@D); $(TARGET_CONFIGURE_OPTS) $(SQLITE_CONF_ENV) ./configure \