Skip to content

Commit

Permalink
Better recognition of ncurses header files
Browse files Browse the repository at this point in the history
This patch was lifted directly from:
Tlf/tlf@a215132

The commit message reads:
  If ax_with_ncurses finds a ncursesw instance the former code checks
  only for <ncursesw/panelh>. If not there the search fails.
  That let to problems at least in Arch Linux which has only <panel.h>
  installed.
  The patched version here checks first for <ncursesw/panel.h> and if
  not found also for <panel.h>.

  Tested for the following distributions:

  Gentoo, Debian 7..9, Linux Mint 17 and 18.1, Arch Linux, Ubuntu

ARCH Linux builds ncurses with wide character support but does not add
any ncurses specific headers. nurses its self (by default) adds almost
no ncurses specific headers. No {prefix}/include/ncurses directory. In
fact the only ncurses specific file is the ncurses.h symlink to
curses.h, other than that there are no ncurses headers.

The ax_with_curses.m4 script detects if the installed ncurses has wide
character support. It checks using code snippets against all possible
ncurses header files.

If the ax_with_curses.m4 script detects wide character support the
ax_with_curses_extra.m4 will only look for extra curses features (in
the case of petitboot, form.h and menu.h) inside the
{prefix}/include/ncurses directory, when they could simply be in
{prefix}/include.

Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
  • Loading branch information
cyrilbur-ibm authored and sammj committed Nov 21, 2017
1 parent 817e669 commit 117a75f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions m4/ax_with_curses_extra.m4
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,11 @@ AC_DEFUN([_AX_WITH_CURSES_EXTRA], [
], [
AS_IF([test "x$ax_cv_curses_which" = xncursesw], [
_AX_WITH_CURSES_CHECKEXTRA([$1], [$2], [$3], [ncursesw/$4], [$5])
dnl This fixes a problem building on distros with 'odd'
dnl ncurses header file setups
AS_IF([test x$[]ax_cv_[]m4_tolower($1) != "xyes"], [
_AX_WITH_CURSES_CHECKEXTRA([$1], [$2], [$3], [$4], [$5])
])
], [test "x$ax_cv_curses_which" = xncurses], [
_AX_WITH_CURSES_CHECKEXTRA([$1], [$2], [$3], [ncurses/$4], [$6])
_AX_WITH_CURSES_CHECKEXTRA([$1], [$2], [$3], [$4], [$6])
Expand Down

0 comments on commit 117a75f

Please sign in to comment.