From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [RFC, PATCH 3/8] package/ncurses: Allow building wide char support
Date: Thu, 30 Jan 2014 20:44:03 +0100 [thread overview]
Message-ID: <20140130204403.5935a48b@skate> (raw)
In-Reply-To: <1389862338.918565.412332853863.3.gpush@pablo>
Dear Jeremy Kerr,
On Thu, 16 Jan 2014 16:52:18 +0800, Jeremy Kerr wrote:
> if BR2_PACKAGE_NCURSES
> +config BR2_PACKAGE_NCURSES_WIDEC
One empty line between the if line and the config line.
> + bool "enable wide char support"
> + depends on BR2_PACKAGE_NCURSES
dependency not needed since you're inside a if BR2_PACKAGE_NCURSES.
I believe this option most likely depends on BR2_USE_WCHAR.
Also, maybe name the option BR2_PACKAGE_NCURSES_WCHAR, to match the
BR2_USE_WCHAR name we're already using in Buildroot to talk about wide
char support.
> + help
> + Enable wide char & UTF-8 support in ncurses libraries
>
> config BR2_PACKAGE_NCURSES_TARGET_PANEL
> bool "ncurses libpanel in target"
> diff --git a/package/ncurses/ncurses.mk b/package/ncurses/ncurses.mk
> index f3319763..ba4cacd1 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$(W)5-config
>
> NCURSES_CONF_OPT = \
> $(if $(BR2_PREFER_STATIC_LIB),--without-shared,--with-shared) \
> @@ -36,6 +36,15 @@ ifeq ($(BR2_PACKAGE_BUSYBOX),y)
> NCURSES_DEPENDENCIES += busybox
> endif
>
> +ifeq ($(BR2_PACKAGE_NCURSES_WIDEC),y)
> +NCURSES_CONF_OPT += --enable-widec
> +W=w
> +W_LINK=ln -sf
> +else
> +W=
> +W_LINK=:
> +endif
We really don't want to have variables named W and W_LINK. The variable
namespace in Buildroot is global. So if one package defines W, and
another package uses it, we screwed. So all variables should be
prefixed by the name of the package.
> +
> ifneq ($(BR2_ENABLE_DEBUG),y)
> NCURSES_CONF_OPT += --without-debug
> endif
> @@ -48,19 +57,22 @@ ifneq ($(BR2_PREFER_STATIC_LIB),y)
>
> ifeq ($(BR2_PACKAGE_NCURSES_TARGET_PANEL),y)
> define NCURSES_INSTALL_TARGET_PANEL
> - cp -dpf $(NCURSES_DIR)/lib/libpanel.so* $(TARGET_DIR)/usr/lib/
> + cp -dpf $(NCURSES_DIR)/lib/libpanel$(W).so* $(TARGET_DIR)/usr/lib/
> + $(W_LINK) libpanelw.so $(TARGET_DIR)/usr/lib/libpanel.so
> endef
> endif
>
> ifeq ($(BR2_PACKAGE_NCURSES_TARGET_FORM),y)
> define NCURSES_INSTALL_TARGET_FORM
> - cp -dpf $(NCURSES_DIR)/lib/libform.so* $(TARGET_DIR)/usr/lib/
> + cp -dpf $(NCURSES_DIR)/lib/libform$(W).so* $(TARGET_DIR)/usr/lib/
> + $(W_LINK) libformw.so $(TARGET_DIR)/usr/lib/libform.so
> endef
> endif
>
> ifeq ($(BR2_PACKAGE_NCURSES_TARGET_MENU),y)
> define NCURSES_INSTALL_TARGET_MENU
> - cp -dpf $(NCURSES_DIR)/lib/libmenu.so* $(TARGET_DIR)/usr/lib/
> + cp -dpf $(NCURSES_DIR)/lib/libmenu$(W).so* $(TARGET_DIR)/usr/lib/
> + $(W_LINK) libmenuw.so $(TARGET_DIR)/usr/lib/libmenu.so
> endef
> endif
>
> @@ -78,7 +90,8 @@ endif
>
> define NCURSES_INSTALL_TARGET_CMDS
> mkdir -p $(TARGET_DIR)/usr/lib
> - $(if $(BR2_PREFER_STATIC_LIB),,cp -dpf $(NCURSES_DIR)/lib/libncurses.so* $(TARGET_DIR)/usr/lib/)
> + $(if $(BR2_PREFER_STATIC_LIB),,cp -dpf $(NCURSES_DIR)/lib/libncurses$(W).so* $(TARGET_DIR)/usr/lib/)
> + $(W_LINK) libncursesw.so $(TARGET_DIR)/usr/lib/libncurses.so
> $(NCURSES_INSTALL_TARGET_PANEL)
> $(NCURSES_INSTALL_TARGET_FORM)
> $(NCURSES_INSTALL_TARGET_MENU)
> @@ -101,6 +114,33 @@ define NCURSES_INSTALL_TARGET_CMDS
> cp -dpf $(STAGING_DIR)/usr/share/terminfo/s/screen $(TARGET_DIR)/usr/share/terminfo/s
> endef # NCURSES_INSTALL_TARGET_CMDS
>
> +define NCURSES_POST_INSTALL_SYMLINK
> + $(W_LINK) libncursesw.so $(STAGING_DIR)/usr/lib/libncurses.so
> +endef
> +NCURSES_POST_INSTALL_STAGING_HOOKS += NCURSES_POST_INSTALL_SYMLINK
> +
> +ifeq ($(BR2_PACKAGE_NCURSES_TARGET_PANEL),y)
> +define NCURSES_POST_INSTALL_SYMLINK_PANEL
> + $(W_LINK) libpanelw.so $(STAGING_DIR)/usr/lib/libpanel.so
> +endef
> +NCURSES_POST_INSTALL_STAGING_HOOKS += NCURSES_POST_INSTALL_SYMLINK_PANEL
> +endif
> +
> +ifeq ($(BR2_PACKAGE_NCURSES_TARGET_FORM),y)
> +define NCURSES_POST_INSTALL_SYMLINK_FORM
> + $(W_LINK) libformw.so $(STAGING_DIR)/usr/lib/libform.so
> +endef
> +NCURSES_POST_INSTALL_STAGING_HOOKS += NCURSES_POST_INSTALL_SYMLINK_FORM
> +endif
> +
> +ifeq ($(BR2_PACKAGE_NCURSES_TARGET_MENU),y)
> +define NCURSES_POST_INSTALL_SYMLINK_MENU
> + $(W_LINK) libmenuw.so $(STAGING_DIR)/usr/lib/libmenu.so
> +endef
> +NCURSES_POST_INSTALL_STAGING_HOOKS += NCURSES_POST_INSTALL_SYMLINK_MENU
> +endif
Pffiou, that's a lot of things. Maybe we could refactor this a little
with the target installation to do something a bit smarter like:
NCURSES_LIBS-y += libncurses
NCURSES_LIBS-$(BR2_PACKAGE_NCURSES_TARGET_MENU) += libmenu
NCURSES_LIBS-$(BR2_PACKAGE_NCURSES_TARGET_PANEL) += libpanel
NCURSES_LIBS-$(BR2_PACKAGE_NCURSES_TARGET_FORM) += libform
and then use $(NCURSES_LIBS-y) and some loops in target installation
and in a staging post installation hook to create the appropriate
symbolic links.
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
next prev parent reply other threads:[~2014-01-30 19:44 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-16 8:52 [Buildroot] [RFC, PATCH 0/8] Enable a buildroot-based petitboot bootloader Jeremy Kerr
2014-01-16 8:52 ` [Buildroot] [RFC, PATCH 7/8] package/iprutils: Add IBM Power RAID utilities Jeremy Kerr
2014-01-16 13:24 ` Jerzy Grzegorek
2014-01-17 1:58 ` Jeremy Kerr
2014-01-30 20:54 ` Thomas Petazzoni
2014-01-16 8:52 ` [Buildroot] [RFC, PATCH 1/8] package/busybox: Add facility for DHCP hooks Jeremy Kerr
2014-03-04 20:01 ` Yann E. MORIN
2014-01-16 8:52 ` [Buildroot] [RFC, PATCH 4/8] package/powerpc-utils: Add powerpc hardware utilities Jeremy Kerr
2014-01-16 9:30 ` Baruch Siach
2014-01-16 13:11 ` Jerzy Grzegorek
2014-01-29 8:12 ` Thomas Petazzoni
2014-01-30 1:51 ` Jeremy Kerr
2014-01-16 8:52 ` [Buildroot] [RFC, PATCH 2/8] package/dropbear: Add separate configuration options for client and server Jeremy Kerr
2014-03-03 23:46 ` Yann E. MORIN
2014-03-03 23:54 ` Jeremy Kerr
2014-03-04 0:14 ` Gustavo Zacarias
2014-03-04 1:07 ` Jeremy Kerr
2014-03-04 1:44 ` Gustavo Zacarias
2014-03-04 1:51 ` Jeremy Kerr
2014-03-04 18:36 ` Yann E. MORIN
2014-01-16 8:52 ` [Buildroot] [RFC,PATCH 8/8] Add powerpc petitboot defconfig Jeremy Kerr
2014-01-16 8:52 ` [Buildroot] [RFC, PATCH 5/8] package/kexec-lite: Add a package for the kexec-lite tools Jeremy Kerr
2014-01-16 9:36 ` Baruch Siach
2014-01-17 1:51 ` Jeremy Kerr
2014-01-16 13:17 ` Jerzy Grzegorek
2014-01-30 19:46 ` Thomas Petazzoni
2014-02-03 5:37 ` Jeremy Kerr
2014-02-03 7:04 ` Thomas Petazzoni
2014-02-28 7:11 ` Jeremy Kerr
2014-02-28 7:37 ` Thomas Petazzoni
2014-01-30 19:47 ` Thomas Petazzoni
2014-01-16 8:52 ` [Buildroot] [RFC, PATCH 6/8] package/petitboot: Add petitboot, the userspace bootloader Jeremy Kerr
2014-01-30 20:51 ` Thomas Petazzoni
2014-02-28 5:39 ` Jeremy Kerr
2014-01-16 8:52 ` [Buildroot] [RFC, PATCH 3/8] package/ncurses: Allow building wide char support Jeremy Kerr
2014-01-30 19:44 ` Thomas Petazzoni [this message]
2014-02-28 2:53 ` Jeremy Kerr
2014-01-17 2:16 ` [Buildroot] [RFC, PATCH 0/8] Enable a buildroot-based petitboot bootloader Jeremy Kerr
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140130204403.5935a48b@skate \
--to=thomas.petazzoni@free-electrons.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.