All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/4] Ncurses wide support
@ 2014-08-19 18:48 Gustavo Zacarias
  2014-08-19 18:48 ` [Buildroot] [PATCH 1/4] package/ncurses: Allow building wide char support Gustavo Zacarias
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Gustavo Zacarias @ 2014-08-19 18:48 UTC (permalink / raw)
  To: buildroot

This is the compiled series for ncurses wide support.
Tested a while ago with an allyespackageconfig.
Closes bug #6950

Gustavo Zacarias (3):
  package/ncurses: fixup wide support for static targets
  nano: enable ncursesw support
  httping: enable ncurses support

Jeremy Kerr (1):
  package/ncurses: Allow building wide char support

 package/httping/httping.mk |  3 ++-
 package/nano/nano.mk       |  9 +++++++--
 package/ncurses/Config.in  |  8 ++++++++
 package/ncurses/ncurses.mk | 33 +++++++++++++++++++++++++++++++--
 4 files changed, 48 insertions(+), 5 deletions(-)

-- 
1.8.5.5

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

* [Buildroot] [PATCH 1/4] package/ncurses: Allow building wide char support
  2014-08-19 18:48 [Buildroot] [PATCH 0/4] Ncurses wide support Gustavo Zacarias
@ 2014-08-19 18:48 ` Gustavo Zacarias
  2014-08-19 18:48 ` [Buildroot] [PATCH 2/4] package/ncurses: fixup wide support for static targets Gustavo Zacarias
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Gustavo Zacarias @ 2014-08-19 18:48 UTC (permalink / raw)
  To: buildroot

From: Jeremy Kerr <jk@ozlabs.org>

Allow ncurses to be configured with wide char support; this causes the
libraries to be built with the 'w' suffix (eg libncursesw.so,
libmenuw.so, etc), so we need to create a few symlinks.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Tested-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
 package/ncurses/Config.in  |  6 ++++++
 package/ncurses/ncurses.mk | 24 ++++++++++++++++++++++--
 2 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/package/ncurses/Config.in b/package/ncurses/Config.in
index e8ab710..b90ec9e 100644
--- a/package/ncurses/Config.in
+++ b/package/ncurses/Config.in
@@ -10,6 +10,12 @@ config BR2_PACKAGE_NCURSES
 
 if BR2_PACKAGE_NCURSES
 
+config BR2_PACKAGE_NCURSES_WCHAR
+	bool "enable wide char support"
+	depends on BR2_USE_WCHAR
+	help
+	  Enable wide char & UTF-8 support in ncurses libraries
+
 config BR2_PACKAGE_NCURSES_TARGET_PANEL
 	bool "ncurses libpanel in target"
 	help
diff --git a/package/ncurses/ncurses.mk b/package/ncurses/ncurses.mk
index 4bba8f1..bd2aac0 100644
--- a/package/ncurses/ncurses.mk
+++ b/package/ncurses/ncurses.mk
@@ -12,7 +12,7 @@ HOST_NCURSES_DEPENDENCIES =
 NCURSES_PROGS = clear infocmp tabs tic toe tput tset
 NCURSES_LICENSE = MIT with advertising clause
 NCURSES_LICENSE_FILES = README
-NCURSES_CONFIG_SCRIPTS = ncurses5-config
+NCURSES_CONFIG_SCRIPTS = ncurses$(NCURSES_LIB_SUFFIX)5-config
 
 NCURSES_CONF_OPT = \
 	$(if $(BR2_PREFER_STATIC_LIB),--without-shared,--with-shared) \
@@ -36,6 +36,24 @@ ifeq ($(BR2_PACKAGE_BUSYBOX),y)
 	NCURSES_DEPENDENCIES += busybox
 endif
 
+ifeq ($(BR2_PACKAGE_NCURSES_WCHAR),y)
+NCURSES_CONF_OPT += --enable-widec
+NCURSES_LIB_SUFFIX = w
+
+define NCURSES_LINK_LIBS
+	for lib in $(NCURSES_LIBS-y); do \
+		ln -sf $${lib}$(NCURSES_LIB_SUFFIX).so \
+			$(1)/usr/lib/$${lib}.so; \
+	done
+endef
+
+NCURSES_LINK_TARGET_LIBS =  $(call NCURSES_LINK_LIBS, $(TARGET_DIR))
+NCURSES_LINK_STAGING_LIBS =  $(call NCURSES_LINK_LIBS, $(STAGING_DIR))
+
+NCURSES_POST_INSTALL_STAGING_HOOKS += NCURSES_LINK_STAGING_LIBS
+
+endif
+
 NCURSES_LIBS-y = libncurses
 NCURSES_LIBS-$(BR2_PACKAGE_NCURSES_TARGET_MENU) += libmenu
 NCURSES_LIBS-$(BR2_PACKAGE_NCURSES_TARGET_PANEL) += libpanel
@@ -56,7 +74,8 @@ endef
 ifneq ($(BR2_PREFER_STATIC_LIB),y)
 define NCURSES_INSTALL_TARGET_LIBS
 	for lib in $(NCURSES_LIBS-y); do \
-		cp -dpf $(NCURSES_DIR)/lib/$${lib}.so* $(TARGET_DIR)/usr/lib/; \
+		cp -dpf $(NCURSES_DIR)/lib/$${lib}$(NCURSES_LIB_SUFFIX).so* \
+			$(TARGET_DIR)/usr/lib/; \
 	done
 endef
 endif
@@ -74,6 +93,7 @@ endif
 define NCURSES_INSTALL_TARGET_CMDS
 	mkdir -p $(TARGET_DIR)/usr/lib
 	$(NCURSES_INSTALL_TARGET_LIBS)
+	$(NCURSES_LINK_TARGET_LIBS)
 	$(NCURSES_INSTALL_TARGET_PROGS)
 	ln -snf /usr/share/terminfo $(TARGET_DIR)/usr/lib/terminfo
 	mkdir -p $(TARGET_DIR)/usr/share/terminfo/x
-- 
1.8.5.5

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

* [Buildroot] [PATCH 2/4] package/ncurses: fixup wide support for static targets
  2014-08-19 18:48 [Buildroot] [PATCH 0/4] Ncurses wide support Gustavo Zacarias
  2014-08-19 18:48 ` [Buildroot] [PATCH 1/4] package/ncurses: Allow building wide char support Gustavo Zacarias
@ 2014-08-19 18:48 ` Gustavo Zacarias
  2014-08-19 19:47   ` Thomas De Schampheleire
  2014-08-19 18:48 ` [Buildroot] [PATCH 3/4] nano: enable ncursesw support Gustavo Zacarias
  2014-08-19 18:48 ` [Buildroot] [PATCH 4/4] httping: enable ncurses support Gustavo Zacarias
  3 siblings, 1 reply; 9+ messages in thread
From: Gustavo Zacarias @ 2014-08-19 18:48 UTC (permalink / raw)
  To: buildroot

As stated on the list we need to copy static libraries when doing static
targets so add the logic for that.

Also exclude the wide option for blackfin flat since there seem to be
toolchain issues with that combination - since it's a new feature option
someone interested might look into it later.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
 package/ncurses/Config.in  | 2 ++
 package/ncurses/ncurses.mk | 9 +++++++++
 2 files changed, 11 insertions(+)

diff --git a/package/ncurses/Config.in b/package/ncurses/Config.in
index b90ec9e..3cc0a37 100644
--- a/package/ncurses/Config.in
+++ b/package/ncurses/Config.in
@@ -13,6 +13,8 @@ if BR2_PACKAGE_NCURSES
 config BR2_PACKAGE_NCURSES_WCHAR
 	bool "enable wide char support"
 	depends on BR2_USE_WCHAR
+	# Build broken @ curses.priv.h with bad declarations
+	depends on !(BR2_bfin && BR2_BINFMT_FLAT)
 	help
 	  Enable wide char & UTF-8 support in ncurses libraries
 
diff --git a/package/ncurses/ncurses.mk b/package/ncurses/ncurses.mk
index bd2aac0..5eb8b98 100644
--- a/package/ncurses/ncurses.mk
+++ b/package/ncurses/ncurses.mk
@@ -40,12 +40,21 @@ ifeq ($(BR2_PACKAGE_NCURSES_WCHAR),y)
 NCURSES_CONF_OPT += --enable-widec
 NCURSES_LIB_SUFFIX = w
 
+ifeq ($(BR2_PREFER_STATIC_LIB),y)
+define NCURSES_LINK_LIBS
+	for lib in $(NCURSES_LIBS-y); do \
+		ln -sf $${lib}$(NCURSES_LIB_SUFFIX).a \
+			$(1)/usr/lib/$${lib}.a; \
+	done
+endef
+else
 define NCURSES_LINK_LIBS
 	for lib in $(NCURSES_LIBS-y); do \
 		ln -sf $${lib}$(NCURSES_LIB_SUFFIX).so \
 			$(1)/usr/lib/$${lib}.so; \
 	done
 endef
+endif
 
 NCURSES_LINK_TARGET_LIBS =  $(call NCURSES_LINK_LIBS, $(TARGET_DIR))
 NCURSES_LINK_STAGING_LIBS =  $(call NCURSES_LINK_LIBS, $(STAGING_DIR))
-- 
1.8.5.5

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

* [Buildroot] [PATCH 3/4] nano: enable ncursesw support
  2014-08-19 18:48 [Buildroot] [PATCH 0/4] Ncurses wide support Gustavo Zacarias
  2014-08-19 18:48 ` [Buildroot] [PATCH 1/4] package/ncurses: Allow building wide char support Gustavo Zacarias
  2014-08-19 18:48 ` [Buildroot] [PATCH 2/4] package/ncurses: fixup wide support for static targets Gustavo Zacarias
@ 2014-08-19 18:48 ` Gustavo Zacarias
  2014-08-19 18:48 ` [Buildroot] [PATCH 4/4] httping: enable ncurses support Gustavo Zacarias
  3 siblings, 0 replies; 9+ messages in thread
From: Gustavo Zacarias @ 2014-08-19 18:48 UTC (permalink / raw)
  To: buildroot

Enable support for ncurses widechar by specifying the proper
ncursesw-config when it's enabled, otherwise keep the old trick in place
when it's not to avoid automatically picking up the host/distro one.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
 package/nano/nano.mk | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/package/nano/nano.mk b/package/nano/nano.mk
index 9557a93..038aaa5 100644
--- a/package/nano/nano.mk
+++ b/package/nano/nano.mk
@@ -9,11 +9,16 @@ NANO_VERSION = $(NANO_VERSION_MAJOR).6
 NANO_SITE = http://www.nano-editor.org/dist/v$(NANO_VERSION_MAJOR)
 NANO_LICENSE = GPLv3+
 NANO_LICENSE_FILES = COPYING
-NANO_MAKE_ENV = CURSES_LIB="-lncurses"
 NANO_CONF_OPT = --without-slang
-NANO_CONF_ENV = ac_cv_prog_NCURSESW_CONFIG=false
 NANO_DEPENDENCIES = ncurses
 
+ifeq ($(BR2_PACKAGE_NCURSES_WCHAR),y)
+	NANO_CONF_ENV += ac_cv_prog_NCURSESW_CONFIG="$(STAGING_DIR)/usr/bin/ncursesw5-config"
+else
+	NANO_CONF_ENV += ac_cv_prog_NCURSESW_CONFIG=false
+	NANO_MAKE_ENV += CURSES_LIB="-lncurses"
+endif
+
 ifeq ($(BR2_PACKAGE_FILE),y)
 	NANO_DEPENDENCIES += file
 else
-- 
1.8.5.5

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

* [Buildroot] [PATCH 4/4] httping: enable ncurses support
  2014-08-19 18:48 [Buildroot] [PATCH 0/4] Ncurses wide support Gustavo Zacarias
                   ` (2 preceding siblings ...)
  2014-08-19 18:48 ` [Buildroot] [PATCH 3/4] nano: enable ncursesw support Gustavo Zacarias
@ 2014-08-19 18:48 ` Gustavo Zacarias
  3 siblings, 0 replies; 9+ messages in thread
From: Gustavo Zacarias @ 2014-08-19 18:48 UTC (permalink / raw)
  To: buildroot

Enable automatic ncurses support now that we've got wide support.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
 package/httping/httping.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/package/httping/httping.mk b/package/httping/httping.mk
index ca636c0..719b0db 100644
--- a/package/httping/httping.mk
+++ b/package/httping/httping.mk
@@ -15,11 +15,12 @@ HTTPING_LDFLAGS = $(TARGET_LDFLAGS) \
 HTTPING_DEPENDENCIES = host-gettext \
 	$(if $(BR2_NEEDS_GETTEXT),gettext) \
 	$(if $(BR2_PACKAGE_LIBICONV),libiconv) \
+	$(if $(BR2_PACKAGE_NCURSES_WCHAR),ncurses) \
 	$(if $(BR2_PACKAGE_OPENSSL),openssl) \
 	$(if $(BR2_PACKAGE_FFTW),fftw)
 HTTPING_MAKE_OPT = $(TARGET_CONFIGURE_OPTS) \
 	FW=$(if $(BR2_PACKAGE_FFTW),yes,no) \
-	NC=no \
+	NC=$(if $(BR2_PACKAGE_NCURSES_WCHAR),yes,no) \
 	SSL=$(if $(BR2_PACKAGE_OPENSSL),yes,no) \
 	TFO=$(if $(BR2_PACKAGE_HTTPING_TFO),yes,no)
 
-- 
1.8.5.5

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

* [Buildroot] [PATCH 2/4] package/ncurses: fixup wide support for static targets
  2014-08-19 18:48 ` [Buildroot] [PATCH 2/4] package/ncurses: fixup wide support for static targets Gustavo Zacarias
@ 2014-08-19 19:47   ` Thomas De Schampheleire
  2014-08-20 12:22     ` Thomas Petazzoni
  0 siblings, 1 reply; 9+ messages in thread
From: Thomas De Schampheleire @ 2014-08-19 19:47 UTC (permalink / raw)
  To: buildroot

On Tue, Aug 19, 2014 at 8:48 PM, Gustavo Zacarias
<gustavo@zacarias.com.ar> wrote:
> As stated on the list we need to copy static libraries when doing static
> targets so add the logic for that.
>
> Also exclude the wide option for blackfin flat since there seem to be
> toolchain issues with that combination - since it's a new feature option
> someone interested might look into it later.
>
> Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
> ---
>  package/ncurses/Config.in  | 2 ++
>  package/ncurses/ncurses.mk | 9 +++++++++
>  2 files changed, 11 insertions(+)
>
> diff --git a/package/ncurses/Config.in b/package/ncurses/Config.in
> index b90ec9e..3cc0a37 100644
> --- a/package/ncurses/Config.in
> +++ b/package/ncurses/Config.in
> @@ -13,6 +13,8 @@ if BR2_PACKAGE_NCURSES
>  config BR2_PACKAGE_NCURSES_WCHAR
>         bool "enable wide char support"
>         depends on BR2_USE_WCHAR
> +       # Build broken @ curses.priv.h with bad declarations
> +       depends on !(BR2_bfin && BR2_BINFMT_FLAT)
>         help
>           Enable wide char & UTF-8 support in ncurses libraries
>
> diff --git a/package/ncurses/ncurses.mk b/package/ncurses/ncurses.mk
> index bd2aac0..5eb8b98 100644
> --- a/package/ncurses/ncurses.mk
> +++ b/package/ncurses/ncurses.mk
> @@ -40,12 +40,21 @@ ifeq ($(BR2_PACKAGE_NCURSES_WCHAR),y)
>  NCURSES_CONF_OPT += --enable-widec
>  NCURSES_LIB_SUFFIX = w
>
> +ifeq ($(BR2_PREFER_STATIC_LIB),y)
> +define NCURSES_LINK_LIBS
> +       for lib in $(NCURSES_LIBS-y); do \
> +               ln -sf $${lib}$(NCURSES_LIB_SUFFIX).a \
> +                       $(1)/usr/lib/$${lib}.a; \
> +       done
> +endef
> +else
>  define NCURSES_LINK_LIBS
>         for lib in $(NCURSES_LIBS-y); do \
>                 ln -sf $${lib}$(NCURSES_LIB_SUFFIX).so \
>                         $(1)/usr/lib/$${lib}.so; \
>         done
>  endef
> +endif

Here you could also do something like
ifeq ($(BR2_PREFER_STATIC_LIB),y)
NCURSES_LIB_EXT = .a
else
NCURSES_LIB_EXT = .so
endif
define NCURSES_LINK_LIBS
       for lib in $(NCURSES_LIBS-y); do \
               ln -sf $${lib}$(NCURSES_LIB_SUFFIX)$(NCURSES_LIB_EXT) \
                       $(1)/usr/lib/$${lib}$(NCURSES_LIB_EXT); \
       done
endef
to avoid duplicating the hook content.

Best regards,
Thomas

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

* [Buildroot] [PATCH 2/4] package/ncurses: fixup wide support for static targets
  2014-08-19 19:47   ` Thomas De Schampheleire
@ 2014-08-20 12:22     ` Thomas Petazzoni
  2014-08-20 12:34       ` Thomas De Schampheleire
  0 siblings, 1 reply; 9+ messages in thread
From: Thomas Petazzoni @ 2014-08-20 12:22 UTC (permalink / raw)
  To: buildroot

Dear Thomas De Schampheleire,

On Tue, 19 Aug 2014 21:47:55 +0200, Thomas De Schampheleire wrote:

> Here you could also do something like
> ifeq ($(BR2_PREFER_STATIC_LIB),y)
> NCURSES_LIB_EXT = .a
> else
> NCURSES_LIB_EXT = .so
> endif
> define NCURSES_LINK_LIBS
>        for lib in $(NCURSES_LIBS-y); do \
>                ln -sf $${lib}$(NCURSES_LIB_SUFFIX)$(NCURSES_LIB_EXT) \
>                        $(1)/usr/lib/$${lib}$(NCURSES_LIB_EXT); \
>        done
> endef
> to avoid duplicating the hook content.

Except that for now, the semantic is:

 * BR2_PREFER_STATIC_LIB=y -> install only static libraries

 * BR2_PREFER_STATIC_LIB undefined -> install *both* static and shared
   libraries.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH 2/4] package/ncurses: fixup wide support for static targets
  2014-08-20 12:22     ` Thomas Petazzoni
@ 2014-08-20 12:34       ` Thomas De Schampheleire
  2014-08-20 12:39         ` Gustavo Zacarias
  0 siblings, 1 reply; 9+ messages in thread
From: Thomas De Schampheleire @ 2014-08-20 12:34 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Wed, Aug 20, 2014 at 2:22 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Dear Thomas De Schampheleire,
>
> On Tue, 19 Aug 2014 21:47:55 +0200, Thomas De Schampheleire wrote:
>
>> Here you could also do something like
>> ifeq ($(BR2_PREFER_STATIC_LIB),y)
>> NCURSES_LIB_EXT = .a
>> else
>> NCURSES_LIB_EXT = .so
>> endif
>> define NCURSES_LINK_LIBS
>>        for lib in $(NCURSES_LIBS-y); do \
>>                ln -sf $${lib}$(NCURSES_LIB_SUFFIX)$(NCURSES_LIB_EXT) \
>>                        $(1)/usr/lib/$${lib}$(NCURSES_LIB_EXT); \
>>        done
>> endef
>> to avoid duplicating the hook content.
>
> Except that for now, the semantic is:
>
>  * BR2_PREFER_STATIC_LIB=y -> install only static libraries
>
>  * BR2_PREFER_STATIC_LIB undefined -> install *both* static and shared
>    libraries.

Unless I'm missing something that is not what Gustavo's patch does. He
explicitly added an else clause. So if STATIC_LIB is not defined, only
links for the .so file will be created.

Best regards,
Thomas

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

* [Buildroot] [PATCH 2/4] package/ncurses: fixup wide support for static targets
  2014-08-20 12:34       ` Thomas De Schampheleire
@ 2014-08-20 12:39         ` Gustavo Zacarias
  0 siblings, 0 replies; 9+ messages in thread
From: Gustavo Zacarias @ 2014-08-20 12:39 UTC (permalink / raw)
  To: buildroot

On 08/20/2014 09:34 AM, Thomas De Schampheleire wrote:
>> Except that for now, the semantic is:
>>
>>  * BR2_PREFER_STATIC_LIB=y -> install only static libraries
>>
>>  * BR2_PREFER_STATIC_LIB undefined -> install *both* static and shared
>>    libraries.
> 
> Unless I'm missing something that is not what Gustavo's patch does. He
> explicitly added an else clause. So if STATIC_LIB is not defined, only
> links for the .so file will be created.

Hi, true, i'll respin a new fix to get both done when !static.
The spirit was to fix the static case omission, even though it works for
dynamic it departs from what it should do.
Regards.

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

end of thread, other threads:[~2014-08-20 12:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-19 18:48 [Buildroot] [PATCH 0/4] Ncurses wide support Gustavo Zacarias
2014-08-19 18:48 ` [Buildroot] [PATCH 1/4] package/ncurses: Allow building wide char support Gustavo Zacarias
2014-08-19 18:48 ` [Buildroot] [PATCH 2/4] package/ncurses: fixup wide support for static targets Gustavo Zacarias
2014-08-19 19:47   ` Thomas De Schampheleire
2014-08-20 12:22     ` Thomas Petazzoni
2014-08-20 12:34       ` Thomas De Schampheleire
2014-08-20 12:39         ` Gustavo Zacarias
2014-08-19 18:48 ` [Buildroot] [PATCH 3/4] nano: enable ncursesw support Gustavo Zacarias
2014-08-19 18:48 ` [Buildroot] [PATCH 4/4] httping: enable ncurses support Gustavo Zacarias

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.