summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac4
-rw-r--r--xrestop.c8
2 files changed, 10 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 99df638..0bd998d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -17,7 +17,9 @@ XORG_DEFAULT_OPTIONS
PKG_CHECK_MODULES(XLIBS, x11 xres xext)
# check for ncurses, fall back to curses
-AC_CHECK_LIB([ncurses], [initscr],,AC_CHECK_LIB([curses], [initscr]))
+AC_SEARCH_LIBS([initscr], [ncurses curses])
+AS_IF([test "x$ac_cv_search_initscr" = "x-lncurses"],
+ [AC_CHECK_HEADERS([ncurses.h ncurses/curses.h])])
AC_SEARCH_LIBS([stdscr], [tinfo])
# Checks for typedefs, structures, and compiler characteristics.
diff --git a/xrestop.c b/xrestop.c
index 16b4887..58b2e44 100644
--- a/xrestop.c
+++ b/xrestop.c
@@ -34,6 +34,10 @@
*/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -44,8 +48,10 @@
#include <X11/Xatom.h>
#include <X11/extensions/XRes.h>
-#ifdef HAVE_LIBNCURSES
+#ifdef HAVE_NCURSES_H
#include <ncurses.h>
+#elif defined(HAVE_NCURSES_CURSES_H)
+#include <ncurses/curses.h>
#else
#include <curses.h>
#endif