From e5a9ac149de5f538fcb57213d043c996ed3e4379 Mon Sep 17 00:00:00 2001 From: Explorer09 Date: Thu, 17 Oct 2024 00:51:25 +0800 Subject: [PATCH] configure test for stdscr --- configure.ac | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/configure.ac b/configure.ac index 54f6e0e28..3b2ce2ffb 100644 --- a/configure.ac +++ b/configure.ac @@ -665,6 +665,26 @@ else [AC_CHECK_HEADERS([term.h], [], [AC_MSG_ERROR([can not find required term header file])])]) fi + +AC_MSG_CHECKING([for stdscr]) +AC_LINK_IFELSE([AC_LANG_PROGRAM([[ +/* +#include +#include +*/ +/* extern WINDOW* stdscr; */ +/* int keypad(WINDOW* win, bool enable); */ + ]], [[ +WINDOW* foo; /*checks if the header is included*/ +keypad(stdscr, 0); + ]])], + [ + cat config.log | tail -n 100 + AC_MSG_RESULT(yes)], + [ + cat config.log | tail -n 100 + AC_MSG_RESULT(no) + AC_MSG_ERROR([stdscr not found])]) CFLAGS=$htop_save_CFLAGS if test "$enable_static" = yes; then