Przeglądaj źródła

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>
Scott Fan 5 miesięcy temu
rodzic
commit
004db1f5f3
1 zmienionych plików z 7 dodań i 4 usunięć
  1. 7 4
      package/sqlite/sqlite.mk

+ 7 - 4
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 \