Modify

Opened 5 years ago

Closed 5 years ago

Last modified 2 years ago

#9442 closed defect (fixed)

ncurses: enable cxx bindings

Reported by: anonymous Owned by: developers
Priority: normal Milestone: Barrier Breaker 14.07
Component: packages Version: Trunk
Keywords: Cc:

Description

cxx bindings need to be enabled in order to allow compilation of c++ programs using ncurses.

The patch is trivial and attached.

Attachments (4)

ncurses-cxx.patch (362 bytes) - added by anonymous 5 years ago.
ncurses-cxxw.patch (1.1 KB) - added by anonymous 5 years ago.
ncurses-cxxw.2.patch (1.2 KB) - added by anonymous 5 years ago.
updated patch
ncurses-cxxw.3.patch (813 bytes) - added by anonymous 5 years ago.
the final patch

Download all attachments as: .zip

Change History (10)

Changed 5 years ago by anonymous

comment:1 Changed 5 years ago by anonymous

The C++ program includes <cursesw.h>. This header is installed by both libncurses and libncursesw, the only difference is that <cursesw.h> is located in $(STAGING_DIR)/usr/include, and cursesw.h from libncursesw is located in $(STAGING_DIR)/usr/include/ncursesw. However, cursesw.h, which is located in $(STAGING_DIR)/usr/include takes priority because $(STAGING_DIR)/usr/include path is usually situated before the $(STAGING_DIR)/usr/include/ncursesw and therefore cursesw.h includes curses.h from the same dir, which lacks "wide" functions support.

Long story short, to fix this problem it is necessary to install ncurses headers in a separate dir $(STAGING_DIR)/usr/include/ncurses. The way it's done in other distros.

See the patch attached, it already includes the initial patch to enable cxx bindings.

Thank you!

Changed 5 years ago by anonymous

Changed 5 years ago by anonymous

updated patch

comment:2 Changed 5 years ago by anonymous

I see it causes problems for stupid programs/broken Makefiles relying on having curses.h in $(STAGING_DIR)/usr/include and not doing any ncurses detection (so far hnb and abook).

Hence, updated patch is attached.

comment:3 Changed 5 years ago by anonymous

There are way too many apps with incorrect configure, unable to find ncurses after this change... Perhaps some other way around of this problem with <cursesw.h> has to be found..

Still the first patch enabling cxx bindings should be accepted.

comment:4 Changed 5 years ago by anonymous

The least intrusive variant (which doesn't affect existing ncurses apps and allows for compilation of the C++ app in question) is to modify $(STAGING_DIR)/host/bin/ncursesw5-config to output only the second one (and the only correct) include directory.

Before:

$ ./staging_dir/target-mipsel_uClibc-0.9.32/host/bin/ncursesw5-config --cflags
-I/home/bas/build/openwrt-xburst/staging_dir/target-mipsel_uClibc-0.9.32/usr/include -I/home/bas/build/openwrt-xburst/staging_dir/target-mipsel_uClibc-0.9.32/usr/include/ncursesw

After:

$ ./staging_dir/target-mipsel_uClibc-0.9.32/host/bin/ncursesw5-config --cflags
-I/home/bas/build/openwrt-xburst/staging_dir/target-mipsel_uClibc-0.9.32/usr/include/ncursesw

In other words, we don't need the first include directory for wide ncurses, it breaks things because this first include directory contains includes from non-wide ncurses (at first i tried to fix it by installing non-wide ncurses includes under its own directory, but it didn't work as expected).

The patch is attached and fully tested by building of most openwrt ncurses-based packages.

Changed 5 years ago by anonymous

the final patch

comment:5 Changed 5 years ago by jow

  • Resolution set to fixed
  • Status changed from new to closed

Applied in r26970, thanks!

comment:6 Changed 2 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.