summaryrefslogtreecommitdiff
path: root/libs/sqlite3
diff options
context:
space:
mode:
authorSebastian Kemper <sebastian_ml@gmx.net>2018-12-27 11:11:20 +0100
committerSebastian Kemper <sebastian_ml@gmx.net>2018-12-27 11:11:22 +0100
commit4e30b3b62adb6de6fda96f9c276bcc9ac8002acc (patch)
treeddffe7a595ee2a4ddc7308047e18e96fe8d0a161 /libs/sqlite3
parent0b6d2678c14aec4c1498b9ca756a2317e4919118 (diff)
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>
Diffstat (limited to 'libs/sqlite3')
-rw-r--r--libs/sqlite3/Config-cli.in24
-rw-r--r--libs/sqlite3/Makefile21
2 files changed, 43 insertions, 2 deletions
diff --git a/libs/sqlite3/Config-cli.in b/libs/sqlite3/Config-cli.in
new file mode 100644
index 000000000..752db6e81
--- /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 d1a558717..21cd04f4a 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/