Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] ncurses: generate libtermcap
@ 2015-05-20  9:11 Pascal Mazon
  0 siblings, 0 replies; 8+ messages in thread
From: Pascal Mazon @ 2015-05-20  9:11 UTC (permalink / raw)
  To: buildroot

Hello,

I haven't had a feedback to my last answer on the subject of libtermcap 
within the ncurses package, therefore I'd like to address the issue again.

Indeed, I would prefer to have a solution upstream, rather than keeping 
a local patch.

Thank you,

Date: Mon, 27 Apr 2015 10:11:07 +0200
From: Pascal Mazon <pascal.mazon@6wind.com>
To: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: buildroot at buildroot.org
Subject: Re: [Buildroot] [PATCH 1/1] ncurses: generate libtermcap
Message-ID: <553DEF1B.3070807@6wind.com>
Content-Type: text/plain; charset=windows-1252; format=flowed

On 04/24/2015 04:18 PM, Thomas Petazzoni wrote:
  > Dear Pascal Mazon,
  >
  > On Fri, 24 Apr 2015 14:54:26 +0200, Pascal Mazon wrote:
  >> There is no libtermcap package in buildroot, but ncurses implements
termcap
  >> natively. Furthermore, ncurses already provides the termcap.h header
file.
  >>
  >> With this patch, we fix an issue encountered with some external
toolchains
  >> that include a libtermcap.a (typically the GNU libtermcap version)
in their
  >> sysroot folder.
  >
  > Which external toolchains are in this situation?

I encountered this with a Cavium OCTEON toolchain.

  >
  >> Bash, for instance, would be linking with this libtermcap while using
  >> headers from ncurses.
  >>
  >> In order to be consistent, let's make sure there is only the ncurses'
  >> termcap library. To that effect, we:
  >> - remove any libtermcap.* in the staging dir,
  >
  > I think this should probably not be done by the ncurses package, but as
  > a post-install hook of the external toolchain.

But in that case, would it still be possible not to delete libtermcap.a
if ncurses is not selected (to still be able to link against it)?

I put this patch in the ncurses package, as the issue arises only when
it is enabled, and it is intimately associated with ncurses selection.
I've been thinking that as ncurses provides libtermcap and it is the
implementation of choice, it ought to be done there.

I've looked on Debian, the termcap.h and libtermcap.so are provided in
the libncurses-dev package itself, too.

  >
  > Thomas
  >

-- Pascal Mazon www.6wind.com

-- 
Pascal Mazon
www.6wind.com

^ permalink raw reply	[flat|nested] 8+ messages in thread
* [Buildroot] [PATCH 1/1] ncurses: generate libtermcap
@ 2015-04-24 12:54 Pascal Mazon
  2015-04-24 14:18 ` Thomas Petazzoni
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Pascal Mazon @ 2015-04-24 12:54 UTC (permalink / raw)
  To: buildroot

There is no libtermcap package in buildroot, but ncurses implements termcap
natively. Furthermore, ncurses already provides the termcap.h header file.

With this patch, we fix an issue encountered with some external toolchains
that include a libtermcap.a (typically the GNU libtermcap version) in their
sysroot folder.
Bash, for instance, would be linking with this libtermcap while using
headers from ncurses.

In order to be consistent, let's make sure there is only the ncurses'
termcap library. To that effect, we:
- remove any libtermcap.* in the staging dir,
- install a link to libncurses static and/or shared in staging and target
  dirs.

Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
---
 package/ncurses/ncurses.mk | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/package/ncurses/ncurses.mk b/package/ncurses/ncurses.mk
index 8368c690b606..f4b03ed5db15 100644
--- a/package/ncurses/ncurses.mk
+++ b/package/ncurses/ncurses.mk
@@ -112,6 +112,20 @@ ifneq ($(BR2_ENABLE_DEBUG),y)
 NCURSES_CONF_OPTS += --without-debug
 endif
 
+define NCURSES_LINK_LIBTERMCAP
+	ln -sf libncurses$(NCURSES_LIB_SUFFIX).$(2) $(1)/usr/lib/libtermcap.$(2)
+endef
+
+NCURSES_LINK_STAGING_TERMCAP = \
+	rm -f $(STAGING_DIR)/usr/lib/libtermcap.*; \
+	$(if $(BR2_STATIC_LIBS)$(BR2_SHARED_STATIC_LIBS),$(call NCURSES_LINK_LIBTERMCAP,$(STAGING_DIR),a);) \
+	$(if $(BR2_SHARED_LIBS)$(BR2_SHARED_STATIC_LIBS),$(call NCURSES_LINK_LIBTERMCAP,$(STAGING_DIR),so))
+NCURSES_LINK_TARGET_TERMCAP = \
+	$(if $(BR2_STATIC_LIBS)$(BR2_SHARED_STATIC_LIBS),$(call NCURSES_LINK_LIBTERMCAP,$(TARGET_DIR),a);) \
+	$(if $(BR2_SHARED_LIBS)$(BR2_SHARED_STATIC_LIBS),$(call NCURSES_LINK_LIBTERMCAP,$(TARGET_DIR),so))
+
+NCURSES_POST_INSTALL_STAGING_HOOKS += NCURSES_LINK_STAGING_TERMCAP
+
 # ncurses breaks with parallel build, but takes quite a while to
 # build single threaded. Work around it similar to how Gentoo does
 define NCURSES_BUILD_CMDS
@@ -143,6 +157,7 @@ define NCURSES_INSTALL_TARGET_CMDS
 	mkdir -p $(TARGET_DIR)/usr/lib
 	$(NCURSES_INSTALL_TARGET_LIBS)
 	$(NCURSES_LINK_TARGET_LIBS)
+	$(NCURSES_LINK_TARGET_TERMCAP)
 	$(NCURSES_INSTALL_TARGET_PROGS)
 	ln -snf /usr/share/terminfo $(TARGET_DIR)/usr/lib/terminfo
 	mkdir -p $(TARGET_DIR)/usr/share/terminfo/x
-- 
2.3.0.rc0

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

end of thread, other threads:[~2015-12-05 17:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-20  9:11 [Buildroot] [PATCH 1/1] ncurses: generate libtermcap Pascal Mazon
  -- strict thread matches above, loose matches on Subject: below --
2015-04-24 12:54 Pascal Mazon
2015-04-24 14:18 ` Thomas Petazzoni
2015-04-27  8:11   ` Pascal Mazon
2015-07-19  9:19 ` Thomas Petazzoni
2015-11-30 22:30 ` Thomas Petazzoni
2015-12-02 10:39   ` Pascal Mazon
2015-12-05 17:39     ` Yann E. MORIN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox