From a7bcf1d2e4e6b4783c3bb64696c70d8b8560b607 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Thu, 8 Sep 2011 01:45:16 +0000 Subject: [PATCH] Try harder to find the ncurses header, fixes detection in SuSE SLES9. (thanks to Moritz Barsnick) --- ChangeLog | 2 ++ RichString.c | 10 +++++++--- RichString.h | 10 +++++++--- configure.ac | 4 +++- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index bb5a9360..95720003 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,8 @@ What's new in version 0.9.1 (thanks to Sebastian Pipping) * Incremental filtering (thanks to Seth Heeren for the idea and initial implementation) +* Try harder to find the ncurses header + (thanks to Moritz Barsnick) * BUGFIX: Support larger numbers for process times. (thanks to Tristan Nakagawa for the report.) * BUGFIX: Segfault in BarMeterMode_draw() for small terminal widths diff --git a/RichString.c b/RichString.c index 6d87cd84..aef8c959 100644 --- a/RichString.c +++ b/RichString.c @@ -12,10 +12,14 @@ #include "debug.h" #include -#ifdef HAVE_LIBNCURSESW -#include -#else +#ifdef HAVE_CURSES_H #include +#elif HAVE_NCURSES_H +#include +#elif HAVE_NCURSESW_CURSES_H +#include +#elif HAVE_NCURSES_NCURSES_H +#include #endif #define RICHSTRING_MAXLEN 300 diff --git a/RichString.h b/RichString.h index b6622a13..754ff9b2 100644 --- a/RichString.h +++ b/RichString.h @@ -15,10 +15,14 @@ #include "debug.h" #include -#ifdef HAVE_LIBNCURSESW -#include -#else +#ifdef HAVE_CURSES_H #include +#elif HAVE_NCURSES_H +#include +#elif HAVE_NCURSESW_CURSES_H +#include +#elif HAVE_NCURSES_NCURSES_H +#include #endif #define RICHSTRING_MAXLEN 300 diff --git a/configure.ac b/configure.ac index 0eb41ece..871f8939 100644 --- a/configure.ac +++ b/configure.ac @@ -87,7 +87,9 @@ fi AC_ARG_ENABLE(unicode, [AC_HELP_STRING([--enable-unicode], [enable Unicode support])], ,enable_unicode="no") if test "x$enable_unicode" = xyes; then AC_CHECK_LIB([ncursesw], [refresh], [], [missing_libraries="$missing_libraries libncursesw"]) - AC_CHECK_HEADERS([ncursesw/curses.h],[:],[missing_headers="$missing_headers $ac_header"]) + AC_CHECK_HEADERS([ncursesw/curses.h],[:], + [AC_CHECK_HEADERS([ncurses/ncurses.h],[:], + [AC_CHECK_HEADERS([ncurses.h],[:],[missing_headers="$missing_headers $ac_header"])])]) else AC_CHECK_LIB([ncurses], [refresh], [], [missing_libraries="$missing_libraries libncurses"]) AC_CHECK_HEADERS([curses.h],[:],[missing_headers="$missing_headers $ac_header"])