AC_MSG_ERROR(cannot find nanosleep)))
AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$nanosleep_needs_rt" = "xyes")
-with_ncurses="yes"
-AC_CHECK_HEADERS(ncursesw/ncurses.h, [with_ncurses="yes"], [with_ncurses="no"])
+with_ncurses="no"
+AC_CHECK_HEADERS(ncursesw/ncurses.h ncurses.h, [with_ncurses="yes"], [])
if test "x$with_ncurses" = "xyes"
then
- AC_CHECK_LIB(ncursesw, mvwprintw, [with_ncurses="yes"], [with_ncurses="no"])
+ have_ncursesw="no"
+ have_ncurses="no"
+ NCURSES_LIB=""
+
+ AC_CHECK_LIB(ncursesw, mvwprintw, [have_ncursesw="yes"], [have_ncursesw="no"])
+ AC_CHECK_LIB(ncurses, mvwprintw, [have_ncurses="yes"], [have_ncurses="no"])
+
+ if test "x$have_ncursesw" = "xyes"; then
+ NCURSES_LIB="-lncursesw"
+ else if test "x$have_ncurses" = "xyes"; then
+ NCURSES_LIB="-lncurses"
+ else
+ with_ncurses="no"
+ fi; fi
+ AC_SUBST(NCURSES_LIB)
fi
AM_CONDITIONAL(BUILD_WITH_LIBNCURSES, test "x$with_ncurses" = "xyes")
noping_SOURCES = oping.c
noping_CPPFLAGS = $(AM_CPPFLAGS) -DUSE_NCURSES=1
-noping_LDADD = liboping.la -lm -lncursesw
+noping_LDADD = liboping.la -lm $(NCURSES_LIB)
if BUILD_WITH_LIBRT
noping_LDADD += -lrt
endif
# define NCURSES_OPAQUE 1
/* http://newsgroups.derkeiler.com/Archive/Rec/rec.games.roguelike.development/2010-09/msg00050.html */
# define _X_OPEN_SOURCE_EXTENDED
-# include <ncursesw/ncurses.h>
+
+# if HAVE_NCURSESW_NCURSES_H
+# include <ncursesw/ncurses.h>
+# elif HAVE_NCURSES_H
+# include <ncurses.h>
+# endif
# define OPING_GREEN 1
# define OPING_YELLOW 2
#if USE_NCURSES
static _Bool has_utf8() /* {{{ */
{
+# if HAVE_NCURSESW_NCURSES_H
if (!opt_utf8)
{
/* Automatically determine */
opt_utf8 = 1;
}
return ((_Bool) (opt_utf8 - 1));
+# else
+ return (0);
+# endif
} /* }}} _Bool has_utf8 */
static int update_prettyping_graph (ping_context_t *ctx, /* {{{ */