All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/sqlite: fix configure options for readline/editline support
@ 2025-02-14  2:14 Scott Fan
  2025-02-14  7:42 ` [Buildroot] [PATCH v2] " Scott Fan
  0 siblings, 1 reply; 6+ messages in thread
From: Scott Fan @ 2025-02-14  2:14 UTC (permalink / raw)
  To: buildroot; +Cc: Scott Fan, Bernd Kuhls

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 --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
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v2] package/sqlite: fix configure options for readline/editline support
  2025-02-14  2:14 [Buildroot] [PATCH] package/sqlite: fix configure options for readline/editline support Scott Fan
@ 2025-02-14  7:42 ` Scott Fan
  2025-02-14  8:08   ` Waldemar Brodkorb
  2025-02-14  9:32   ` Waldemar Brodkorb
  0 siblings, 2 replies; 6+ messages in thread
From: Scott Fan @ 2025-02-14  7:42 UTC (permalink / raw)
  To: buildroot; +Cc: Bernd Kuhls, Scott Fan

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.

Signed-off-by: Scott Fan <fancp2007@gmail.com>

---
Changes v1 -> v2:
  - use the CFLAGS and LDFLAGS values instead of autosetup configure options
  - update commit message
---
 package/sqlite/sqlite.mk | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/package/sqlite/sqlite.mk b/package/sqlite/sqlite.mk
index 5a8b033ce0..255ddc937b 100644
--- a/package/sqlite/sqlite.mk
+++ b/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 \
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Buildroot] [PATCH v2] package/sqlite: fix configure options for readline/editline support
  2025-02-14  7:42 ` [Buildroot] [PATCH v2] " Scott Fan
@ 2025-02-14  8:08   ` Waldemar Brodkorb
  2025-02-14  9:32   ` Waldemar Brodkorb
  1 sibling, 0 replies; 6+ messages in thread
From: Waldemar Brodkorb @ 2025-02-14  8:08 UTC (permalink / raw)
  To: Scott Fan; +Cc: Bernd Kuhls, buildroot

Hi Scott,
Scott Fan wrote,

> 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.

Somehow it does not apply cleanly with git am:
Applying: package/sqlite: fix configure options for
readline/editline support
error: patch failed: package/sqlite/sqlite.mk:44
error: package/sqlite/sqlite.mk: patch does not apply
Patch failed at 0001 package/sqlite: fix configure options for
readline/editline support

Any idea?

best regards
 Waldemar
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Buildroot] [PATCH v2] package/sqlite: fix configure options for readline/editline support
  2025-02-14  7:42 ` [Buildroot] [PATCH v2] " Scott Fan
  2025-02-14  8:08   ` Waldemar Brodkorb
@ 2025-02-14  9:32   ` Waldemar Brodkorb
  2025-02-15  2:51     ` Scott Fan
  1 sibling, 1 reply; 6+ messages in thread
From: Waldemar Brodkorb @ 2025-02-14  9:32 UTC (permalink / raw)
  To: Scott Fan; +Cc: Bernd Kuhls, buildroot

Hi,

sorry I forgot to drop v1 of the patch.

Works now. You can add a 
Tested-by: Waldemar Brodkorb <wbx@openadk.org>

best regards
 Waldemar

Scott Fan wrote,

> 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.
> 
> Signed-off-by: Scott Fan <fancp2007@gmail.com>
> 
> ---
> Changes v1 -> v2:
>   - use the CFLAGS and LDFLAGS values instead of autosetup configure options
>   - update commit message
> ---
>  package/sqlite/sqlite.mk | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/package/sqlite/sqlite.mk b/package/sqlite/sqlite.mk
> index 5a8b033ce0..255ddc937b 100644
> --- a/package/sqlite/sqlite.mk
> +++ b/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 \
> -- 
> 2.43.0
> 
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Buildroot] [PATCH v2] package/sqlite: fix configure options for readline/editline support
  2025-02-14  9:32   ` Waldemar Brodkorb
@ 2025-02-15  2:51     ` Scott Fan
  2025-02-17  2:47       ` Scott Fan
  0 siblings, 1 reply; 6+ messages in thread
From: Scott Fan @ 2025-02-15  2:51 UTC (permalink / raw)
  To: Julien Olivain, Bernd Kuhls, Peter Korsgaard; +Cc: buildroot

Hi Julien,

On Fri, Feb 14, 2025 at 5:32 PM Waldemar Brodkorb <wbx@openadk.org> wrote:
>
> Works now. You can add a
> Tested-by: Waldemar Brodkorb <wbx@openadk.org>

Please consider it, thanks.

Scott Fan
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Buildroot] [PATCH v2] package/sqlite: fix configure options for readline/editline support
  2025-02-15  2:51     ` Scott Fan
@ 2025-02-17  2:47       ` Scott Fan
  0 siblings, 0 replies; 6+ messages in thread
From: Scott Fan @ 2025-02-17  2:47 UTC (permalink / raw)
  To: Julien Olivain, Bernd Kuhls, Peter Korsgaard; +Cc: buildroot

Hi all,

The patch has been superseded by another re-sent patch, and I added a
line "Tested-by" to the commit message.

Please see the link below:
https://patchwork.ozlabs.org/project/buildroot/patch/20250217023835.349770-1-fancp2007@gmail.com/

Scott Fan

On Sat, Feb 15, 2025 at 10:51 AM Scott Fan <fancp2007@gmail.com> wrote:
>
> Hi Julien,
>
> On Fri, Feb 14, 2025 at 5:32 PM Waldemar Brodkorb <wbx@openadk.org> wrote:
> >
> > Works now. You can add a
> > Tested-by: Waldemar Brodkorb <wbx@openadk.org>
>
> Please consider it, thanks.
>
> Scott Fan
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-02-17  2:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-14  2:14 [Buildroot] [PATCH] package/sqlite: fix configure options for readline/editline support Scott Fan
2025-02-14  7:42 ` [Buildroot] [PATCH v2] " Scott Fan
2025-02-14  8:08   ` Waldemar Brodkorb
2025-02-14  9:32   ` Waldemar Brodkorb
2025-02-15  2:51     ` Scott Fan
2025-02-17  2:47       ` Scott Fan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.