From cfab408b2da083ed56684ea9c1031b3981e36c59 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Tue, 4 Feb 2025 21:56:18 +0100 Subject: [PATCH] check for ncursesw use ncursesw in teminal.c --- configure.ac | 16 +++------------- src/frontend/terminal.c | 6 +++--- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/configure.ac b/configure.ac index 57396e8a9..a41688452 100644 --- a/configure.ac +++ b/configure.ac @@ -1276,8 +1276,8 @@ else [AC_MSG_ERROR([Couldn't find GNU readline headers.])]) AC_CHECK_HEADER([curses.h], [AC_DEFINE([HAVE_CURSES_H], [], [Define if we have curses header in include])], - [AC_CHECK_HEADER([ncurses/curses.h], - [AC_DEFINE([HAVE_NCURSES_CURSES_H], [], [Define if we have curses.h in include/ncurses])], + [AC_CHECK_HEADER([ncursesw/curses.h], + [AC_DEFINE([HAVE_NCURSES_CURSES_H], [], [Define if we have curses.h in include/ncursesw])], [AC_MSG_ERROR([Couldn't find curses.h.])])]) AC_SEARCH_LIBS([tputs], [ncursesw tinfo termcap], [AC_DEFINE([HAVE_TERMCAP], [], [Define if we have ncurses/terminfo or termcap])], @@ -1286,18 +1286,8 @@ else [LIBS="$LIBS -lreadline"], [AC_MSG_ERROR([Couldn't find readline libraries.])]) AC_CHECK_LIB([ncursesw], [tputs], - [LIBS="$LIBS -lncurses"], + [LIBS="$LIBS -lncursesw"], [AC_MSG_ERROR([Couldn't find ncurses libraries.])]) -# PKG_CHECK_MODULES([NCURSES], [ncursesw], [ -# AC_SUBST([CURSES_CFLAGS], ["$NCURSES_CFLAGS"]) -# AC_SUBST([CURSES_LIBS], ["$NCURSES_LIBS"]) -# AC_DEFINE([HAVE_CURSES_H], [1], [Define if curses.h is available]) -# CPPFLAGS="$CPPFLAGS $NCURSES_CFLAGS" -# ]) - # Now check for curses.h using the updated CPPFLAGS - AC_CHECK_HEADERS([curses.h], [], [ - AC_MSG_WARN([curses.h not found.]) - ]) fi else # Especially defined for macOS (Big Sur), with readline installed from Brew diff --git a/src/frontend/terminal.c b/src/frontend/terminal.c index 4c95a3797..8a913a402 100644 --- a/src/frontend/terminal.c +++ b/src/frontend/terminal.c @@ -26,8 +26,8 @@ Author: 1986 Wayne A. Christopher, U. C. Berkeley CAD Group #include #include #elif defined(HAVE_NCURSES_CURSES_H) -#include -#include +#include +#include #endif #endif @@ -35,7 +35,7 @@ Author: 1986 Wayne A. Christopher, U. C. Berkeley CAD Group #ifdef HAVE_TERMCAP_H #include #elif HAVE_NCURSES_TERMCAP_H -#include +#include #endif #include "ngspice/cpdefs.h"