diff mbox series

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

Message ID 20250214021416.392363-1-fancp2007@gmail.com
State Superseded
Headers show
Series package/sqlite: fix configure options for readline/editline support | expand

Commit Message

Scott Fan Feb. 14, 2025, 2:14 a.m. UTC
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.

We can use the --with-readline-cflags option to tell autosetup where to
search for the readline.h file to avoid the disabled behavior.

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.

In addition, there is no need to pass the --disable-readline option when
the --editline option is passed.

Signed-off-by: Scott Fan <fancp2007@gmail.com>
---
 package/sqlite/sqlite.mk | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/package/sqlite/sqlite.mk b/package/sqlite/sqlite.mk
index 5a8b033ce0..d3b69f2a93 100644
--- a/package/sqlite/sqlite.mk
+++ b/package/sqlite/sqlite.mk
@@ -44,9 +44,11 @@  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_CONF_OPTS += --with-readline-cflags=-I$(STAGING_DIR)/usr/include
+else ifeq ($(BR2_PACKAGE_NCURSES)$(BR2_PACKAGE_LIBEDIT),yy)
+SQLITE_DEPENDENCIES += ncurses libedit
+SQLITE_CONF_OPTS += --with-readline-cflags=-I$(STAGING_DIR)/usr/include
+SQLITE_CONF_OPTS += --editline
 else
 SQLITE_CONF_OPTS += --disable-readline
 endif