sqlite3: make cli-editing support selectable

sqlite3 can use libedit, readline or disable command-line editing
support altogether. This commit adds a choice to menuselect.

The default is changed from readline to libedit, as the latter is
upstream's first choice and is also a bit smaller than readline.

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
This commit is contained in:
Sebastian Kemper 2018-12-27 11:11:20 +01:00
parent 0b6d2678c1
commit 4e30b3b62a
2 changed files with 43 additions and 2 deletions

View File

@ -0,0 +1,24 @@
menu "Configuration"
depends on PACKAGE_sqlite3-cli
choice
prompt "Select command-line editing support"
default SQLITE3_LIBEDIT
config SQLITE3_LIBEDIT
bool "libedit"
help
Link against libedit. This is the default.
config SQLITE3_READLINE
bool "readline"
help
Link against GNU readline.
config SQLITE3_READLINE_NONE
bool "none"
help
Disable command-line editing support.
endchoice
endmenu

View File

@ -30,6 +30,8 @@ PKG_CONFIG_DEPENDS := \
CONFIG_SQLITE3_FTS4 \
CONFIG_SQLITE3_FTS5 \
CONFIG_SQLITE3_JSON1 \
CONFIG_SQLITE3_LIBEDIT \
CONFIG_SQLITE3_READLINE \
CONFIG_SQLITE3_RTREE \
CONFIG_SQLITE3_SESSION \
CONFIG_SQLITE3_THREADSAFE
@ -70,7 +72,11 @@ define Package/sqlite3-cli
$(call Package/sqlite3/Default)
SECTION:=utils
CATEGORY:=Utilities
DEPENDS:=+libsqlite3 +libncurses +libreadline
DEPENDS := \
+libsqlite3 \
+SQLITE3_LIBEDIT:libedit \
+SQLITE3_READLINE:libreadline \
+SQLITE3_READLINE:libncursesw
TITLE+= (cli)
endef
@ -81,6 +87,10 @@ $(call Package/sqlite3/Default/description)
formats.
endef
define Package/sqlite3-cli/config
source "$(SOURCE)/Config-cli.in"
endef
TARGET_CFLAGS += \
-DHAVE_ISNAN=1 \
-DHAVE_MALLOC_USABLE_SIZE=1 \
@ -89,7 +99,6 @@ TARGET_CFLAGS += \
CONFIGURE_ARGS += \
--enable-shared \
--enable-static \
--disable-editline \
--disable-static-shell \
$(if $(CONFIG_SQLITE3_DYNAMIC_EXTENSIONS),--enable-dynamic-extensions,--disable-dynamic-extensions) \
$(if $(CONFIG_SQLITE3_FTS3),--enable-fts3,--disable-fts3) \
@ -100,6 +109,14 @@ CONFIGURE_ARGS += \
$(if $(CONFIG_SQLITE3_SESSION),--enable-session,--disable-session) \
$(if $(CONFIG_SQLITE3_THREADSAFE),--enable-threadsafe,--disable-threadsafe)
ifeq ($(CONFIG_SQLITE3_LIBEDIT),y)
CONFIGURE_ARGS+=--disable-readline
else ifeq ($(CONFIG_SQLITE3_READLINE),y)
CONFIGURE_ARGS+=--disable-editline
else
CONFIGURE_ARGS+=--disable-editline --disable-readline
endif
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/sqlite3{,ext}.h $(1)/usr/include/