From 4e30b3b62adb6de6fda96f9c276bcc9ac8002acc Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Thu, 27 Dec 2018 11:11:20 +0100 Subject: [PATCH] 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 --- libs/sqlite3/Config-cli.in | 24 ++++++++++++++++++++++++ libs/sqlite3/Makefile | 21 +++++++++++++++++++-- 2 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 libs/sqlite3/Config-cli.in diff --git a/libs/sqlite3/Config-cli.in b/libs/sqlite3/Config-cli.in new file mode 100644 index 0000000000..752db6e817 --- /dev/null +++ b/libs/sqlite3/Config-cli.in @@ -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 diff --git a/libs/sqlite3/Makefile b/libs/sqlite3/Makefile index d1a558717d..21cd04f4a6 100644 --- a/libs/sqlite3/Makefile +++ b/libs/sqlite3/Makefile @@ -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/ -- 2.30.2