From 8adf6b31382e470d706dda4281200813f77eed9c Mon Sep 17 00:00:00 2001 From: Jaco Kroon Date: Tue, 29 Dec 2020 16:47:14 +0200 Subject: [PATCH 1/2] Split functions test in ncurses again tinfo and ncurses. This is required to compile against newer ncurses that no longer implicitly links tinfo. Signed-off-by: Jaco Kroon --- configure | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++- configure.ac | 4 +++- 2 files changed, 65 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 359c8bd..6de59f9 100755 --- a/configure +++ b/configure @@ -5538,7 +5538,7 @@ else as_fn_error $? "Unable to find the ncurses library" "$LINENO" 5; break; fi - for ac_func in clear refresh endwin mvaddstr mvchgat mvhline getch beep initscr nonl keypad noecho cbreak halfdelay addnstr + for ac_func in clear refresh endwin mvaddstr mvchgat mvhline getch beep initscr nonl do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -5550,6 +5550,67 @@ _ACEOF else as_fn_error $? "Unable to find some ncurses functions" "$LINENO" 5; break; fi +done + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cur_term in -ltinfo" >&5 +$as_echo_n "checking for cur_term in -ltinfo... " >&6; } +if ${ac_cv_lib_tinfo_cur_term+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ltinfo $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char cur_term (); +int +main () +{ +return cur_term (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_tinfo_cur_term=yes +else + ac_cv_lib_tinfo_cur_term=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tinfo_cur_term" >&5 +$as_echo "$ac_cv_lib_tinfo_cur_term" >&6; } +if test "x$ac_cv_lib_tinfo_cur_term" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBTINFO 1 +_ACEOF + + LIBS="-ltinfo $LIBS" + +else + as_fn_error $? "Unable to find the tinfo (ncurses) library" "$LINENO" 5; break; +fi + + for ac_func in keypad noecho cbreak halfdelay addnstr +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +else + as_fn_error $? "Unable to find some tinfo (ncurses) functions" "$LINENO" 5; break; +fi done test_pthread=yes diff --git a/configure.ac b/configure.ac index 9306ef8..829d793 100644 --- a/configure.ac +++ b/configure.ac @@ -60,7 +60,9 @@ if test x$enable_ui = xtrue; then ], [AC_MSG_ERROR([Unable to find the ncurses headers]); break;]) ]) AC_CHECK_LIB([ncurses], [initscr], [], [AC_MSG_ERROR([Unable to find the ncurses library]); break;]) - AC_CHECK_FUNCS([clear refresh endwin mvaddstr mvchgat mvhline getch beep initscr nonl keypad noecho cbreak halfdelay addnstr], [], [AC_MSG_ERROR([Unable to find some ncurses functions]); break;]) + AC_CHECK_FUNCS([clear refresh endwin mvaddstr mvchgat mvhline getch beep initscr nonl], [], [AC_MSG_ERROR([Unable to find some ncurses functions]); break;]) + AC_CHECK_LIB([tinfo], [cur_term], [], [AC_MSG_ERROR([Unable to find the tinfo (ncurses) library]); break;]) + AC_CHECK_FUNCS([keypad noecho cbreak halfdelay addnstr], [], [AC_MSG_ERROR([Unable to find some tinfo (ncurses) functions]); break;]) test_pthread=yes fi From f1b72a4ecb0eeddedfcbe3f07b6b3c9141f32a92 Mon Sep 17 00:00:00 2001 From: Jaco Kroon Date: Tue, 29 Dec 2020 16:48:08 +0200 Subject: [PATCH 2/2] .gitignore file to make status less cluttered during dev. Signed-off-by: Jaco Kroon --- .gitignore | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0ddb218 --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +Makefile +autom4te.cache/ +config.log +config.status +src/.deps/ +src/config.h +src/stamp-h1 +src/*.o +src/sqtop +*~