package/sqlite: fix configure options for readline/editline support

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 <wbx@openadk.org>
Signed-off-by: Scott Fan <fancp2007@gmail.com>
Signed-off-by: Julien Olivain <ju.o@free.fr>
This commit is contained in:
Scott Fan
2025-02-17 10:38:31 +08:00
committed by Julien Olivain
parent ef3d171e50
commit 004db1f5f3

View File

@@ -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 \