diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-12-08 15:20:28 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-12-08 15:31:38 -0800 |
commit | 96d84072fe0d0dcbd047cc8f9b3012e0c522d125 (patch) | |
tree | 9107a33a9252950abb82dc6d7d9466ec6a938c33 | |
parent | b0491c6f37255e200c6f434616f7f7d72ece5302 (diff) |
Fix builds on Solaris
Need to include the ncurses version of curses.h when linking against
ncurses, as the standard Solaris curses.h is incompatible with ncurses.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | xrestop.c | 8 |
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. @@ -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 |